feat(oas/extensions): oauth configuration options #894
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.
🧰 Changes
Adds an OAS extension so folks can configure OAuth flows handling. These options are inspired by Swagger UI's configuration options: https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/
In my testing, I've found these ones are necessary for a v1 release of OAuth flows support, but I'm down to add more options further down the line.
Also, a super tiny type-fix with our
CODE_SAMPLES
extension.🧬 QA & Testing
Tests appear to pass, but I would love targeted feedback on the following million dollar question: do you feel good about the naming conventions and defaults? This will be impossible to change in the future so I'd love to make sure we develop a consensus first!
I opted to stick with the Swagger naming conventions (despite by own personal reservations), with a couple small exceptions:
useBasicAuthenticationWithAuthorizationCodeGrant
(known asuseBasicAuthenticationWithAccessCodeGrant
in Swagger UI) —accessCode
was a Swagger 2.0 convention and it'sauthorizationCode
in OpenAPI 3.x, hence the updateuseBasicAuthenticationWithAuthorizationCodeGrant
istrue
. This is because it's the more secure/recommended approach per the following RFCs12:Footnotes
First discovered through this: https://security.stackexchange.com/a/143560 ↩
I'm also cool with a name that ensures folks understand the risks, (e.g.,
useInsecureAuthorizationCodeGrantDefinition
with a default offalse
, etc.) ↩