Add support for JSON format to '/webapi/auth/export' endpoint#50193
Merged
Add support for JSON format to '/webapi/auth/export' endpoint#50193
Conversation
kopiczko
reviewed
Dec 13, 2024
Contributor
kopiczko
left a comment
There was a problem hiding this comment.
LGTM but the Marshal error should be handled properly as @marcoandredinis noted
zmb3
reviewed
Dec 13, 2024
zmb3
reviewed
Dec 13, 2024
5625ec3 to
18029ae
Compare
marcoandredinis
approved these changes
Dec 16, 2024
marcoandredinis
approved these changes
Dec 17, 2024
| mimeTypes = append(mimeTypes, "text/plain") | ||
|
|
||
| // Ignore duplicate MIME types | ||
| mimeTypes = slices.Compact(mimeTypes) |
Contributor
There was a problem hiding this comment.
I think you need to apply slices.Sort first. slices.Compact only "replaces consecutive runs of equal elements with a single copy"
Collaborator
There was a problem hiding this comment.
Or use utils.Deduplicate here.
Contributor
Author
There was a problem hiding this comment.
I'll use utils.Deduplicate - order needs to be preserved, as this should pick the first valid MIME type
zmb3
reviewed
Dec 17, 2024
zmb3
reviewed
Dec 17, 2024
Signed-off-by: Fred Heinecke <fred.heinecke@goteleport.com>
b1d3c93 to
cf13052
Compare
zmb3
approved these changes
Feb 19, 2025
cf13052 to
9e42a9f
Compare
|
@fheinecke See the table below for backport results.
|
This was referenced Feb 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for JSON-encoding responses from the
/webapi/auth/exportand/webapi/sites/:site/auth/exportendpoints. Clients can setformat=json, similarly toformat=zip, to get a JSON-encoded version of the requested CA public certs.My use case for this is pulling the Teleport Database Access client CA public cert into a k8s cluster via Kyverno. Kyverno only supports HTTP endpoints that return a properly-formatted JSON response.
This endpoint was originally added to make Teleport setup easier. The PR is intended to extend this.
changelog: Added JSON response support to the
/webapi/auth/exportpublic certificate API endpoint.