Sha256: 3a924187eeaea1835f40a8fab2d759ce5e0ece615d966c04d1afea2484e2ad7c

Contents?: true

Size: 794 Bytes

Versions: 2

Compression:

Stored size: 794 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:,flow_identifier: nil)
      @provider.validate(authentication_token: authentication_token,
                         flow_identifier:      flow_identifier)
    end

    private

    def instantiate_provider
      @provider = Object::const_get("SoarAuthenticationToken::#{@configuration['provider']}").new(@configuration)
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
soar_authentication_token-4.0.1 lib/soar_authentication_token/token_validator.rb
soar_authentication_token-4.0.0 lib/soar_authentication_token/token_validator.rb