Class: Warden::CookieSession::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cookie = 'cookie_session', secret = nil) ⇒ Configuration

Override defaults for configuration

Parameters:

  • cookie (String) (defaults to: 'cookie_session')

    cookie name to store encrypted data

  • secret (String) (defaults to: nil)

    secret key(shared between applications) to use in ActiveSupport::MessageEncryptor



12
13
14
15
16
# File 'lib/warden/cookie_session/configuration.rb', line 12

def initialize(cookie = 'cookie_session', secret = nil)
  @cookie = cookie
  @secret = secret
  @logger = Logger.new(STDOUT, level: Logger::INFO, progname: 'CookieSession')
end

Instance Attribute Details

Returns the value of attribute cookie.



7
8
9
# File 'lib/warden/cookie_session/configuration.rb', line 7

def cookie
  @cookie
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/warden/cookie_session/configuration.rb', line 7

def logger
  @logger
end

#secretObject

Returns the value of attribute secret.



7
8
9
# File 'lib/warden/cookie_session/configuration.rb', line 7

def secret
  @secret
end

#wrapperObject

Returns the value of attribute wrapper.



7
8
9
# File 'lib/warden/cookie_session/configuration.rb', line 7

def wrapper
  @wrapper
end

Instance Method Details

#fetch_record(key) ⇒ Object



22
23
24
# File 'lib/warden/cookie_session/configuration.rb', line 22

def fetch_record(key)
  @wrapper&.fetch_record(key)
end

#serialize_record(record) ⇒ Object



18
19
20
# File 'lib/warden/cookie_session/configuration.rb', line 18

def serialize_record(record)
  @wrapper&.serialize_record(record)
end

#validate_record(record, salt) ⇒ Object



26
27
28
# File 'lib/warden/cookie_session/configuration.rb', line 26

def validate_record(record, salt)
  @wrapper&.validate_record(record, salt)
end