panda_pal 5.20.0 → 5.20.1

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: 6d15dbaa7cf10eeaeb824f049fceeddf8d2e4301446f4a8085fa5a481372ddf4
4
- data.tar.gz: 99c2bdeaa1817cfd0dbd459179f0b2e8541e50eb4eaeb8b529b70207f52bdb6f
3
+ metadata.gz: 05adff1a6ac1e3c077fce392acaf5ac773b516f75ffa90d171ed8cb9c6c1b4b0
4
+ data.tar.gz: 243c14022da12a505d38f0be0a05c135412ab1eaba1a5478c3fec2d7ff967062
5
5
  SHA512:
6
- metadata.gz: 6cd16f9dd66703d6ed6323ffac0006ead1b1b4933d9cd692b7cc521275882cea4967d2e5d6d015f67b5a9ce6e307f7ae30d08f254614a1290d55bae4eb2653d3
7
- data.tar.gz: fa77efc2e756c3d039652c7891e74564b88b7e3f40b1ea84384ff18829374ceabc62c7c3428318181ca45b68a1f62f5bb21abe7eeb70bf00652e85b9e9ddb7bf
6
+ metadata.gz: 992ba7279928e36ae595362aaee43babe52f5b0cce6bbf75a9eb42c1f803588fd62221039714726aef283aec7becea7b69cbff1aba4dd3beaf7f6492d5291d67
7
+ data.tar.gz: 3e75a8857d2df28981c883922221d964edbfd324c7269034aa984a5eb5aaf9a97b2757e7a46740ae044086cbe312798b333cf5b5bd9645442d385ffe6cfc7e74
@@ -273,17 +273,23 @@ Apartment.configure do |config|
273
273
  end
274
274
 
275
275
  Rails.application.config.middleware.use Apartment::Elevators::Generic, lambda { |request|
276
+ params = lambda do
277
+ request.params
278
+ rescue EOFError, Rack::Utils::InvalidParameterError, Rack::Utils::ParameterTypeError, Rack::QueryParser::ParamsTooDeepError
279
+ {}
280
+ end
281
+
276
282
  tenant = if match = request.path.match(/\/(?:orgs?|organizations?)\/(\d+)/)
277
283
  PandaPal::Organization.find_by(id: match[1]).try(:tenant_name)
278
284
  elsif match = request.path.match(/\/(?:orgs?|organizations?|o)\/(\w+)/)
279
285
  PandaPal::Organization.find_by(name: match[1]).try(:tenant_name)
280
- elsif (panda_token = PandaPal::Session.extract_panda_token(request)).present?
286
+ elsif (panda_token = PandaPal::Session.extract_panda_token(request, params.call)).present?
281
287
  header, sig = panda_token.split('.')
282
288
  # This is just switching the tenant. Auth should be performed elsewhere (eg via `forbid_access_if_lacking_session`/`valid_session?`).
283
289
  decoded_header = JSON.parse(Base64.urlsafe_decode64(header))
284
290
  PandaPal::Organization.find_by(id: decoded_header['o']).try(:tenant_name)
285
291
  elsif request.path.start_with?('/rails/active_storage/blobs/')
286
- PandaPal::Organization.find_by(id: request.params['organization_id']).try(:tenant_name)
292
+ PandaPal::Organization.find_by(id: params.call['organization_id']).try(:tenant_name)
287
293
  end
288
294
  tenant || 'public'
289
295
  }
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = '5.20.0'
2
+ VERSION = '5.20.1'
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.20.0
4
+ version: 5.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev