Skip to content

Commit

Permalink
fixup! feat: support tag and digest simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
phbelitz committed Dec 16, 2022
1 parent 49932f0 commit 5ed6c9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion connaisseur/validators/notaryv1/notaryv1_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ async def validate(

# search for digests in given targets
digests = list(
map(lambda x: NotaryV1Validator.__search_image_targets(x, image), signed_image_targets)
map(
lambda x: NotaryV1Validator.__search_image_targets(x, image),
signed_image_targets,
)
)

# in case certain delegations are needed, `signed_image_targets` should only
Expand Down
4 changes: 1 addition & 3 deletions tests/validators/notaryv1/test_notaryv1_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,7 @@ async def test_process_chain_of_trust(
def test_search_image_targets_for_digest(sample_nv1, image: str, digest: str):
data = fix.get_td("sample_releases")["signed"]["targets"]
assert (
sample_nv1._NotaryV1Validator__search_image_targets(
data, Image(image)
)
sample_nv1._NotaryV1Validator__search_image_targets(data, Image(image))
== digest
)

Expand Down

0 comments on commit 5ed6c9b

Please sign in to comment.