Class: JWT::Configuration::DecodeConfiguration
- Inherits:
-
Object
- Object
- JWT::Configuration::DecodeConfiguration
- Defined in:
- lib/jwt/configuration/decode_configuration.rb
Overview
The DecodeConfiguration class holds the configuration settings for decoding JWT tokens.
Instance Attribute Summary collapse
-
#algorithms ⇒ Array<String>
The list of acceptable algorithms.
-
#leeway ⇒ Integer
The leeway in seconds for time-based claims.
-
#required_claims ⇒ Array<String>
The list of required claims.
-
#verify_aud ⇒ Boolean
Whether to verify the audience claim.
-
#verify_expiration ⇒ Boolean
Whether to verify the expiration claim.
-
#verify_iat ⇒ Boolean
Whether to verify the issued at claim.
-
#verify_iss ⇒ Boolean
Whether to verify the issuer claim.
-
#verify_jti ⇒ Boolean
Whether to verify the JWT ID claim.
-
#verify_not_before ⇒ Boolean
Whether to verify the not before claim.
-
#verify_sub ⇒ Boolean
Whether to verify the subject claim.
Instance Method Summary collapse
-
#initialize ⇒ DecodeConfiguration
constructor
Initializes a new DecodeConfiguration instance with default settings.
- #to_h ⇒ Object private
Constructor Details
#initialize ⇒ DecodeConfiguration
Initializes a new DecodeConfiguration instance with default settings.
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 40 def initialize @verify_expiration = true @verify_not_before = true @verify_iss = false @verify_iat = false @verify_jti = false @verify_aud = false @verify_sub = false @leeway = 0 @algorithms = ['HS256'] @required_claims = [] end |
Instance Attribute Details
#algorithms ⇒ Array<String>
Returns the list of acceptable algorithms.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#leeway ⇒ Integer
Returns the leeway in seconds for time-based claims.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#required_claims ⇒ Array<String>
Returns the list of required claims.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#verify_aud ⇒ Boolean
Returns whether to verify the audience claim.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#verify_expiration ⇒ Boolean
Returns whether to verify the expiration claim.
28 29 30 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 def verify_expiration @verify_expiration end |
#verify_iat ⇒ Boolean
Returns whether to verify the issued at claim.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#verify_iss ⇒ Boolean
Returns whether to verify the issuer claim.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#verify_jti ⇒ Boolean
Returns whether to verify the JWT ID claim.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#verify_not_before ⇒ Boolean
Returns whether to verify the not before claim.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
#verify_sub ⇒ Boolean
Returns whether to verify the subject claim.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 28 attr_accessor :verify_expiration, :verify_not_before, :verify_iss, :verify_iat, :verify_jti, :verify_aud, :verify_sub, :leeway, :algorithms, :required_claims |
Instance Method Details
#to_h ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/jwt/configuration/decode_configuration.rb', line 54 def to_h { verify_expiration: verify_expiration, verify_not_before: verify_not_before, verify_iss: verify_iss, verify_iat: verify_iat, verify_jti: verify_jti, verify_aud: verify_aud, verify_sub: verify_sub, leeway: leeway, algorithms: algorithms, required_claims: required_claims } end |