atomic_lti 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/lib/atomic_lti/lti.rb +26 -1
- data/app/lib/atomic_lti/services/line_items.rb +1 -1
- data/lib/atomic_lti/open_id_middleware.rb +2 -2
- data/lib/atomic_lti/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a219867c2a1f19737d0222b0896e30a28144310a6032f1f6419443af37006304
|
4
|
+
data.tar.gz: ee72503b3f1066f5e3a5ea710da6d818eb2680d79d60e805c828b8f34ef95917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49fd684fa99b65a02402d968b2c53741af0ca19594f0a9ab083cc6d9e3e3a2780caeba0f4de3b31db200dcb8fa745d9b1771b0eae1ef7c025ad68baff5e49fb6
|
7
|
+
data.tar.gz: 8670e8c13dec604b3af371ad7bff7fb7102be8aac32e32ae0e3ebca80718546e1cab5dfb559f18455bddcd2535032310e6be6b12ad568e9d74b4dc1c29ba25c6
|
data/app/lib/atomic_lti/lti.rb
CHANGED
@@ -16,6 +16,19 @@ module AtomicLti
|
|
16
16
|
errors.push("LTI token is missing required field sub")
|
17
17
|
end
|
18
18
|
|
19
|
+
if decoded_token["aud"].blank?
|
20
|
+
errors.push("LTI token is missing required field aud")
|
21
|
+
end
|
22
|
+
|
23
|
+
if decoded_token["aud"].is_a?(Array) && decoded_token["aud"].length > 1
|
24
|
+
# OpenID Connect spec specifies the AZP should exist and be an AUD
|
25
|
+
if decoded_token["azp"].blank?
|
26
|
+
errors.push("LTI token has multiple aud and is missing required field azp")
|
27
|
+
elsif decoded_token["aud"].exclude?(decoded_token["azp"])
|
28
|
+
errors.push("LTI token azp is not one of the aud's")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
19
32
|
if decoded_token[AtomicLti::Definitions::DEPLOYMENT_ID].blank?
|
20
33
|
errors.push(
|
21
34
|
"LTI token is missing required field #{AtomicLti::Definitions::DEPLOYMENT_ID}"
|
@@ -90,5 +103,17 @@ module AtomicLti
|
|
90
103
|
false
|
91
104
|
end
|
92
105
|
end
|
106
|
+
|
107
|
+
def self.client_id(decoded_token)
|
108
|
+
if decoded_token["aud"]&.is_a?(Array)
|
109
|
+
if decoded_token["aud"].length > 1
|
110
|
+
decoded_token["azp"]
|
111
|
+
else
|
112
|
+
decoded_token["aud"][0]
|
113
|
+
end
|
114
|
+
else
|
115
|
+
decoded_token["aud"]
|
116
|
+
end
|
117
|
+
end
|
93
118
|
end
|
94
|
-
end
|
119
|
+
end
|
@@ -27,7 +27,7 @@ module AtomicLti
|
|
27
27
|
tag: tag,
|
28
28
|
startDateTime: start_date_time,
|
29
29
|
endDateTime: end_date_time,
|
30
|
-
}
|
30
|
+
}.compact
|
31
31
|
attrs["resourceLinkId"] = resource_link_id if resource_link_id
|
32
32
|
if external_tool_url
|
33
33
|
attrs[AtomicLti::Definitions::CANVAS_SUBMISSION_TYPE] = {
|
@@ -159,7 +159,7 @@ module AtomicLti
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def update_install(id_token:)
|
162
|
-
client_id = id_token
|
162
|
+
client_id = AtomicLti::Lti.client_id(id_token)
|
163
163
|
iss = id_token["iss"]
|
164
164
|
|
165
165
|
if client_id.present? && iss.present?
|
@@ -202,7 +202,7 @@ module AtomicLti
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def update_deployment(id_token:)
|
205
|
-
client_id = id_token
|
205
|
+
client_id = AtomicLti::Lti.client_id(id_token)
|
206
206
|
iss = id_token["iss"]
|
207
207
|
deployment_id = id_token[AtomicLti::Definitions::DEPLOYMENT_ID]
|
208
208
|
platform_guid = id_token.dig(AtomicLti::Definitions::TOOL_PLATFORM_CLAIM, "guid")
|
data/lib/atomic_lti/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atomic_lti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Petro
|
@@ -10,36 +10,36 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-03-
|
13
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: pg
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: '1.3'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
28
|
+
version: '1.3'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
30
|
+
name: rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
35
|
+
version: '7.0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: '7.0'
|
43
43
|
description: AtomicLti implements the LTI Advantage specification. This gem does contain
|
44
44
|
source code specific to other Atomic Jolt products
|
45
45
|
email:
|