Repository navigation
fix(api playground): rm duplicate authorization header - #288
Merged
Merged
Conversation
Contributor
|
Disclaimer: This comment was AI-generated and is not necessarily completely accurate. Please take code comments with a grain of salt.
[Low impact] This PR appears safe to merge; no actionable issues were found. SummaryRemoves duplicate authorization fields from the API playground and labels the user-token check with the correct credential type.
Checklist: No areas needing improvement found in the changed code. Tests and lint were not run during this review. Score: 100/100. Reviews (1) · Last reviewed commit: "fix(api playground): rm duplicate author..." · Reviewed by Greptile |
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.
clank context (clickme)
What was wrong
POST /auth/api_key/jwtandGET /auth/test-authdocumentedAuthorizationtwice indocs/openapi.json: once through theAPI_Keybearer security scheme, and again as a plain required header parameter (an explicit@ApiHeaderon both, and onapi_key/jwtalso the swagger plugin's param inferred from@Headers('Authorization')). In the Mintlify playground the plain header wins. It sends whatever is typed with noBearerprefix, so Try it returns401 API Key is requiredunless the reader typesBearerthemselves.test-authalso took a user JWT but was labeled with theAPI_Keyscheme.Fix
@ApiHeader({ name: 'Authorization' })decorators.getApiKeyJWTreads@Headers()and usesheaders.authorization(same parsing), so the plugin stops adding the header param.JWTbearer scheme inopenapi.tsand use it ontest-auth.docs/openapi.jsonisn't in the diff because the openapi workflow regenerates it on push to main.Test plan
api-gatewaydev image on a tesser box and ranpnpm gen:openapiin it. Both operations now list no parameters. Security is[{API_Key: []}]onapi_key/jwtand[{JWT: []}]ontest-auth, andcomponents.securitySchemeshasAPI_KeyandJWT.nx run api-gateway:tscand eslint on both files pass in that image. Prettier check passes.split(' ')[1].api_key/jwtreturned 201.