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

"rekor search --sha" should verify the format of a sha #379

Closed
sylvestre opened this issue Jul 20, 2021 · 2 comments · Fixed by #381
Closed

"rekor search --sha" should verify the format of a sha #379

sylvestre opened this issue Jul 20, 2021 · 2 comments · Fixed by #381

Comments

@sylvestre
Copy link
Contributor

@dlorenc explained me that rekor search --sha expects sha:. It should trigger an error:
Examples:
Works =>

$ ./rekor-cli search --sha sha256:e2e90d1a25f90a3156a27f00f3a4179578e3132ed4f010dc3498d09175b6071a
Found matching entries (listed by UUID):
af795d3d28375b3d310e76c0cfc48d1bb00555286eb7a9b9c9f2d10a1241065a

Fails without error

$ ./rekor-cli search --sha e2e90d1a25f90a3156a27f00f3a4179578e3132ed4f010dc3498d09175b6071a
No matching entries were found
@dlorenc
Copy link
Member

dlorenc commented Jul 20, 2021

+1 to this. @bobcallaway any ideas how to plumb the index types through for earlier validation?

@bobcallaway
Copy link
Member

I think the issue reported here is a regression from some of my cleanup work - as the API call always requires the sha256: prefix but in an effort to be backwards compatible I made it optional in the flag parsing.

Both are technically valid sha256 digests, but the reason the search fails is due to the lack of inserting the prefix ahead of the client making the API call to the server.

I'd have to think through abstracting and plumbing through validation from the index types.

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 a pull request may close this issue.

3 participants