Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/artifactory/resources/artifact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def property_search(options = {})
# the MD5 checksum of the artifact to search for
# @option options [String] :sha1
# the SHA1 checksum of the artifact to search for
# @option options [String] :sha256
# the SHA256 checksum of the artifact to search for
# @option options [String, Array<String>] :repos
# the list of repos to search
#
Expand All @@ -177,7 +179,7 @@ def property_search(options = {})
#
def checksum_search(options = {})
client = extract_client!(options)
params = Util.slice(options, :md5, :sha1, :repos)
params = Util.slice(options, :md5, :sha1, :sha256, :repos)
format_repos!(params)

client.get("/api/search/checksum", params)["results"].map do |artifact|
Expand Down
12 changes: 7 additions & 5 deletions spec/unit/resources/artifact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,14 @@ module Artifactory

it "slices the correct parameters" do
expect(client).to receive(:get).with("/api/search/checksum",
md5: "MD5123",
sha1: "SHA456").once
md5: "MD5123",
sha1: "SHA456",
sha256: "SHA789").once
described_class.checksum_search(
md5: "MD5123",
sha1: "SHA456",
fizz: "foo"
md5: "MD5123",
sha1: "SHA456",
sha256: "SHA789",
fizz: "foo"
)
end

Expand Down