Class: PandaPal::LtiJwtValidator
- Inherits:
-
Object
- Object
- PandaPal::LtiJwtValidator
- Defined in:
- app/lib/panda_pal/lti_jwt_validator.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(jwt, client_id) ⇒ LtiJwtValidator
constructor
A new instance of LtiJwtValidator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(jwt, client_id) ⇒ LtiJwtValidator
Returns a new instance of LtiJwtValidator.
5 6 7 8 9 |
# File 'app/lib/panda_pal/lti_jwt_validator.rb', line 5 def initialize(jwt, client_id) @jwt = jwt @client_id = client_id @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'app/lib/panda_pal/lti_jwt_validator.rb', line 3 def errors @errors end |
Instance Method Details
#valid? ⇒ Boolean
11 12 13 14 15 16 17 18 |
# File 'app/lib/panda_pal/lti_jwt_validator.rb', line 11 def valid? verify_audience(@jwt) verify_sub(@jwt) verify_nonce(@jwt) verify_issued_at(@jwt) verify_expiration(@jwt) errors.empty? end |