Class: RubstApi::Security::OAuth2PasswordBearer
- Inherits:
-
HTTPBearer
- Object
- Base
- HTTPBearer
- RubstApi::Security::OAuth2PasswordBearer
- Defined in:
- lib/rubst_api/security.rb
Instance Attribute Summary collapse
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
-
#token_url ⇒ Object
readonly
Returns the value of attribute token_url.
Attributes inherited from Base
#auto_error, #description, #scheme_name
Instance Method Summary collapse
- #call(request:) ⇒ Object
-
#initialize(token_url:, scopes: {}, **options) ⇒ OAuth2PasswordBearer
constructor
A new instance of OAuth2PasswordBearer.
- #openapi_scheme ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(token_url:, scopes: {}, **options) ⇒ OAuth2PasswordBearer
Returns a new instance of OAuth2PasswordBearer.
75 76 77 78 |
# File 'lib/rubst_api/security.rb', line 75 def initialize(token_url:, scopes: {}, **) @token_url, @scopes = token_url, scopes super(**) end |
Instance Attribute Details
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
74 75 76 |
# File 'lib/rubst_api/security.rb', line 74 def scopes @scopes end |
#token_url ⇒ Object (readonly)
Returns the value of attribute token_url.
74 75 76 |
# File 'lib/rubst_api/security.rb', line 74 def token_url @token_url end |
Instance Method Details
#call(request:) ⇒ Object
79 |
# File 'lib/rubst_api/security.rb', line 79 def call(request:) = super.credentials |
#openapi_scheme ⇒ Object
80 81 82 |
# File 'lib/rubst_api/security.rb', line 80 def openapi_scheme { type: "oauth2", flows: { password: { tokenUrl: token_url, scopes: scopes } }, description: description }.compact end |