Class: Aws::Plugins::BearerAuthorization::Handler Private
- Inherits:
-
Seahorse::Client::Handler
- Object
- Seahorse::Client::Handler
- Aws::Plugins::BearerAuthorization::Handler
- Defined in:
- lib/aws-sdk-core/plugins/bearer_authorization.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Handler
Instance Method Summary collapse
- #call(context) ⇒ Object private
Methods inherited from Seahorse::Client::Handler
Constructor Details
This class inherits a constructor from Seahorse::Client::Handler
Instance Method Details
#call(context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/aws-sdk-core/plugins/bearer_authorization.rb', line 53 def call(context) if context.http_request.endpoint.scheme != 'https' raise ArgumentError, 'Unable to use bearer authorization on non https endpoint.' end token_provider = context.config.token_provider if token_provider && token_provider.set? context.http_request.headers['Authorization'] = "Bearer #{token_provider.token.token}" else raise Errors::MissingBearerTokenError end @handler.call(context) end |