[feat][elixir] support bearer authentication#21110
[feat][elixir] support bearer authentication#21110wing328 merged 1 commit intoOpenAPITools:masterfrom
Conversation
| - `password`: A password for basic authentication. | ||
| {{/hasHttpBasicMethods}} | ||
| {{#hasHttpBearerMethods}} | ||
| - `bearer_token`: A bearer token for bearer authentication. |
There was a problem hiding this comment.
I considered using token, but I noticed is already used by the OAuth2 implementation.
ca82c50 to
8c9e7f8
Compare
|
When working on this, I noticed that the Connection module is configured to implement the def new(token) when is_binary(token) or is_function(token, 1) or is_tuple(token) do
new(token: token)
end def new(token, scopes, options)
when (is_binary(token) or is_function(token, 1) or is_tuple(token)) and is_list(scopes) do
options
|> Keyword.merge(token: token, token_scopes: scopes)
|> new()
end def new(username, password, options) when is_binary(username) and is_binary(password) do
options
|> Keyword.merge(username: username, password: password)
|> new()
endWhat's the rationale behind these? Users can instantiate the client using Connection.new(token: token, token_scopes: scopes)Thus, the |
i suggest creating a separate issue to track it as it's not something we need to address in this pr |
|
thanks for the pr. let's give it a try |
Description
This
PRadds support for Bearer Authentication to the Elixir generator.Bearer Authentication is implemented using Tesla's BearerAuth middleware.
@mrmstn, @wing328 - Curious to hear your thoughts on this one too! 🙂
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)