Class: SimpleJwtAuth::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/simple_jwt_auth/configuration.rb', line 12

def initialize
  # Defaults to stdout and level info, can be configured
  @logger = ::Logger.new($stdout)
  @logger.level = ::Logger::INFO

  # https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4
  @exp_seconds = 30

  # Small leeway to account for clock skew (seconds)
  @exp_leeway = 10

  # HMAC SHA-256 hash algorithm
  @algorithm = 'HS256'

  # A map of issuers and corresponding secrets
  @secrets_config = {}
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



5
6
7
# File 'lib/simple_jwt_auth/configuration.rb', line 5

def algorithm
  @algorithm
end

#exp_leewayObject

Returns the value of attribute exp_leeway.



5
6
7
# File 'lib/simple_jwt_auth/configuration.rb', line 5

def exp_leeway
  @exp_leeway
end

#exp_secondsObject

Returns the value of attribute exp_seconds.



5
6
7
# File 'lib/simple_jwt_auth/configuration.rb', line 5

def exp_seconds
  @exp_seconds
end

#issuerObject

Returns the value of attribute issuer.



5
6
7
# File 'lib/simple_jwt_auth/configuration.rb', line 5

def issuer
  @issuer
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/simple_jwt_auth/configuration.rb', line 5

def logger
  @logger
end

#secrets_configObject

Returns the value of attribute secrets_config.



5
6
7
# File 'lib/simple_jwt_auth/configuration.rb', line 5

def secrets_config
  @secrets_config
end