Class: AppleAuth::JWTServerConditions

Inherits:
Object
  • Object
show all
Includes:
Conditions
Defined in:
lib/apple_auth/helpers/jwt_server_conditions.rb

Constant Summary collapse

CONDITIONS =
[
  AudCondition,
  IatCondition,
  IssCondition
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(decoded_jwt) ⇒ JWTServerConditions

Returns a new instance of JWTServerConditions.



15
16
17
# File 'lib/apple_auth/helpers/jwt_server_conditions.rb', line 15

def initialize(decoded_jwt)
  @decoded_jwt = decoded_jwt
end

Instance Attribute Details

#decoded_jwtObject (readonly)

Returns the value of attribute decoded_jwt.



13
14
15
# File 'lib/apple_auth/helpers/jwt_server_conditions.rb', line 13

def decoded_jwt
  @decoded_jwt
end

Instance Method Details

#validate!Object



19
20
21
22
23
# File 'lib/apple_auth/helpers/jwt_server_conditions.rb', line 19

def validate!
  JWT::ClaimsValidator.new(decoded_jwt).validate! && jwt_conditions_validate!
rescue JWT::InvalidPayload => e
  raise JWTValidationError, e.message
end