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

/api/v1/log/entries/retrieve returns 404 instead of 200 and empty result array #1144

Closed
bobcallaway opened this issue Oct 22, 2022 · 0 comments · Fixed by #1145
Closed

/api/v1/log/entries/retrieve returns 404 instead of 200 and empty result array #1144

bobcallaway opened this issue Oct 22, 2022 · 0 comments · Fixed by #1145
Labels
bug Something isn't working

Comments

@bobcallaway
Copy link
Member

Description

The SearchLogQuery endpoint (/api/v1/log/entries/retrieve) is documented in openapi.yaml to return a JSON array with 0 or more resulting entries that match the search criteria. There is 0 mention of returning a 404 from this endpoint.

If an request is searching for two entries (one that exists and one that doesn't), the server currently returns a 404 instead of just returning the one entry that actually exists in the log.

2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1355 exists but 2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1345 doesn't:

bcallaway@bcallaway01:~/git/sigstore/rekor$ curl -i -XPOST --data-binary '{"entryUUIDs":["2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1355","2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1345"]}' -H "Content-Type: application/json" http://localhost:3000/api/v1/log/entries/retrieve
HTTP/1.1 404 Not Found
Content-Type: application/json
Vary: Origin
Date: Sat, 22 Oct 2022 17:01:22 GMT
Content-Length: 134

{"code":404,"message":"error getting log entry for 2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1345"}

Expected:

bcallaway@bcallaway01:~/git/sigstore/rekor$ curl -XPOST --data-binary '{"entryUUIDs":["2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1355","2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1345"]}' -H "Content-Type: application/json" http://localhost:3000/api/v1/log/entries/retrieve
[{"2a7899b181028bb64a5545cab55f0d2d54523b0de3e08c7f866d0c66a980a186676b6504c17d1355":{"body":"eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI0NzhhNjkzYTdiZmUyNjRmZmNkOGZiMWJjMTNmYmFiNDRlZjQ0N2E2MGI4YzEyY2NmZDZkNjBlYzE5MTA1ZWYzIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQlFSMUFnVTBsSFRrRlVWVkpGTFMwdExTMEtDbmR6UkdOQ1FVRkNRMEZCVVVKUlNtcFdRME5MUTFKRVdXOHJka0ZUU2swMk5HZEJRWEZ4WTAxQlIyNDRhbmw0YUN0WFFXNXFRbTgyYTBSWVJqUk5jUzhLZEVKSlNGUlpUMDFFUVcxaFFTdHpNMmR3ZUhScFFXbERhblpGTXpCV01EbFhhMEpTT0U1bE1FWnBjRnBPUjJGUVpVNTNjVEIzVm1wUWMxRkNTVkpYUVFwblExVjNaV2gyVFhKeGJXMXFLMlZvU2tORE5GSXZZVVppUVZWMFZuSjRNRkpsYm5jek5VYzBVbEJ4YlhwbFdHbDJNV1UwWTBwdmFqZExNamxRTkhsWkNqRkNaRVJOYm5oM09VYzFTbTkxVWtjeVVrOUJOR3hDUWxWWk1EaFRTVk51TXl0VlFuSkZNRkpVZUhCR1VsWXZTakZVVVZwTlpVaENRVmhxVjBWb01pc0tWbGhwTlhKU1UwTTVPR3hDVUdWVE1WbzRURWcwUzI4d2NXOUNXR3BxVnl0RE9HOUVLM2gwUVc5M1FtUm5OM2hZZVZsbU5XRjRUMHB0YnpKT1VVMVVjQXBMVm5samRYZEpSR0pCTURKS09HdE1aMWRaVkROQ01FZENTQzlwYms1N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VFRrdk5XcDFkMkoxUzNSdGNIbGlha0p5T1ZRS05uSkdRVGd4Vm5kRU1GWlVUMHhMV1NzeGMzZGhWMjh6YWtoYWJtTnRkbVJXVVRsQlYwaENZMWh3VkhkRmVtVldNV3ROTUN0aFdVZ3dOSEZYZDAxS1NBb3ZkalJETDBGdWJtRkdTRVZFVFdsaUsxZEhOV1ZRV0VVclVHdHJWelZSVTNOQ1pHOUZaMnN6VTBwdmJIQmtWVWcwYTFaMlRtUlFWVTExUjI5S1NGWlFDbVoyVG14SmNXTnplRWx4TWpob056RlJORGR2Ymt4cFlVSm1iMGxQVFRoNk9WYzNNVzl0U0U5eFduQldVblJyTldwQmJVaHRhVTkwV1haUGVrTXZWWElLTUVveGVWbE5VbTl5YUdZck4xaFFOVFZoU1RKUGQyTlVaVzVPVTB0eVowMXRSblJRWjBsSFMyOTJSV1JwZUVReVpuZ3hVRE50TXpadGFXOXVXRkU1VlFwWFVqWkdkamQ1VTBoVWJEZGpVVEV6YWtkdFUxSXhUamhvWnowOUNqMHdOMmx5Q2kwdExTMHRSVTVFSUZCSFVDQlFWVUpNU1VNZ1MwVlpJRUpNVDBOTExTMHRMUzA9In19fX0=","integratedTime":1666457738,"logID":"68f87a6650aa1f4ce95cf645f69a2183fbb87cb0719daedee9c9aa8019134d0b","logIndex":1,"verification":{"inclusionProof":{"checkpoint":"b7d060183cf3 - 3060364934450940854\n75\nWrg1mCylbTIvrWaJNFXVA/G7y5uVQnf0lyThkq12LcA=\nTimestamp: 1666457857262976311\n\n— b7d060183cf3 aPh6ZjBGAiEA/nOJNf5CZB+PUJbwMOI3X3Hn1CgYDgXtChEN6+KSUagCIQC1NZCoroSh5DJpZsiYbkLplRbnkHtxPa0jspBu7vR8cw==\n","hashes":["154c13bf9ab1360f9de1f11fcd5dd4045b44b915b5e2fe032873b121ded1eac7","97962f5716439d51e0e18d17a6f52d21f9cdf940c8efd29ccb13417e4b3a7edb","723f99e78a9710ffceb87c91136d448bb0fc86902aa7a2c810e997bbd6b2ec3f","c8b2bc82e8e2dd93f94ee07f562189f6f79c7b2d2d6845886e0b47a9279159fb","32c5c8dea6d24ed0828dade4b7a79d1d0b640661663a3e4a985f9ee6ac1dd929","65ffc13bbe662ecc8087ebe95d4e0526e4c1cedbfddfba60cbcab9bb3b696817","0695e089334e232f4c985f56a002c347d4e075a14515723a3a2814d8cfb23258"],"logIndex":1,"rootHash":"5ab835982ca56d322fad66893455d503f1bbcb9b954277f49724e192ad762dc0","treeSize":75},"signedEntryTimestamp":"MEYCIQDVCFkbxNC+iRVz2MbM8RjMcfzolcxLLBOItlRfsS7QIwIhAJmVR8gmA8iKxzAu620+F+Unc+uNI0Lmx0IGhdFq/BLR"}}}]

Version
v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant