From 5ed6c9b3973a25792cee6302b22ff98d547fbb81 Mon Sep 17 00:00:00 2001 From: Philipp Belitz Date: Fri, 16 Dec 2022 12:19:12 +0100 Subject: [PATCH] fixup! feat: support tag and digest simultaneously --- connaisseur/validators/notaryv1/notaryv1_validator.py | 5 ++++- tests/validators/notaryv1/test_notaryv1_validator.py | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/connaisseur/validators/notaryv1/notaryv1_validator.py b/connaisseur/validators/notaryv1/notaryv1_validator.py index ab6c4b941..a28df2bec 100644 --- a/connaisseur/validators/notaryv1/notaryv1_validator.py +++ b/connaisseur/validators/notaryv1/notaryv1_validator.py @@ -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 diff --git a/tests/validators/notaryv1/test_notaryv1_validator.py b/tests/validators/notaryv1/test_notaryv1_validator.py index e469b8a3a..dc95cad32 100644 --- a/tests/validators/notaryv1/test_notaryv1_validator.py +++ b/tests/validators/notaryv1/test_notaryv1_validator.py @@ -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 )