panda_pal 5.14.0.beta6 → 5.14.0.beta7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ae8f2b11166468665c19a613c284a75f71e405ba9c810e82e1c4499920b76e0
4
- data.tar.gz: 58bd014f1075394fc627cc4a118d1ab619ce89eb7857c1626171e69cc458e952
3
+ metadata.gz: 762a0d4a45e1c9e5c94e9a67303b9adfd7f437742d3b000b5216cda9f901ae0e
4
+ data.tar.gz: fc798c502cfc2218ef88f8286c05c9434e7e8b5a6835a2d643619b11e1ba8c21
5
5
  SHA512:
6
- metadata.gz: 2b2bc2227220be2668e04d7e6404cabb85c6f089b5f4bc33d8dfedd7af021c196a8c2baab452fd1b1d2c0bcdf5b4d0a4800df59e881c89817db5cbec2bf92f04
7
- data.tar.gz: 38ae3968ee8f2b620191a42a55e896b7e9f2371528479ccde18a866712a8c1cd45091cfeb71d5db2d5109ad4c579109fa615e73110ebfdbbea8913e55dd66845
6
+ metadata.gz: 3b2d5f5342348f0e99dfbb8382c00e396e5f1c82f8d22721b5e0f725b65d0c3877c27b17b6a74ef292619840a05ff284de0f37161290a2ce08199cb87a31d997
7
+ data.tar.gz: 1883e69179dc592d45b243e944934df02e298315fd7e5806b17a406da4557f9b9c7ffc5de7cb4559d7b687f97e09154fbd95de220a9f482fec37fd1b7def7fed
@@ -69,43 +69,41 @@ module PandaPal::Helpers
69
69
  def validate_v1p3_launch
70
70
  require "json/jwt"
71
71
 
72
- login_session = nil
72
+ Apartment::Tenant.switch!("public")
73
73
 
74
- switch_tenant("public") do
75
- decoded_jwt = JSON::JWT.decode(params.require(:id_token), :skip_verification)
76
- raise JSON::JWT::VerificationFailed, 'error decoding id_token' if decoded_jwt.blank?
74
+ decoded_jwt = JSON::JWT.decode(params.require(:id_token), :skip_verification)
75
+ raise JSON::JWT::VerificationFailed, 'error decoding id_token' if decoded_jwt.blank?
77
76
 
78
- client_id = decoded_jwt['aud']
79
- deployment_id = decoded_jwt['https://purl.imsglobal.org/spec/lti/claim/deployment_id']
77
+ client_id = decoded_jwt['aud']
78
+ deployment_id = decoded_jwt['https://purl.imsglobal.org/spec/lti/claim/deployment_id']
80
79
 
81
- if deployment_id.present?
82
- @organization ||= PandaPal::Organization.find_by(key: "#{client_id}/#{deployment_id}")
83
- @organization ||= PandaPal::Organization.find_by(key: deployment_id)
84
- end
80
+ if deployment_id.present?
81
+ @organization ||= PandaPal::Organization.find_by(key: "#{client_id}/#{deployment_id}")
82
+ @organization ||= PandaPal::Organization.find_by(key: deployment_id)
83
+ end
85
84
 
86
- @organization ||= PandaPal::Organization.find_by(key: client_id)
85
+ @organization ||= PandaPal::Organization.find_by(key: client_id)
87
86
 
88
- params[:session_key] = params[:state]
87
+ params[:session_key] = params[:state]
89
88
 
90
- raise JSON::JWT::VerificationFailed, 'Unrecognized Organization' unless @organization.present?
91
- raise JSON::JWT::VerificationFailed, 'Organization does not trust platform' unless @organization.trusted_platform?(current_lti_platform)
89
+ raise JSON::JWT::VerificationFailed, 'Unrecognized Organization' unless @organization.present?
90
+ raise JSON::JWT::VerificationFailed, 'Organization does not trust platform' unless @organization.trusted_platform?(current_lti_platform)
92
91
 
93
- begin
94
- decoded_jwt.verify!(current_lti_platform.public_jwks)
95
- rescue JSON::JWK::Set::KidNotFound
96
- decoded_jwt.verify!(current_lti_platform.public_jwks(force: true))
97
- end
92
+ begin
93
+ decoded_jwt.verify!(current_lti_platform.public_jwks)
94
+ rescue JSON::JWK::Set::KidNotFound
95
+ decoded_jwt.verify!(current_lti_platform.public_jwks(force: true))
96
+ end
98
97
 
99
- raise JSON::JWT::VerificationFailed, 'State is invalid' unless current_panda_session.panda_pal_organization_id == 0
100
- raise JSON::JWT::VerificationFailed, 'State is invalid' unless current_panda_session[:lti_oauth_nonce] == decoded_jwt['nonce']
98
+ raise JSON::JWT::VerificationFailed, 'State is invalid' unless current_panda_session.panda_pal_organization_id == 0
99
+ raise JSON::JWT::VerificationFailed, 'State is invalid' unless current_panda_session[:lti_oauth_nonce] == decoded_jwt['nonce']
101
100
 
102
- jwt_verifier = PandaPal::LtiJwtValidator.new(decoded_jwt, client_id)
103
- raise JSON::JWT::VerificationFailed, jwt_verifier.errors unless jwt_verifier.valid?
101
+ jwt_verifier = PandaPal::LtiJwtValidator.new(decoded_jwt, client_id)
102
+ raise JSON::JWT::VerificationFailed, jwt_verifier.errors unless jwt_verifier.valid?
104
103
 
105
- # Migrate the session to the correct tenant
106
- login_session = current_panda_session
107
- login_session.delete
108
- end
104
+ # Migrate the session to the correct tenant
105
+ login_session = current_panda_session
106
+ login_session.delete
109
107
 
110
108
  @organization.switch_tenant
111
109
 
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.14.0.beta6"
2
+ VERSION = "5.14.0.beta7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.14.0.beta6
4
+ version: 5.14.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev