panda_pal 5.12.4 → 5.12.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8157be2e37c1de2f7deb7f53b16b36cdbe4df73a5b5a1f2f7adb7355574b6235
4
- data.tar.gz: 5f337073007f5d9976c4bef8809fb7dbecabdbb462cc5bb12654e73d58ed30f8
3
+ metadata.gz: 11384f7b7e5a2e3421c2e467f780d30bc6ba5cefd37eb9ca6cbed4c9b0fecd77
4
+ data.tar.gz: ff120eb68167ac47123cf13803c652bfed0e58dffe6914f1637f4d28ba5567c1
5
5
  SHA512:
6
- metadata.gz: baf430d94c85a7cf78afb5fb1a23bb9518f4170e848b2e02027e276bb07d34a7621e7609d9fc903113e123a6c80e1f40ef5222331326eeb4cc59ed02e51efc01
7
- data.tar.gz: 800ee80531331226a487ec86b2b2aa01a77a44f69ee3b34999bae0e21b58f94a56f7727ed29c24e5994b959125ac2e1fd31c554d5fe50a89d77f309d746cb59d
6
+ metadata.gz: 3e62cb29c2b532f19bd23468cc8c9a3a84706f55758e7c73a674ea3efb970147f32989761bcbbfa23d337beae895c070ba99a1de747c952bff20bbce35b69b4b
7
+ data.tar.gz: d5472fdca2d586b14aebf5aedb575407a5711cddc5c2d6d340f7a4e4cfe7a1fa001adf5d95d8775d3ec0572ddf12318e4aa2ffc31871107397cbc08308127e02
@@ -145,7 +145,7 @@ module PandaPal
145
145
 
146
146
  org_canvas_url = current_organization.canvas_url
147
147
 
148
- if (canvas_env == 'beta' || canvas_env == 'test') && org_canvas_url.present && !org_canvas_url.include?(".#{canvas_env}.")
148
+ if (canvas_env == 'beta' || canvas_env == 'test') && org_canvas_url.present? && !org_canvas_url.include?(".#{canvas_env}.")
149
149
  render plain: "This tool is not properly configured for use in #{canvas_env}", status: 400
150
150
  end
151
151
  end
@@ -5,10 +5,10 @@ module PandaPal
5
5
  class Platform
6
6
  require_relative "platform/canvas"
7
7
 
8
- def public_jwks
8
+ def public_jwks(force: false)
9
9
  require "json/jwt"
10
10
 
11
- jwk_json = Rails.cache.fetch("panda_pal/jwks/#{jwks_url}")
11
+ jwk_json = Rails.cache.fetch("panda_pal/jwks/#{jwks_url}").presence unless force
12
12
  jwk_json ||= begin
13
13
  response = HTTParty.get(jwks_url)
14
14
  response.success? ? response.body : nil
@@ -75,7 +75,11 @@ module PandaPal::Helpers
75
75
  raise JSON::JWT::VerificationFailed, 'Unrecognized Organization' unless @organization.present?
76
76
  raise JSON::JWT::VerificationFailed, 'Organization does not trust platform' unless @organization.trusted_platform?(current_lti_platform)
77
77
 
78
- decoded_jwt.verify!(current_lti_platform.public_jwks)
78
+ begin
79
+ decoded_jwt.verify!(current_lti_platform.public_jwks)
80
+ rescue JSON::JWK::Set::KidNotFound
81
+ decoded_jwt.verify!(current_lti_platform.public_jwks(force: true))
82
+ end
79
83
 
80
84
  raise JSON::JWT::VerificationFailed, 'State is invalid' unless current_session_data[:lti_oauth_nonce] == decoded_jwt['nonce']
81
85
 
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.12.4"
2
+ VERSION = "5.12.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.12.4
4
+ version: 5.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2025-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails