oneroster 2.3.25 → 2.3.26
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 +1 -1
- data/lib/one_roster/client.rb +20 -9
- data/lib/one_roster/connection.rb +4 -0
- data/lib/one_roster/paginator.rb +1 -1
- data/lib/one_roster/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 189445ee35d9472f9324ad96eae0c56df171d0200c20f1c33ef0507e155de2a4
|
|
4
|
+
data.tar.gz: 3e1886bdbf60a197ec1b37d0b47cb9563d921ff1fe9f1a5d5497eab07ec5b5f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3213057e6555cbb9db4c68c9cb33b4206c652e1748a0d95498b6f37168b01f62b7430986825b4394a8495176d1410b7638f27544ecb9492118dfaba276c2cf36
|
|
7
|
+
data.tar.gz: c385bca6f5e59fe35169a2fab47184b223bcc97c214ff15b87a344dbe21dae103cd26e2eca4528ef71e14fd468b5ebd3aabc17b45f1bec9d34479edd980b35aa
|
data/Gemfile.lock
CHANGED
data/lib/one_roster/client.rb
CHANGED
|
@@ -7,7 +7,8 @@ module OneRoster
|
|
|
7
7
|
:username_source, :oauth_strategy, :staff_username_source, :token_content_type,
|
|
8
8
|
:sentry_client, :only_provision_current_terms,
|
|
9
9
|
:student_username_search_for, :staffer_username_search_for,
|
|
10
|
-
:student_username_replace_with, :staffer_username_replace_with, :ca_cert_path
|
|
10
|
+
:student_username_replace_with, :staffer_username_replace_with, :ca_cert_path,
|
|
11
|
+
:service_account, :endpoint_prefix, :scope
|
|
11
12
|
|
|
12
13
|
attr_reader :authenticated
|
|
13
14
|
|
|
@@ -22,11 +23,21 @@ module OneRoster
|
|
|
22
23
|
client
|
|
23
24
|
end
|
|
24
25
|
|
|
26
|
+
%i(students teachers admins courses classes enrollments academic_sessions schools).each do |record_type|
|
|
27
|
+
define_method("#{record_type}_endpoint") do
|
|
28
|
+
if endpoint_prefix.nil? || endpoint_prefix == ''
|
|
29
|
+
OneRoster.const_get("#{record_type.upcase}_ENDPOINT")
|
|
30
|
+
else
|
|
31
|
+
OneRoster.const_get("#{record_type.upcase}_ENDPOINT").gsub('ims/oneroster/', "#{endpoint_prefix}")
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
25
36
|
%i(students teachers classes).each do |record_type|
|
|
26
37
|
define_method(record_type) do |record_uids = []|
|
|
27
38
|
authenticate
|
|
28
39
|
|
|
29
|
-
endpoint =
|
|
40
|
+
endpoint = public_send("#{record_type}_endpoint")
|
|
30
41
|
|
|
31
42
|
type = Types.const_get(Dry::Inflector.new.singularize(record_type.to_s.capitalize))
|
|
32
43
|
|
|
@@ -42,7 +53,7 @@ module OneRoster
|
|
|
42
53
|
def admins(record_uids = [])
|
|
43
54
|
authenticate
|
|
44
55
|
|
|
45
|
-
records = Paginator.fetch(connection,
|
|
56
|
+
records = Paginator.fetch(connection, admins_endpoint, :get, Types::Admin, client: self).force
|
|
46
57
|
|
|
47
58
|
return records if record_uids.empty?
|
|
48
59
|
|
|
@@ -53,7 +64,7 @@ module OneRoster
|
|
|
53
64
|
def schools
|
|
54
65
|
authenticate
|
|
55
66
|
|
|
56
|
-
Paginator.fetch(connection,
|
|
67
|
+
Paginator.fetch(connection, schools_endpoint,
|
|
57
68
|
:get, Types::School, client: self).force
|
|
58
69
|
end
|
|
59
70
|
|
|
@@ -94,7 +105,7 @@ module OneRoster
|
|
|
94
105
|
def terms
|
|
95
106
|
authenticate
|
|
96
107
|
|
|
97
|
-
endpoint =
|
|
108
|
+
endpoint = academic_sessions_endpoint
|
|
98
109
|
|
|
99
110
|
type = Types::Term
|
|
100
111
|
|
|
@@ -108,7 +119,7 @@ module OneRoster
|
|
|
108
119
|
|
|
109
120
|
courses = Paginator.fetch(
|
|
110
121
|
connection,
|
|
111
|
-
|
|
122
|
+
courses_endpoint,
|
|
112
123
|
:get,
|
|
113
124
|
Types::Course,
|
|
114
125
|
client: self
|
|
@@ -137,7 +148,7 @@ module OneRoster
|
|
|
137
148
|
|
|
138
149
|
set_auth_headers(response.raw_body, response.headers['set-cookie'])
|
|
139
150
|
else
|
|
140
|
-
response = connection.execute(
|
|
151
|
+
response = connection.execute(teachers_endpoint, :get, limit: 1)
|
|
141
152
|
|
|
142
153
|
fail ConnectionError, response.raw_body unless response.success?
|
|
143
154
|
end
|
|
@@ -157,7 +168,7 @@ module OneRoster
|
|
|
157
168
|
url = token_url || "#{api_url}/token"
|
|
158
169
|
|
|
159
170
|
credential_params = { grant_type: 'client_credentials',
|
|
160
|
-
scope: 'https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly' }
|
|
171
|
+
scope: scope || 'https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly' }
|
|
161
172
|
|
|
162
173
|
if roster_app == 'infinite_campus'
|
|
163
174
|
connection.execute(url, :post, credential_params, nil, token_content_type)
|
|
@@ -177,7 +188,7 @@ module OneRoster
|
|
|
177
188
|
def parse_enrollments(classroom_uids = [])
|
|
178
189
|
enrollments = Paginator.fetch(
|
|
179
190
|
connection,
|
|
180
|
-
|
|
191
|
+
enrollments_endpoint,
|
|
181
192
|
:get,
|
|
182
193
|
Types::Enrollment,
|
|
183
194
|
client: self
|
|
@@ -63,6 +63,10 @@ module OneRoster
|
|
|
63
63
|
request.headers['Content-Type'] = content_type || set_content_type
|
|
64
64
|
request.headers['Cookie'] = @cookie
|
|
65
65
|
request.body = render_body(body, content_type)
|
|
66
|
+
|
|
67
|
+
unless @client.service_account.nil?
|
|
68
|
+
request.headers['serviceAccountID'] = @client.service_account
|
|
69
|
+
end
|
|
66
70
|
end
|
|
67
71
|
end
|
|
68
72
|
|
data/lib/one_roster/paginator.rb
CHANGED
data/lib/one_roster/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oneroster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.
|
|
4
|
+
version: 2.3.26
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Julius
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|