-
Notifications
You must be signed in to change notification settings - Fork 29
fix: use artifact filenames as keys for verifying jfrog assets in provenance_witness_l1_check #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use artifact filenames as keys for verifying jfrog assets in provenance_witness_l1_check #796
Conversation
…venance_witness_l1_check Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
2464747
to
baf3691
Compare
Rebase to obtain the changes from #798 |
look_up[subject["name"]] = {} | ||
look_up[subject["name"]][subject["digest"]["sha256"]] = subject | ||
# Get the artifact name, which should be the last part of the artifact subject value. | ||
_, _, artifact_filename = subject["name"].rpartition("/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code splitting this string is assuming that the name is of the form https://witness.dev/attestations/product/v0.1/file:path/to/file
. I know that this function is currently only called on a list that comes from extract_build_artifacts_from_witness_subjects
, which currently only produces subjects of that form, but if that changes in future this code would silently break. I think it would be safer for this code to validate that it is a witness file subject before extracting the filename and throw an exception if it is not (which currently should never happen).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I have added the validation here - c57936b
Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
@tromai Not sure why |
Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
…venance_witness_l1_check (#796) Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
No description provided.