Class: SoarAuthenticationToken::AuthorizationHeaderProvider
- Inherits:
-
Object
- Object
- SoarAuthenticationToken::AuthorizationHeaderProvider
- Defined in:
- lib/soar_authentication_token/providers/authorization_header_provider.rb
Instance Method Summary collapse
- #fetch(request) ⇒ Object
-
#initialize(configuration) ⇒ AuthorizationHeaderProvider
constructor
A new instance of AuthorizationHeaderProvider.
- #validate_configuration ⇒ Object
Constructor Details
#initialize(configuration) ⇒ AuthorizationHeaderProvider
Returns a new instance of AuthorizationHeaderProvider.
3 4 5 6 |
# File 'lib/soar_authentication_token/providers/authorization_header_provider.rb', line 3 def initialize(configuration) @configuration = configuration validate_configuration end |
Instance Method Details
#fetch(request) ⇒ Object
8 9 10 11 12 |
# File 'lib/soar_authentication_token/providers/authorization_header_provider.rb', line 8 def fetch(request) return false unless request.env[@configuration['header_name']] request.env[@configuration['header_name']] end |
#validate_configuration ⇒ Object
14 15 16 |
# File 'lib/soar_authentication_token/providers/authorization_header_provider.rb', line 14 def validate_configuration raise "'cookie_name' must be configured" unless @configuration['header_name'] end |