Class: Dpop::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/dpop/configuration.rb

Overview

Configures the app’s module methods

Constant Summary collapse

"_proof_keys"
DEFAULT_ENCRYPTION_KEY =
ENV["DPOP_ENCRYPTION_KEY"] || ""
DEFAULT_GENERATED_KEY_SIZE =
1024
DEFAULT_KEY_ALG =
:rsa

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
# File 'lib/dpop/configuration.rb', line 13

def initialize
  self.cookie_name = DEFAULT_COOKIE_NAME
  self.encryption_key = DEFAULT_ENCRYPTION_KEY
  self.generated_key_size = DEFAULT_GENERATED_KEY_SIZE
  self.key_alg = DEFAULT_KEY_ALG
end

Instance Attribute Details

Returns the value of attribute cookie_name.



6
7
8
# File 'lib/dpop/configuration.rb', line 6

def cookie_name
  @cookie_name
end

#encryption_keyObject

Returns the value of attribute encryption_key.



6
7
8
# File 'lib/dpop/configuration.rb', line 6

def encryption_key
  @encryption_key
end

#generated_key_sizeObject

Returns the value of attribute generated_key_size.



6
7
8
# File 'lib/dpop/configuration.rb', line 6

def generated_key_size
  @generated_key_size
end

#key_algObject

Returns the value of attribute key_alg.



6
7
8
# File 'lib/dpop/configuration.rb', line 6

def key_alg
  @key_alg
end

Instance Method Details

#encryptorObject



20
21
22
# File 'lib/dpop/configuration.rb', line 20

def encryptor
  @encryptor ||= Dpop::Encryptor.new(encryption_key)
end