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

fix SearchLogQuery behavior to conform to openapi spec #1145

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

bobcallaway
Copy link
Member

This returns an empty JSON array [] if all inputs are valid queries but entries are not found in the backing log(s) instead of returning an HTTP 404.

Also adds much more thorough test coverage, helping address #1041 (only tests within single shard though).

Note: while this does not change the API interface, it does change the behavior of the endpoint so we should discuss if/how to backport this to v1.0.0 given API stability requirements.

Fixes: #1144

Signed-off-by: Bob Callaway bcallaway@google.com

Signed-off-by: Bob Callaway <bcallaway@google.com>
@bobcallaway bobcallaway requested a review from a team as a code owner October 23, 2022 16:16
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for all the testcases

what happens if it is a malformed index (-1) instead of a nonexistent index?
jk... an entry that could never exist vs an entry that does not

@bobcallaway bobcallaway merged commit 7b07792 into sigstore:main Oct 25, 2022
@github-actions github-actions bot added this to the v1.1.0 milestone Oct 25, 2022
@bobcallaway
Copy link
Member Author

@priyawadhwa thoughts on cherry-picking this into v1.0.1?

priyawadhwa pushed a commit to priyawadhwa/rekor that referenced this pull request Nov 8, 2022
Signed-off-by: Bob Callaway <bcallaway@google.com>
@priyawadhwa
Copy link
Contributor

sure, opened #1191

priyawadhwa pushed a commit to priyawadhwa/rekor that referenced this pull request Nov 8, 2022
Signed-off-by: Bob Callaway <bcallaway@google.com>
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/api/v1/log/entries/retrieve returns 404 instead of 200 and empty result array
4 participants