Sha256: d9c3efc133d42f8503d3e445191ada3b25189a6b161da3ef0342a3e7a4874574

Contents?: true

Size: 460 Bytes

Versions: 4

Compression:

Stored size: 460 Bytes

Contents

module SoarAuthenticationToken
  class AuthorizationHeaderProvider
    def initialize(configuration)
      @configuration = configuration
      validate_configuration
    end

    def fetch(request)
      return false unless request.env[@configuration['header_name']]

      request.env[@configuration['header_name']]
    end

    def validate_configuration
      raise "'cookie_name' must be configured" unless @configuration['header_name']
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
soar_authentication_token-7.1.1 lib/soar_authentication_token/providers/authorization_header_provider.rb
soar_authentication_token-7.1.0 lib/soar_authentication_token/providers/authorization_header_provider.rb
soar_authentication_token-7.0.1 lib/soar_authentication_token/providers/authorization_header_provider.rb
soar_authentication_token-7.0.0 lib/soar_authentication_token/providers/authorization_header_provider.rb