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: 1040533dd529e7e1f40ddeb45dd404ded2fa9fa493ecf0befc9580b118698c89
4
- data.tar.gz: c614b1b32f09c29987d88a77929b9e0f90dc8f9fc9fc1b29f6cb8aaa6097a932
3
+ metadata.gz: b96d3efc1008755065959ca9dbceff1b93296f11ea0289664119e3875d60a64d
4
+ data.tar.gz: 2c728035c438789a0c79bdde191392e1c7c6ae47464009a7533aaa963a11826b
5
5
  SHA512:
6
- metadata.gz: 2d7de5baefd5dd1a04ccc52323db67706ec7548b1aad81a0695e968adad9139f0419d68247000584d9c1339d7bb98de56ed6aa5ad721df51dfb0addab373b40b
7
- data.tar.gz: 3ef28df192ac02f32d0b72dfd441d91864b036ea11014317a14d927de545eb20664788509460b4775c5158c293eba154175997938a116bc54b89368c1ed16a2e
6
+ metadata.gz: 98ff0964945704bd35f93cb5a825df117b3722de817c57957c2668c54ded2e766cb715221b62180a1530eb46e1b23938a9b78093430396c5c16d729f54b6a9a3
7
+ data.tar.gz: 229e7facd2f8e460e2ccdbcc534274da1d6814871b4b6c402fc2ae89273fdb17db87c8b44f56ebc52446b3528925ddac1bcacf16fcaab4a0642e1c24b6aebfd2
@@ -1,72 +1,69 @@
1
1
  module AtomicTenant
2
2
 
3
3
  module DeploymentManager
4
- class DeploymentStrategyResult
5
- attr_accessor :application_instance_id
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
- class DeploymentManagerStrategy
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
- def initialize(strageties)
26
- @strageties = strageties || []
27
- end
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
- Rails.logger.debug("Linking Results: #{results}")
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
- matched = results.filter { |r| r[:result].application_instance_id.present? }
30
+ to_link = nil
31
+ strategy_name = nil
45
32
 
46
- to_link = if matched.size == 1
47
- matched.first[:result]
48
- elsif matched.size > 1
49
- matched.first[:result]
50
- Rails.logger.info("Colliding strategies, Linking iss / deployment id: #{iss} / #{deployment_id} to application instance: #{to_link.application_instance_id}, all results: #{results}")
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
- else
53
- raise AtomicTenant::Exceptions::UnableToLinkDeploymentError
54
- end
44
+ raise AtomicTenant::Exceptions::UnableToLinkDeploymentError if to_link.nil?
55
45
 
56
- Rails.logger.info("Linking iss / deployment id: #{iss} / #{deployment_id} to application instance: #{to_link.application_instance_id}")
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
- associate_deployment(iss: iss, deployment_id: deployment_id,application_instance_id: to_link.application_instance_id)
59
- end
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
- private
58
+ private
62
59
 
63
- def associate_deployment(iss:, deployment_id:, application_instance_id:)
64
- AtomicTenant::LtiDeployment.create!(
65
- iss: iss,
66
- deployment_id: deployment_id,
67
- application_instance_id: application_instance_id
68
- )
69
- end
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
@@ -1,3 +1,3 @@
1
1
  module AtomicTenant
2
- VERSION = '1.5.0'
2
+ VERSION = "1.5.1".freeze
3
3
  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.0
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-10-10 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
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.11
122
+ rubygems_version: 3.5.16
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Summary of AtomicTenant.