strongmind-platform-sdk 2.14.0 → 2.15.0
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/Gemfile.lock +41 -41
- data/lib/platform_sdk/id_mapper/client.rb +69 -5
- data/lib/platform_sdk/id_mapper/models/domain.rb +18 -0
- data/lib/platform_sdk/id_mapper/models/domain_lti.rb +18 -0
- data/lib/platform_sdk/id_mapper/models/lti.rb +18 -0
- data/lib/platform_sdk/id_mapper/models.rb +9 -0
- data/lib/platform_sdk/id_mapper.rb +1 -0
- data/lib/platform_sdk/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc1ec78b01606b3ff2d580b74384babf0b5bebe6b9fd63c860604fbbe2a4c448
|
4
|
+
data.tar.gz: fd71f249ded7674968d27bd4bd9151b0f7635eaf685ab16b5bd927e87cf33010
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6623bda6194ed932d6658a4bd906caabc590ea5e81829d3b91ac38135e259013653830abc01eed053d37901e4925d9734149e5703d745cd430936e3c9e38fb02
|
7
|
+
data.tar.gz: 24f7e8881ddc97108d52867098c05b75131943f5403d5b4fe37b0206377fc5d5391dd6134c86fc5e42092b07294839bfb93977733e226b38076b4336ad280112
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strongmind-platform-sdk (2.
|
4
|
+
strongmind-platform-sdk (2.15.0)
|
5
5
|
aws-sdk-secretsmanager (~> 1.66)
|
6
6
|
devise
|
7
7
|
faraday (~> 2.5, >= 2.5.2)
|
@@ -14,22 +14,22 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
actionpack (7.0.
|
18
|
-
actionview (= 7.0.
|
19
|
-
activesupport (= 7.0.
|
20
|
-
rack (~> 2.0, >= 2.2.
|
17
|
+
actionpack (7.0.5)
|
18
|
+
actionview (= 7.0.5)
|
19
|
+
activesupport (= 7.0.5)
|
20
|
+
rack (~> 2.0, >= 2.2.4)
|
21
21
|
rack-test (>= 0.6.3)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
23
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
24
|
-
actionview (7.0.
|
25
|
-
activesupport (= 7.0.
|
24
|
+
actionview (7.0.5)
|
25
|
+
activesupport (= 7.0.5)
|
26
26
|
builder (~> 3.1)
|
27
27
|
erubi (~> 1.4)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
29
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
30
|
-
activemodel (7.0.
|
31
|
-
activesupport (= 7.0.
|
32
|
-
activesupport (7.0.
|
30
|
+
activemodel (7.0.5)
|
31
|
+
activesupport (= 7.0.5)
|
32
|
+
activesupport (7.0.5)
|
33
33
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
34
34
|
i18n (>= 1.6, < 2)
|
35
35
|
minitest (>= 5.1)
|
@@ -52,7 +52,7 @@ GEM
|
|
52
52
|
bcrypt (3.1.18)
|
53
53
|
bindata (2.4.15)
|
54
54
|
builder (3.2.4)
|
55
|
-
concurrent-ruby (1.
|
55
|
+
concurrent-ruby (1.2.2)
|
56
56
|
crass (1.0.6)
|
57
57
|
date (3.3.3)
|
58
58
|
devise (4.9.2)
|
@@ -67,7 +67,7 @@ GEM
|
|
67
67
|
ffi (>= 1.15.0)
|
68
68
|
factory_bot (6.2.1)
|
69
69
|
activesupport (>= 5.0.0)
|
70
|
-
faker (2.
|
70
|
+
faker (3.2.0)
|
71
71
|
i18n (>= 1.8.11, < 2)
|
72
72
|
faraday (2.7.5)
|
73
73
|
faraday-net_http (>= 2.0, < 3.1)
|
@@ -77,10 +77,10 @@ GEM
|
|
77
77
|
faraday-net_http (3.0.2)
|
78
78
|
ffi (1.15.5)
|
79
79
|
hashie (5.0.0)
|
80
|
-
i18n (1.
|
80
|
+
i18n (1.13.0)
|
81
81
|
concurrent-ruby (~> 1.0)
|
82
82
|
jmespath (1.6.2)
|
83
|
-
json (2.6.
|
83
|
+
json (2.6.3)
|
84
84
|
json-jwt (1.16.3)
|
85
85
|
activesupport (>= 4.2)
|
86
86
|
aes_key_wrap
|
@@ -99,7 +99,7 @@ GEM
|
|
99
99
|
method_source (1.0.0)
|
100
100
|
mini_mime (1.1.2)
|
101
101
|
mini_portile2 (2.8.2)
|
102
|
-
minitest (5.
|
102
|
+
minitest (5.18.0)
|
103
103
|
net-imap (0.3.4)
|
104
104
|
date
|
105
105
|
net-protocol
|
@@ -140,8 +140,8 @@ GEM
|
|
140
140
|
validate_url
|
141
141
|
webfinger (~> 2.0)
|
142
142
|
orm_adapter (0.5.0)
|
143
|
-
parallel (1.
|
144
|
-
parser (3.
|
143
|
+
parallel (1.23.0)
|
144
|
+
parser (3.2.2.1)
|
145
145
|
ast (~> 2.4.1)
|
146
146
|
public_suffix (5.0.1)
|
147
147
|
racc (1.6.2)
|
@@ -163,46 +163,46 @@ GEM
|
|
163
163
|
rails-html-sanitizer (1.6.0)
|
164
164
|
loofah (~> 2.21)
|
165
165
|
nokogiri (~> 1.14)
|
166
|
-
railties (7.0.
|
167
|
-
actionpack (= 7.0.
|
168
|
-
activesupport (= 7.0.
|
166
|
+
railties (7.0.5)
|
167
|
+
actionpack (= 7.0.5)
|
168
|
+
activesupport (= 7.0.5)
|
169
169
|
method_source
|
170
170
|
rake (>= 12.2)
|
171
171
|
thor (~> 1.0)
|
172
172
|
zeitwerk (~> 2.5)
|
173
173
|
rainbow (3.1.1)
|
174
174
|
rake (13.0.6)
|
175
|
-
regexp_parser (2.
|
175
|
+
regexp_parser (2.8.0)
|
176
176
|
responders (3.1.0)
|
177
177
|
actionpack (>= 5.2)
|
178
178
|
railties (>= 5.2)
|
179
179
|
rexml (3.2.5)
|
180
|
-
rspec (3.
|
181
|
-
rspec-core (~> 3.
|
182
|
-
rspec-expectations (~> 3.
|
183
|
-
rspec-mocks (~> 3.
|
184
|
-
rspec-core (3.
|
185
|
-
rspec-support (~> 3.
|
186
|
-
rspec-expectations (3.
|
180
|
+
rspec (3.12.0)
|
181
|
+
rspec-core (~> 3.12.0)
|
182
|
+
rspec-expectations (~> 3.12.0)
|
183
|
+
rspec-mocks (~> 3.12.0)
|
184
|
+
rspec-core (3.12.2)
|
185
|
+
rspec-support (~> 3.12.0)
|
186
|
+
rspec-expectations (3.12.3)
|
187
187
|
diff-lcs (>= 1.2.0, < 2.0)
|
188
|
-
rspec-support (~> 3.
|
189
|
-
rspec-mocks (3.
|
188
|
+
rspec-support (~> 3.12.0)
|
189
|
+
rspec-mocks (3.12.5)
|
190
190
|
diff-lcs (>= 1.2.0, < 2.0)
|
191
|
-
rspec-support (~> 3.
|
192
|
-
rspec-support (3.
|
193
|
-
rubocop (1.
|
191
|
+
rspec-support (~> 3.12.0)
|
192
|
+
rspec-support (3.12.0)
|
193
|
+
rubocop (1.51.0)
|
194
194
|
json (~> 2.3)
|
195
195
|
parallel (~> 1.10)
|
196
|
-
parser (>= 3.
|
196
|
+
parser (>= 3.2.0.0)
|
197
197
|
rainbow (>= 2.2.2, < 4.0)
|
198
198
|
regexp_parser (>= 1.8, < 3.0)
|
199
199
|
rexml (>= 3.2.5, < 4.0)
|
200
|
-
rubocop-ast (>= 1.
|
200
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
201
201
|
ruby-progressbar (~> 1.7)
|
202
|
-
unicode-display_width (>=
|
203
|
-
rubocop-ast (1.
|
204
|
-
parser (>= 3.
|
205
|
-
ruby-progressbar (1.
|
202
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
203
|
+
rubocop-ast (1.28.1)
|
204
|
+
parser (>= 3.2.1.0)
|
205
|
+
ruby-progressbar (1.13.0)
|
206
206
|
ruby2_keywords (0.0.5)
|
207
207
|
strongmind-oneroster-client (2.0.3)
|
208
208
|
json (~> 2.1, >= 2.1.0)
|
@@ -216,9 +216,9 @@ GEM
|
|
216
216
|
timeout (0.3.2)
|
217
217
|
typhoeus (1.4.0)
|
218
218
|
ethon (>= 0.9.0)
|
219
|
-
tzinfo (2.0.
|
219
|
+
tzinfo (2.0.6)
|
220
220
|
concurrent-ruby (~> 1.0)
|
221
|
-
unicode-display_width (2.
|
221
|
+
unicode-display_width (2.4.2)
|
222
222
|
uri (0.12.1)
|
223
223
|
validate_email (0.1.6)
|
224
224
|
activemodel (>= 3.0)
|
@@ -20,19 +20,83 @@ module PlatformSdk
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
private
|
24
|
+
def models
|
25
|
+
PlatformSdk::IdMapper::Models
|
26
|
+
end
|
27
|
+
|
28
|
+
def get(path, params = nil)
|
29
|
+
response = @conn.get(path, params)
|
30
|
+
response.body
|
31
|
+
end
|
32
|
+
|
33
|
+
def headers
|
34
|
+
{ "Authorization" => "Token #{@token}" }
|
35
|
+
end
|
36
|
+
|
37
|
+
def list_of_models(model, list)
|
38
|
+
list.map do |item|
|
39
|
+
model.new(item)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
public
|
44
|
+
|
23
45
|
def pairs(guid)
|
46
|
+
path = "api/v1/pairs/#{guid}/"
|
24
47
|
begin
|
25
|
-
|
48
|
+
get(path)
|
26
49
|
rescue Faraday::ResourceNotFound
|
27
50
|
raise PlatformSdk::IdMapper::PairNotFoundError, msg = guid
|
28
51
|
end
|
29
|
-
response.body
|
30
52
|
end
|
31
53
|
|
32
|
-
|
54
|
+
def domains(**params)
|
55
|
+
path = 'api/v1/domains/'
|
56
|
+
body = get(path, params)
|
57
|
+
list_of_models(models::Domain, body)
|
58
|
+
end
|
33
59
|
|
34
|
-
def
|
35
|
-
|
60
|
+
def domain_by_name(name)
|
61
|
+
path = "api/v1/domains/#{name}/"
|
62
|
+
body = get(path)
|
63
|
+
models::Domain.new(body)
|
64
|
+
end
|
65
|
+
|
66
|
+
def domain_ltis(**params)
|
67
|
+
path = 'api/v1/domainLtis/'
|
68
|
+
body = get(path, params)
|
69
|
+
list_of_models(models::DomainLti, body)
|
70
|
+
end
|
71
|
+
|
72
|
+
def domain_ltis_by_domain(domain_name)
|
73
|
+
path = "api/v1/domains/#{domain_name}/ltis/"
|
74
|
+
body = get(path)
|
75
|
+
list_of_models(models::DomainLti, body)
|
76
|
+
end
|
77
|
+
|
78
|
+
def domain_ltis_by_lti(lti_identifier)
|
79
|
+
path = "api/v1/domainLtis/?lti__identifier=#{lti_identifier}"
|
80
|
+
body = get(path)
|
81
|
+
list_of_models(models::DomainLti, body)
|
82
|
+
end
|
83
|
+
|
84
|
+
def domain_lti_by_domain_and_lti(domain_name, lti_identifier)
|
85
|
+
path = "api/v1/domains/#{domain_name}/ltis/#{lti_identifier}/"
|
86
|
+
body = get(path)
|
87
|
+
list_of_models(models::DomainLti, body)
|
88
|
+
end
|
89
|
+
|
90
|
+
def ltis(**params)
|
91
|
+
path = 'api/v1/ltis/'
|
92
|
+
body = get(path, params)
|
93
|
+
list_of_models(models::Lti, body)
|
94
|
+
end
|
95
|
+
|
96
|
+
def lti_by_identifier(identifier)
|
97
|
+
path = "api/v1/ltis/#{identifier}/"
|
98
|
+
body = get(path)
|
99
|
+
models::Lti.new(body)
|
36
100
|
end
|
37
101
|
end
|
38
102
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PlatformSdk
|
4
|
+
module IdMapper
|
5
|
+
module Models
|
6
|
+
# Domain object returned by IdMapper
|
7
|
+
class Domain
|
8
|
+
attr_accessor :id, :name, :key, :secret, :is_disabled, :partner
|
9
|
+
|
10
|
+
def initialize(attributes = {})
|
11
|
+
attributes.each do |key, value|
|
12
|
+
instance_variable_set("@#{key}", value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PlatformSdk
|
4
|
+
module IdMapper
|
5
|
+
module Models
|
6
|
+
# DomainLti object returned by IdMapper
|
7
|
+
class DomainLti
|
8
|
+
attr_accessor :key, :secret, :is_disabled, :domain, :domain_name, :lti, :lti_title, :lti_identifier, :lti_is_disabled
|
9
|
+
|
10
|
+
def initialize(attributes = {})
|
11
|
+
attributes.each do |key, value|
|
12
|
+
instance_variable_set("@#{key}", value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PlatformSdk
|
4
|
+
module IdMapper
|
5
|
+
module Models
|
6
|
+
# Lti object returned by IdMapper
|
7
|
+
class Lti
|
8
|
+
attr_accessor :id, :title, :identifier, :is_disabled
|
9
|
+
|
10
|
+
def initialize(attributes = {})
|
11
|
+
attributes.each do |key, value|
|
12
|
+
send("#{key}=", value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-platform-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform Team
|
@@ -161,6 +161,10 @@ files:
|
|
161
161
|
- lib/platform_sdk/id_mapper.rb
|
162
162
|
- lib/platform_sdk/id_mapper/client.rb
|
163
163
|
- lib/platform_sdk/id_mapper/constants.rb
|
164
|
+
- lib/platform_sdk/id_mapper/models.rb
|
165
|
+
- lib/platform_sdk/id_mapper/models/domain.rb
|
166
|
+
- lib/platform_sdk/id_mapper/models/domain_lti.rb
|
167
|
+
- lib/platform_sdk/id_mapper/models/lti.rb
|
164
168
|
- lib/platform_sdk/identity.rb
|
165
169
|
- lib/platform_sdk/identity/clients.rb
|
166
170
|
- lib/platform_sdk/one_roster.rb
|