Class: AppleAuth::JWTConditions
- Inherits:
-
Object
- Object
- AppleAuth::JWTConditions
- Includes:
- Conditions
- Defined in:
- lib/apple_auth/helpers/jwt_conditions.rb
Constant Summary collapse
- CONDITIONS =
[ AudCondition, ExpCondition, IatCondition, IssCondition ].freeze
Instance Attribute Summary collapse
-
#decoded_jwt ⇒ Object
readonly
Returns the value of attribute decoded_jwt.
-
#user_identity ⇒ Object
readonly
Returns the value of attribute user_identity.
Instance Method Summary collapse
-
#initialize(user_identity, decoded_jwt) ⇒ JWTConditions
constructor
A new instance of JWTConditions.
- #validate! ⇒ Object
Constructor Details
#initialize(user_identity, decoded_jwt) ⇒ JWTConditions
Returns a new instance of JWTConditions.
16 17 18 19 |
# File 'lib/apple_auth/helpers/jwt_conditions.rb', line 16 def initialize(user_identity, decoded_jwt) @user_identity = user_identity @decoded_jwt = decoded_jwt end |
Instance Attribute Details
#decoded_jwt ⇒ Object (readonly)
Returns the value of attribute decoded_jwt.
14 15 16 |
# File 'lib/apple_auth/helpers/jwt_conditions.rb', line 14 def decoded_jwt @decoded_jwt end |
#user_identity ⇒ Object (readonly)
Returns the value of attribute user_identity.
14 15 16 |
# File 'lib/apple_auth/helpers/jwt_conditions.rb', line 14 def user_identity @user_identity end |
Instance Method Details
#validate! ⇒ Object
21 22 23 24 25 |
# File 'lib/apple_auth/helpers/jwt_conditions.rb', line 21 def validate! JWT::ClaimsValidator.new(decoded_jwt).validate! && validate_sub! && jwt_conditions_validate! rescue JWT::InvalidPayload => e raise JWTValidationError, e. end |