atomic_lti_1v1 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/atomic_lti_1v1/lti_1v1.rb +3 -1
- data/lib/atomic_lti_1v1/lti_1v1_middleware.rb +7 -1
- data/lib/atomic_lti_1v1/version.rb +1 -1
- data/lib/atomic_lti_1v1.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 047ac4efd469c0eba37952597927eed31aa9945eabc4f28cbced8b007722abcc
|
4
|
+
data.tar.gz: 5a55084206a8eb496f7856ab877b88687ebd63f2394dc1bfea40922e83dc1e8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c8f4e05cd0ae77a356c9c51fce51b2c863d0583b852f3e21d7be854341a250918a3a81cd63a8cc7fec594c4b82fb397d49685e93641bfbb5fe0b5a351c82c6
|
7
|
+
data.tar.gz: fc09b37d88910afbd8e6941fed3e31997c9330731a5829de1c4054d493035dc525eb16482a43451bc9c7546042e41890fe0ecc7834688af703a4e9e28da4d25c
|
data/README.md
CHANGED
@@ -42,6 +42,8 @@ Provide `secret_provider`
|
|
42
42
|
# If using most Atomic Jolt Apps, probably something like this
|
43
43
|
ApplicationInstance.find_by(lti_key: oauth_consumer_key)&.lti_secret
|
44
44
|
end
|
45
|
+
# List of path prefixes to handle. Default is the following:
|
46
|
+
AtomicLti1v1.path_prefixes = ["/lti_launches"]
|
45
47
|
```
|
46
48
|
|
47
49
|
## License
|
@@ -1,7 +1,9 @@
|
|
1
1
|
module AtomicLti1v1
|
2
2
|
class Lti1v1
|
3
3
|
def self.is_lti_1v1?(request)
|
4
|
-
request.params['oauth_consumer_key'].present?
|
4
|
+
request.params['oauth_consumer_key'].present? &&
|
5
|
+
request.params['oauth_signature'].present? &&
|
6
|
+
request.params['lti_version'] == 'LTI-1p0'
|
5
7
|
end
|
6
8
|
|
7
9
|
def self.valid_timestamp?(request)
|
@@ -5,9 +5,15 @@ module AtomicLti1v1
|
|
5
5
|
@app = app
|
6
6
|
end
|
7
7
|
|
8
|
+
def matches_path_prefixes?(request)
|
9
|
+
AtomicLti1v1.path_prefixes.any? do |prefix|
|
10
|
+
request.path.starts_with? prefix
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
8
14
|
def call(env)
|
9
15
|
request = Rack::Request.new(env)
|
10
|
-
if AtomicLti1v1::Lti1v1.is_lti_1v1?(request)
|
16
|
+
if matches_path_prefixes?(request) && AtomicLti1v1::Lti1v1.is_lti_1v1?(request)
|
11
17
|
oauth_consumer_key = request.params['oauth_consumer_key']
|
12
18
|
|
13
19
|
lti_secret = nil
|
data/lib/atomic_lti_1v1.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atomic_lti_1v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Benoit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
94
|
+
rubygems_version: 3.4.15
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Rack middleware to handle validating Lti 1.1 requests
|