panda_pal 5.20.1 → 5.20.3
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 +4 -4
- data/app/lib/panda_pal/launch_url_helpers.rb +11 -2
- data/app/lib/panda_pal/lti_jwt_validator.rb +4 -1
- data/lib/panda_pal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 856e3c75294498bb132d92840566ad432b3a9568fad2a4e4dc538bc949d1261a
|
|
4
|
+
data.tar.gz: bbcdca89a825d4a1c99017e9aab457554ad07a07831befbc1c620a6994b3f6d2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e358543adf915a9a888b9bbbc659521fa6aa723e2204f3dc09a0af16127f39b8777266792c3d7083088209c9b9fe6f58f77190c2942e2462b636532e4108a3b9
|
|
7
|
+
data.tar.gz: 4e0ae017b73b0427e49b7b74edf8bd24e196d031e13deebc5f177a0f339c58f7b9ed9971b3dc6db53987b203f41026ea201df4f0946c06528b63f124ae1567fb
|
|
@@ -111,8 +111,17 @@ module PandaPal
|
|
|
111
111
|
key_bits.prepend(engine) if key_bits.count == 1
|
|
112
112
|
key_bits[0] = key_bits[0].classify
|
|
113
113
|
|
|
114
|
-
engine = key_bits[0] == 'MainApp' ? Rails.application : (key_bits[0]
|
|
115
|
-
engine.routes.url_helpers.
|
|
114
|
+
engine = key_bits[0] == 'MainApp' ? Rails.application : find_engine(key_bits[0])
|
|
115
|
+
engine.routes.url_helpers.public_send(key_bits[1], *arguments, **kwargs)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Resolve "<Namespace>" to its loaded "<Namespace>::Engine" without constantize-ing an
|
|
119
|
+
# arbitrary string - only an already-loaded Rails::Engine subclass can be selected.
|
|
120
|
+
def self.find_engine(namespace)
|
|
121
|
+
engine_name = "#{namespace}::Engine"
|
|
122
|
+
engine = ::Rails::Engine.subclasses.find { |e| e.name == engine_name }
|
|
123
|
+
raise ArgumentError, "Unknown engine '#{namespace}'" unless engine
|
|
124
|
+
engine
|
|
116
125
|
end
|
|
117
126
|
|
|
118
127
|
def self.deep_link_redirect_url(request, tool: PandaPal::DEFAULT_TOOL)
|
|
@@ -60,7 +60,10 @@ module PandaPal
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
now = Time.zone.now.to_i
|
|
63
|
-
|
|
63
|
+
ttl = jwt[:exp].to_i - now
|
|
64
|
+
return unless ttl.positive?
|
|
65
|
+
|
|
66
|
+
nonce_used = Rails.cache.fetch("panda_pal/launch_nonces/#{jwt[:nonce]}", expires_in: ttl) do
|
|
64
67
|
now
|
|
65
68
|
end
|
|
66
69
|
|
data/lib/panda_pal/version.rb
CHANGED