-
Notifications
You must be signed in to change notification settings - Fork 165
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 nil-pointer error when artifact-hash is passed without artifact #965
Conversation
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
84d4590
to
6882d35
Compare
cc @bobcallaway |
Codecov Report
@@ Coverage Diff @@
## main #965 +/- ##
==========================================
- Coverage 48.20% 48.10% -0.11%
==========================================
Files 61 61
Lines 5383 5401 +18
==========================================
+ Hits 2595 2598 +3
- Misses 2506 2522 +16
+ Partials 282 281 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
How does this work with HashedRekord which only requires an artifact hash but not the full artifact?
Thanks for the callout @asraa. I wasn't aware of that. I took a look at all the different type implementation, and saw that only HashedRekord doesn't require the artifact. However, i found prior art in some types, where the path is checked in the rekor/pkg/types/cose/v0.0.1/entry.go Lines 307 to 309 in 234afe7
I'll do the same for the |
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
8fa6ed6
to
f1e4d7f
Compare
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.
Thanks for the quick change!
I believe this fixes your nil-ptr error, and helps ensure that if artifactBytes aren't set for the entry then artifact path must be
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.
lgtm as well
Summary
This PR fixes a nil pointer error that occurs when the
artifact-hash
is passed to theverify
command, but theartifact
is not. All entry types excluding theHashRekord
require the artifact.For example, a command like
rekor-cli verify --artifact-hash 12decf1b0f659fd90988454b75ebsdfb32abfabbc1a3adf3a293e17fj480213f4
results in the below error
Release Note
Documentation