rekor icon indicating copy to clipboard operation
rekor copied to clipboard

Add TLE response media type

Open Hayden-IO opened this issue 1 year ago • 2 comments

Description

We should support returning a response formatted as a TransparencyLogEntry (TLE) per the specification. This will be used by Sigstore clients who currently have to transform the Rekor response into the spec-compliant struct.

We should be able to implement this as a custom response type in OpenAPI - https://swagger.io/docs/specification/2-0/describing-responses/

Hayden-IO avatar Aug 26 '24 17:08 Hayden-IO

Not as straightforward - OpenAPI 3.0 allows a per-content-type schema, but not 2.0 which is what we're using - https://swagger.io/docs/specification/describing-responses/

Hayden-IO avatar Aug 26 '24 22:08 Hayden-IO

after reviewing, there's a problem in that we cannot take a TLE and convert back into a models.LogEntry because we don't have the tree ID to correctly set the entryUUID. While most tests still pass, others expect the full entryUUID and therefore I think this will significantly break clients. Given the flaky nature of go-openapi's Accept header support, and this fact, I think we'll have to punt this to the v2 api.

bobcallaway avatar Nov 03 '24 12:11 bobcallaway