Skip to content

[TS-fetch - v2] Add support for bearer token authentication#12750

Open
johan-jnn wants to merge 2 commits into
swagger-api:masterfrom
johan-jnn:patch-#9493
Open

[TS-fetch - v2] Add support for bearer token authentication#12750
johan-jnn wants to merge 2 commits into
swagger-api:masterfrom
johan-jnn:patch-#9493

Conversation

@johan-jnn
Copy link
Copy Markdown

Based on #9493

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.

Description of the PR

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).

Notes

Maybe I should add some java tests to test this, but idk how to write java in such big project.
This means I ran the ./bin/typescript-fetch-petstore.sh (through run-in-docker.sh) but did not test if it actually works.

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.

1 participant