Skip to content

[TS-fetch - v3] Add support for bearer token authentication#1425

Open
johan-jnn wants to merge 1 commit into
swagger-api:masterfrom
johan-jnn:patch-#9493-v3
Open

[TS-fetch - v3] Add support for bearer token authentication#1425
johan-jnn wants to merge 1 commit into
swagger-api:masterfrom
johan-jnn:patch-#9493-v3

Conversation

@johan-jnn
Copy link
Copy Markdown

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

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

For the 2 unchecked points, see the notes section

How to Test

Using this authorization schema, then generate using the -l typescript-fetch flag, and see the Bearer authentification in the Authorization header being passed in the FetchParamCreator of the model.

Notes

Maybe I should add some java tests to test this, but idk how to write/test java in such big project.

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