Sha256: 01827064c784b4e54de0e60af45b03d9ca694b663ef65edbd330eab5bd187e6b

Contents?: true

Size: 858 Bytes

Versions: 15

Compression:

Stored size: 858 Bytes

Contents

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

    def inject_store_provider(store_provider)
      @provider.inject_store_provider(store_provider)
    end

    def validate(authentication_token:, request_information: {}, flow_identifier: nil)
      @provider.validate(authentication_token: authentication_token,
                         request_information:  request_information,
                         flow_identifier:      flow_identifier)
    end

    private

    def instantiate_provider
      @provider = Object::const_get(@configuration['provider']).new(@configuration)
    end

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
soar_authentication_token-7.1.1 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-7.1.0 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-7.0.1 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-7.0.0 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.1.1 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.1.0 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.9 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.8 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.7 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.5 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.4 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.3 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.2 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.1 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-6.0.0 lib/soar_authentication_token/token_validator.rb