atomic_tenant 1.5.0 → 1.5.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b96d3efc1008755065959ca9dbceff1b93296f11ea0289664119e3875d60a64d
|
|
4
|
+
data.tar.gz: 2c728035c438789a0c79bdde191392e1c7c6ae47464009a7533aaa963a11826b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98ff0964945704bd35f93cb5a825df117b3722de817c57957c2668c54ded2e766cb715221b62180a1530eb46e1b23938a9b78093430396c5c16d729f54b6a9a3
|
|
7
|
+
data.tar.gz: 229e7facd2f8e460e2ccdbcc534274da1d6814871b4b6c402fc2ae89273fdb17db87c8b44f56ebc52446b3528925ddac1bcacf16fcaab4a0642e1c24b6aebfd2
|
|
@@ -1,72 +1,69 @@
|
|
|
1
1
|
module AtomicTenant
|
|
2
2
|
|
|
3
3
|
module DeploymentManager
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
attr_accessor :details
|
|
7
|
-
|
|
8
|
-
def initialize(application_instance_id: nil, details: nil)
|
|
9
|
-
@application_instance_id = application_instance_id
|
|
10
|
-
@details = details
|
|
11
|
-
end
|
|
4
|
+
class DeploymentStrategyResult
|
|
5
|
+
attr_accessor :application_instance_id, :details
|
|
12
6
|
|
|
7
|
+
def initialize(application_instance_id: nil, details: nil)
|
|
8
|
+
@application_instance_id = application_instance_id
|
|
9
|
+
@details = details
|
|
13
10
|
end
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
def name; end
|
|
17
|
-
def call(decoded_id_token:); end
|
|
18
|
-
end
|
|
19
|
-
|
|
12
|
+
end
|
|
20
13
|
|
|
14
|
+
class DeploymentManagerStrategy
|
|
15
|
+
def name; end
|
|
16
|
+
def call(decoded_id_token:); end
|
|
17
|
+
end
|
|
21
18
|
|
|
22
19
|
# Associate deployment
|
|
23
20
|
class DeploymentManager
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def link_deployment_id(decoded_id_token:)
|
|
30
|
-
deployment_id = decoded_id_token[AtomicLti::Definitions::DEPLOYMENT_ID]
|
|
31
|
-
iss = decoded_id_token["iss"]
|
|
32
|
-
|
|
33
|
-
results = @strageties.flat_map do |strategy|
|
|
34
|
-
begin
|
|
35
|
-
[{name: strategy.name, result: strategy.call(decoded_id_token: decoded_id_token)}]
|
|
36
|
-
rescue StandardError => e
|
|
37
|
-
Rails.logger.error("Error in lti deployment linking strategy: #{strategy.name}, #{e}")
|
|
38
|
-
[]
|
|
39
|
-
end
|
|
40
|
-
end
|
|
22
|
+
def initialize(strageties)
|
|
23
|
+
@strageties = strageties || []
|
|
24
|
+
end
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
def link_deployment_id(decoded_id_token:)
|
|
27
|
+
deployment_id = decoded_id_token[AtomicLti::Definitions::DEPLOYMENT_ID]
|
|
28
|
+
iss = decoded_id_token["iss"]
|
|
43
29
|
|
|
44
|
-
|
|
30
|
+
to_link = nil
|
|
31
|
+
strategy_name = nil
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
@strageties.each do |strategy|
|
|
34
|
+
result = strategy.call(decoded_id_token: decoded_id_token)
|
|
35
|
+
if result.application_instance_id.present?
|
|
36
|
+
to_link = result
|
|
37
|
+
strategy_name = strategy.name
|
|
38
|
+
break
|
|
39
|
+
end
|
|
40
|
+
rescue StandardError => e
|
|
41
|
+
Rails.logger.error("Error in lti deployment linking strategy: #{strategy.name}, #{e}")
|
|
42
|
+
end
|
|
51
43
|
|
|
52
|
-
|
|
53
|
-
raise AtomicTenant::Exceptions::UnableToLinkDeploymentError
|
|
54
|
-
end
|
|
44
|
+
raise AtomicTenant::Exceptions::UnableToLinkDeploymentError if to_link.nil?
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
Rails.logger.info(
|
|
47
|
+
"Linking iss / deployment id: #{iss} / #{deployment_id} to application instance: " \
|
|
48
|
+
"#{to_link.application_instance_id} using strategy: #{strategy_name}"
|
|
49
|
+
)
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
associate_deployment(
|
|
52
|
+
iss: iss,
|
|
53
|
+
deployment_id: deployment_id,
|
|
54
|
+
application_instance_id: to_link.application_instance_id
|
|
55
|
+
)
|
|
56
|
+
end
|
|
60
57
|
|
|
61
|
-
|
|
58
|
+
private
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
def associate_deployment(iss:, deployment_id:, application_instance_id:)
|
|
61
|
+
AtomicTenant::LtiDeployment.create!(
|
|
62
|
+
iss: iss,
|
|
63
|
+
deployment_id: deployment_id,
|
|
64
|
+
application_instance_id: application_instance_id
|
|
65
|
+
)
|
|
66
|
+
end
|
|
70
67
|
end
|
|
71
68
|
end
|
|
72
69
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: atomic_tenant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Benoit
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: atomic_lti
|
|
@@ -56,14 +56,14 @@ dependencies:
|
|
|
56
56
|
requirements:
|
|
57
57
|
- - "~>"
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: '
|
|
59
|
+
version: '3.0'
|
|
60
60
|
type: :development
|
|
61
61
|
prerelease: false
|
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
|
63
63
|
requirements:
|
|
64
64
|
- - "~>"
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '
|
|
66
|
+
version: '3.0'
|
|
67
67
|
description: Description of AtomicTenant.
|
|
68
68
|
email:
|
|
69
69
|
- nick.benoit@atomicjolt.com
|
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
119
119
|
- !ruby/object:Gem::Version
|
|
120
120
|
version: '0'
|
|
121
121
|
requirements: []
|
|
122
|
-
rubygems_version: 3.5.
|
|
122
|
+
rubygems_version: 3.5.16
|
|
123
123
|
signing_key:
|
|
124
124
|
specification_version: 4
|
|
125
125
|
summary: Summary of AtomicTenant.
|