Sha256: e1c50c2ca941c1ded0337d62261f681987e1421ea7488df7dcb8904e1940c2a8

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

require 'pansophy_authenticator/version'

module PansophyAuthenticator
  def self.configure
    configurator = Configuration::Configurator.new
    yield configurator if block_given?
    @configuration = configurator.configuration
  end

  def self.configuration
    @configuration ||= configure
  end

  def self.remote?
    configuration.remote?
  end

  def self.local?
    configuration.local?
  end

  def self.application
    configuration.application
  end

  def self.own_key
    ApplicationKeys.own
  end

  def self.authenticate!(application, key)
    ApplicationKeys.validate!(application, key)
  end

  def self.clear_cached_keys
    ApplicationKeys.clear_cache
  end

  %i(key valid?).each do |method|
    define_singleton_method(method) { |*args| ApplicationKeys.send(method, *args) }
  end

  Error = Class.new(StandardError)
end

require 'pansophy_authenticator/configuration'
require 'pansophy_authenticator/application_keys'
require 'pansophy_authenticator/matcher'
require 'pansophy_authenticator/local'
require 'pansophy_authenticator/remote'
require 'pansophy_authenticator/cache_stores/memory'
require 'pansophy_authenticator/cache'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pansophy_authenticator-0.4.3 lib/pansophy_authenticator.rb
pansophy_authenticator-0.4.2 lib/pansophy_authenticator.rb
pansophy_authenticator-0.4.1 lib/pansophy_authenticator.rb
pansophy_authenticator-0.4.0 lib/pansophy_authenticator.rb