Skip to content

fix retrieve endpoint response code and add testing#1043

Merged
dlorenc merged 1 commit intosigstore:mainfrom
asraa:fix-retrieve
Sep 13, 2022
Merged

fix retrieve endpoint response code and add testing#1043
dlorenc merged 1 commit intosigstore:mainfrom
asraa:fix-retrieve

Conversation

@asraa
Copy link
Contributor

@asraa asraa commented Sep 9, 2022

Signed-off-by: Asra Ali asraa@google.com

Summary

Fixes #1040
Fixes #1027
Adds some testing for #1041

This change improves response codes returned by erroneous entries on the entries/retrieve endpoint:

  • Returns a 404 when entries are not found via EntryUUID. This would originally be 400.
  • Returns 400 when entries are malformed (cannot be unmarshalled or canonicalized). Previously this was 500.
  • If well-formed entries are not found by hash or by proposed entry, then we now return 404 instead of 400
  • If entries are requested by index and are not found, we return 404 instead of 500

Release Note

  • fix!: Response codes for entries/retrieve are changed: 404s are now returned for entries not found by hash, proposed entry, or index. 400s are returned for malformed entries. Previously, server returned 500.

Documentation

Signed-off-by: Asra Ali <asraa@google.com>
@asraa asraa requested a review from a team as a code owner September 9, 2022 19:57
Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

nice!!

@dlorenc dlorenc merged commit a5f3b0a into sigstore:main Sep 13, 2022
@github-actions github-actions bot added this to the v1.0.0 milestone Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants