class JWT::Configuration::DecodeConfiguration

The DecodeConfiguration class holds the configuration settings for decoding JWT tokens.

Attributes

algorithms[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
leeway[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
required_claims[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_aud[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_expiration[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_iat[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_iss[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_jti[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_not_before[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.
verify_sub[RW]

@!attribute [rw] verify_expiration

@return [Boolean] whether to verify the expiration claim.

@!attribute [rw] verify_not_before

@return [Boolean] whether to verify the not before claim.

@!attribute [rw] verify_iss

@return [Boolean] whether to verify the issuer claim.

@!attribute [rw] verify_iat

@return [Boolean] whether to verify the issued at claim.

@!attribute [rw] verify_jti

@return [Boolean] whether to verify the JWT ID claim.

@!attribute [rw] verify_aud

@return [Boolean] whether to verify the audience claim.

@!attribute [rw] verify_sub

@return [Boolean] whether to verify the subject claim.

@!attribute [rw] leeway

@return [Integer] the leeway in seconds for time-based claims.

@!attribute [rw] algorithms

@return [Array<String>] the list of acceptable algorithms.

@!attribute [rw] required_claims

@return [Array<String>] the list of required claims.

Public Class Methods

new() click to toggle source

Initializes a new DecodeConfiguration instance with default settings.

# 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

Public Instance Methods

to_h() click to toggle source

@api private

# 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