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

openapi: more hackery #5

Merged
merged 6 commits into from
Apr 22, 2024
Merged

openapi: more hackery #5

merged 6 commits into from
Apr 22, 2024

Conversation

woodruffw
Copy link
Member

This is a temporary workaround for sigstore/rekor#2091: LogEntry.body is marked as an object but is really a base64 string.

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Comment on lines +47 to +55
# LogEntry.body is incorrectly marked as an object in the current
# schema; adjust to a string. Technically the same condition as
# below, but separate for easy removal when fixed upstream.
# https://github.com/sigstore/rekor/pull/2091
elif .key == "body" and .value.type? == "object" then
.value = {"type": "string"}
# Fix missing inner type on LogEntry.attestation.data.
elif .key == "attestation" and .value.type? == "object" then
.value = {"type": "object", "properties": { "data": {"type": "string", "format": "byte"}}}
Copy link
Member Author

Choose a reason for hiding this comment

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

This applies two fixes:

  • LogEntry.body is marked as a JSON object in the upstream schema, but it's really a (base64) string.
  • The previous patch for LogEntry.attestation was slightly wrong, but went un-noticed since relatively few entries have an attestation: attestation is an object not a string, but its inner data member is a bas64 string.

Copy link
Member

Choose a reason for hiding this comment

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

Looks pretty reasonable (or as reasonable as this pile of hacks can be); thanks for digging into this: I took the schema at its word when it claimed that LogEntry.body was type: object.

@woodruffw woodruffw added the blocked ❌ Blocked on something else label Apr 19, 2024
@woodruffw
Copy link
Member Author

Blocked on merge of sigstore/rekor#2092. Once that's in, I can update the repo + ref for Rekor back to upstream.

Signed-off-by: William Woodruff <[email protected]>
@tnytown tnytown self-requested a review April 19, 2024 23:41
Copy link
Member

@tnytown tnytown left a comment

Choose a reason for hiding this comment

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

looks good, feel free to merge when unblocked!

@woodruffw woodruffw removed the blocked ❌ Blocked on something else label Apr 22, 2024
@woodruffw woodruffw merged commit 5403b6e into main Apr 22, 2024
11 checks passed
@woodruffw woodruffw deleted the ww/hackety-hack branch April 22, 2024 15:12
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 this pull request may close these issues.

2 participants