[TS-fetch - v3] Add support for bearer token authentication#1425
Open
johan-jnn wants to merge 1 commit into
Open
[TS-fetch - v3] Add support for bearer token authentication#1425johan-jnn wants to merge 1 commit into
johan-jnn wants to merge 1 commit into
Conversation
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.
Based on swagger-api/swagger-codegen#9493
Pull Request
Note :
This PR has the exact same purpose than this one, but for the v3 version of swagger-codegen.
Description
Based on how PHP template deals with Bearer auth, I did the same in the typescript-fetch mustache template.
The token should be passed to the accessToken configuration key (as in the php code). If a function is given, we call it without the scope argument (as authorized in the definition of accessToken).
Type of Change
Checklist
For the 2 unchecked points, see the notes section
How to Test
Using this authorization schema, then generate using the
-l typescript-fetchflag, and see theBearerauthentification in theAuthorizationheader being passed in theFetchParamCreatorof the model.Notes
Maybe I should add some java tests to test this, but idk how to write/test java in such big project.