bright 2.1.1 → 2.2.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/lib/bright/errors.rb +7 -2
- data/lib/bright/sis_apis/base.rb +1 -1
- data/lib/bright/sis_apis/one_roster/aeries.rb +38 -0
- data/lib/bright/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6fa2d83e3e42ccc235ef1892288bd3cbe8e0013415476abd95e7f74613deec6
|
|
4
|
+
data.tar.gz: 51994daa0919dec7e1e65723acb82a9610802f4f274ad5a6926e163d76ef8a8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b86b204e80ef3f4629ad33bb557c5d01ca965c359ff5ac77391087f482a0c99320a14f57d83715e6c1c88cb31c0ecd462bc2bc1b2502b31845de1bf922046bfd
|
|
7
|
+
data.tar.gz: b4f73c066be2efc98cd1f000c55f3fcc0d6df7ee1c55073caef62d33d06d26b2be6ba001513db92e019ae11a8c2669ebbe83c3f4e7343d332f8dbe8827e2d265
|
data/lib/bright/errors.rb
CHANGED
|
@@ -16,8 +16,13 @@ module Bright
|
|
|
16
16
|
response.body
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def
|
|
20
|
-
|
|
19
|
+
def retryable_error?
|
|
20
|
+
response_code = response&.code.to_i
|
|
21
|
+
|
|
22
|
+
return true if (500..599).include?(response_code)
|
|
23
|
+
return true if 408 == response_code
|
|
24
|
+
|
|
25
|
+
false
|
|
21
26
|
end
|
|
22
27
|
end
|
|
23
28
|
|
data/lib/bright/sis_apis/base.rb
CHANGED
|
@@ -27,7 +27,7 @@ module Bright
|
|
|
27
27
|
yield
|
|
28
28
|
rescue Bright::ResponseError => e
|
|
29
29
|
retries += 1
|
|
30
|
-
if e.
|
|
30
|
+
if e.retryable_error? && retries <= retry_attempts.to_i
|
|
31
31
|
puts "retrying #{retries}: #{e.class} - #{e}"
|
|
32
32
|
sleep(retries * 3)
|
|
33
33
|
retry
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Bright
|
|
2
|
+
module SisApi
|
|
3
|
+
class OneRoster::Aeries < OneRoster
|
|
4
|
+
def initialize(options = {})
|
|
5
|
+
self.connection_options = options[:connection] || {}
|
|
6
|
+
# https://support.aeries.com/support/solutions/articles/14000065677-oneroster-api-authentication-process
|
|
7
|
+
# ALL of the below are required
|
|
8
|
+
# {
|
|
9
|
+
# :client_id => "",
|
|
10
|
+
# :client_secret => "",
|
|
11
|
+
# :uri => "",
|
|
12
|
+
# :token_uri => "",
|
|
13
|
+
# :scope => ""
|
|
14
|
+
# }
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def retrieve_access_token
|
|
18
|
+
connection = Bright::Connection.new(connection_options[:token_uri])
|
|
19
|
+
response = connection.request(:post,
|
|
20
|
+
{
|
|
21
|
+
"grant_type" => "client_credentials",
|
|
22
|
+
"username" => connection_options[:client_id],
|
|
23
|
+
"password" => connection_options[:client_secret],
|
|
24
|
+
"scope" => connection_options[:scope]
|
|
25
|
+
},
|
|
26
|
+
headers_for_access_token)
|
|
27
|
+
if !response.error?
|
|
28
|
+
response_hash = JSON.parse(response.body)
|
|
29
|
+
end
|
|
30
|
+
if response_hash["access_token"]
|
|
31
|
+
connection_options[:access_token] = response_hash["access_token"]
|
|
32
|
+
connection_options[:access_token_expires] = (Time.now - 10) + response_hash["expires_in"]
|
|
33
|
+
end
|
|
34
|
+
response_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/bright/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bright
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arux Software
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-09-30 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: httpi
|
|
@@ -129,6 +130,7 @@ files:
|
|
|
129
130
|
- lib/bright/sis_apis/bright_sis.rb
|
|
130
131
|
- lib/bright/sis_apis/focus.rb
|
|
131
132
|
- lib/bright/sis_apis/one_roster.rb
|
|
133
|
+
- lib/bright/sis_apis/one_roster/aeries.rb
|
|
132
134
|
- lib/bright/sis_apis/one_roster/infinite_campus.rb
|
|
133
135
|
- lib/bright/sis_apis/one_roster/skyward.rb
|
|
134
136
|
- lib/bright/sis_apis/power_school.rb
|
|
@@ -140,6 +142,7 @@ homepage: https://github.com/Arux-Software/Bright
|
|
|
140
142
|
licenses:
|
|
141
143
|
- MIT
|
|
142
144
|
metadata: {}
|
|
145
|
+
post_install_message:
|
|
143
146
|
rdoc_options: []
|
|
144
147
|
require_paths:
|
|
145
148
|
- lib
|
|
@@ -154,7 +157,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
157
|
- !ruby/object:Gem::Version
|
|
155
158
|
version: '0'
|
|
156
159
|
requirements: []
|
|
157
|
-
rubygems_version: 3.
|
|
160
|
+
rubygems_version: 3.0.9
|
|
161
|
+
signing_key:
|
|
158
162
|
specification_version: 4
|
|
159
163
|
summary: Framework and tools for dealing with Student Information Systems
|
|
160
164
|
test_files: []
|