Module: Dpop

Defined in:
lib/dpop.rb,
lib/dpop/railtie.rb,
lib/dpop/version.rb,
lib/dpop/encryptor.rb,
lib/dpop/controller.rb,
lib/dpop/cookie_jar.rb,
lib/dpop/configuration.rb,
lib/dpop/key_generator.rb,
lib/dpop/proof_generator.rb

Overview

DPoP top level methods

Defined Under Namespace

Modules: Controller, KeyGenerator Classes: Configuration, CookieJar, Encryptor, Error, ProofGenerator, Railtie

Constant Summary collapse

VERSION =
"0.1.3"

Class Method Summary collapse

Class Method Details

.configurationObject Also known as: config

Returns the client’s Configuration object, or creates one if not yet created.



31
32
33
# File 'lib/dpop.rb', line 31

def configuration
  @configuration ||= Dpop::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Configure Dpop application-wide settings.

Yields a configuration object that can be used to override default settings.

Yields:



26
27
28
# File 'lib/dpop.rb', line 26

def configure
  yield(configuration) if block_given?
end

.generate_key_pair(alg = :rsa) ⇒ Object



42
43
44
# File 'lib/dpop.rb', line 42

def generate_key_pair(alg = :rsa)
  Dpop::KeyGenerator.generate(alg)
end

.get_proof_with_key(dpop_key, **args) ⇒ Object



37
38
39
40
# File 'lib/dpop.rb', line 37

def get_proof_with_key(dpop_key, **args)
  generator = Dpop::ProofGenerator.new(dpop_key, "RS256")
  generator.create_dpop_proof(**args)
end

.load_integrationObject



46
47
48
# File 'lib/dpop.rb', line 46

def load_integration
  require "dpop/railtie" if defined?(Rails::Railtie)
end