Skip to content

Conversation

@migmartri
Copy link
Member

This patch allows setting @sha256:digest in the policy reference which will be used for

  • pull the right policy version in the case of a policy from a chainloop provider.
  • client-side validate other providers such as file or HTTP

This patch also includes some minor updates on error handling to cleanup a little bit the message, I know @jiparis you were asking for this, and I think you are right.

This is now an example of a policy that digest mismatches

failed to load policy attachment "file:///Users/miguelmartinez/work/chainloop/policies-playground/cyclonedx-licenses.yaml@sha256:12b7d023ea5410cb4f35804f8a6cd66a6e1bdc0bedb12c65a04e6b4b4c15f352": digest mismatch: got sha256:4f07666ec9c464885bb3ec65d400a63dca2c47b4c8ac278a9365146137265093, want sha256:12b7d023ea5410cb4f35804f8a6cd66a6e1bdc0bedb12c65a04e6b4b4c15f352

closes #1111

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri requested a review from jiparis September 8, 2024 18:28
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Copy link
Member

@jiparis jiparis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!. Maybe adding some documentation after this PR.

@migmartri migmartri merged commit e84f609 into chainloop-dev:main Sep 9, 2024
@migmartri migmartri deleted the 1111-digest-policies branch September 9, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to pin policies by digest

2 participants