class JWTEasy::Configuration
A configuration object used to define various options for encoding and decoding tokens.
-
This is usually not instantiated directly, but rather by way of calling
JWTEasy.configure
.
Attributes
algorithm[W]
expiration_time[RW]
leeway[RW]
not_before_time[RW]
secret[RW]
Public Instance Methods
algorithm()
click to toggle source
Gets the algorithm to use when encoding tokens
-
If no secret has been set, this returns 'none'
@return [String] the algorithm to be used
# File lib/jwt_easy/configuration.rb, line 21 def algorithm secret ? (@algorithm || ALGORITHM_HMAC_HS256) : 'none' end
claim()
click to toggle source
Infers the claim to observe during encoding or decoding.
@return [Symbol] short name for the identified claim
# File lib/jwt_easy/configuration.rb, line 28 def claim if expiration_time CLAIM_EXPIRATION_TIME elsif not_before_time CLAIM_NOT_BEFORE_TIME end end