Skip to content
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

update: improve missing trustpolicy error message #282

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

kody-kimberl
Copy link
Contributor

This PR improves the error message for a missing trustpolicy file

This PR intends to resolve the last comment in the following issue:
notaryproject/notation/#128

This is the output when the trustpolicy is missing:

c889f3b9d811:notation kodysk$ ./bin/notation verify $IMAGE
Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable.
Error: Trust policy is not present, please create trust policy at /Users/kodysk/Library/Application Support/notation/trustpolicy.json

Signed-off-by: Kody Kimberl [email protected]

Copy link
Contributor Author

@kody-kimberl kody-kimberl left a comment

Choose a reason for hiding this comment

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

I made a new commit that addresses the above comments. It now checks the error type to determine what message to return.

Output when trustpolicy is missing:

c889f3b9d811:notation kodysk$ ./bin/notation verify $IMAGE
Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable.
Error: trust policy is not present, please create trust policy at /Users/kodysk/Library/Application Support/notation/trustpolicy.json

Output when trustpolicy has 000 permissions:

c889f3b9d811:notation kodysk$ ./bin/notation verify $IMAGE
Warning: Always verify the artifact using digest(@sha256:...) rather than a tag(:v1) because resolved digest may not point to the same signed artifact, as tags are mutable.
Error: unable to read trust policy due to file permissions, please verify the permissions of /Users/kodysk/Library/Application Support/notation/trustpolicy.json

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JeyJeyGao JeyJeyGao left a comment

Choose a reason for hiding this comment

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

LGTM

@priteshbandi priteshbandi merged commit 9920fb7 into notaryproject:main Mar 3, 2023
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.

None yet

4 participants