oneroster 2.3.5 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0eb863f19f9722d3c2f53f0f66d822aa8fd198914de2dd191d1de5e90eea0a9
4
- data.tar.gz: b7915d245392cf5a4a184212093138cb4d336aa77ef106296f8936ef3ccea669
3
+ metadata.gz: 12d6aa35d7eac60a9e611302845be1ed8072e0dca2bedd11282e6bcc23cc1dfc
4
+ data.tar.gz: af958aebb8a105f98eb17ab33a42cd065ced816917a76245591f01634a3909cd
5
5
  SHA512:
6
- metadata.gz: 5cfde8ae36c6226dc0646ba58ba5070bc06c9be1fc6439a51b2f5070284985be5e1bc89515684efe604199d8746b94278046fac593c0598a5b967260570c89e4
7
- data.tar.gz: 594b2daf5595fff0122b2797acdec30a8599c86e10aa75dcb6369a1a2022bcf5526ee377836fe8bd63c7c02c26f1fb0e6c00499dca6bd0f2fa8d7a5bbca2efb7
6
+ metadata.gz: 9d297d5100333fefe6749270f6e44620ad38b0dde3ae3cc399d73aa51c4c933eb9a87796262a0f6c93844dd8c71451f60964ac31a3ffff02734dc4c82287277e
7
+ data.tar.gz: 45d8e0c74996efe2b1e75de72a9ba57a6282ebaaf315a5bf274067a82614b935124c0aa02b9b0b0c581f53e7b2956c330cdfecb4687442e76a6969ec2e596469
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oneroster (2.3.5)
4
+ oneroster (2.3.6)
5
5
  dry-inflector
6
6
  faraday
7
7
  faraday_middleware
@@ -130,9 +130,13 @@ module OneRoster
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
+
133
136
  if roster_app == 'infinite_campus'
134
- connection.execute(url, :post, { grant_type: 'client_credentials',
135
- scope: 'https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly' })
137
+ connection.execute(url, :post, credential_params)
138
+ elsif roster_app == 'synergy'
139
+ connection.execute(url, :post, nil, credential_params)
136
140
  else
137
141
  connection.execute(url, :post)
138
142
  end
@@ -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['Accept-Header'] = 'application/json'
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OneRoster
4
- VERSION = '2.3.5'
4
+ VERSION = '2.3.6'
5
5
  end
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.5
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: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday