oneroster 2.3.4 → 2.3.6
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 +12 -2
- data/lib/one_roster/connection.rb +14 -2
- 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: 12d6aa35d7eac60a9e611302845be1ed8072e0dca2bedd11282e6bcc23cc1dfc
|
4
|
+
data.tar.gz: af958aebb8a105f98eb17ab33a42cd065ced816917a76245591f01634a3909cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d297d5100333fefe6749270f6e44620ad38b0dde3ae3cc399d73aa51c4c933eb9a87796262a0f6c93844dd8c71451f60964ac31a3ffff02734dc4c82287277e
|
7
|
+
data.tar.gz: 45d8e0c74996efe2b1e75de72a9ba57a6282ebaaf315a5bf274067a82614b935124c0aa02b9b0b0c581f53e7b2956c330cdfecb4687442e76a6969ec2e596469
|
data/Gemfile.lock
CHANGED
data/lib/one_roster/client.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module OneRoster
|
4
4
|
class Client
|
5
|
-
attr_accessor :app_id, :app_token, :api_url, :token_url,
|
5
|
+
attr_accessor :app_id, :app_token, :api_url, :token_url, :roster_app,
|
6
6
|
:app_secret, :logger, :vendor_key,
|
7
7
|
:username_source, :oauth_strategy, :staff_username_source
|
8
8
|
|
@@ -129,7 +129,17 @@ module OneRoster
|
|
129
129
|
|
130
130
|
def token
|
131
131
|
url = token_url || "#{api_url}/token"
|
132
|
-
|
132
|
+
|
133
|
+
credential_params = { grant_type: 'client_credentials',
|
134
|
+
scope: 'https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly' }
|
135
|
+
|
136
|
+
if roster_app == 'infinite_campus'
|
137
|
+
connection.execute(url, :post, credential_params)
|
138
|
+
elsif roster_app == 'synergy'
|
139
|
+
connection.execute(url, :post, nil, credential_params)
|
140
|
+
else
|
141
|
+
connection.execute(url, :post)
|
142
|
+
end
|
133
143
|
end
|
134
144
|
|
135
145
|
def set_auth_headers(token, cookie)
|
@@ -44,12 +44,24 @@ module OneRoster
|
|
44
44
|
request.options.open_timeout = OPEN_TIMEOUT
|
45
45
|
request.options.timeout = TIMEOUT
|
46
46
|
request.url path, params
|
47
|
-
request.headers['
|
47
|
+
request.headers['Content-Type'] = content_type
|
48
48
|
request.headers['Cookie'] = @cookie
|
49
|
-
request.body = body
|
49
|
+
request.body = render_body(body)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
def content_type
|
54
|
+
return 'application/x-www-form-urlencoded' if @client.roster_app == 'synergy'
|
55
|
+
|
56
|
+
'application/json'
|
57
|
+
end
|
58
|
+
|
59
|
+
def render_body(body)
|
60
|
+
return URI.encode_www_form(body) if !body.nil? && @client.roster_app == 'synergy'
|
61
|
+
|
62
|
+
body
|
63
|
+
end
|
64
|
+
|
53
65
|
def oauth_connection
|
54
66
|
Faraday.new(@client.api_url) do |connection|
|
55
67
|
connection.request :oauth,
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Julius
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|