strongmind-platform-sdk 2.16.2 → 2.16.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 534893f58ca1c24e734cadfd1a97de0f7c731b068795b47fc58a909fdf03f218
|
4
|
+
data.tar.gz: 314184477eeecbf4ce4c9ea638682e929b8c39efbf7b88c52869ea80f3dc9954
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c1acd4945a81c95a44e3ee630dca2beb62682830f14bd4d4111999c9cc3f226a82a48ef17d5fc3b2c8e478ed88e66696339bd5bb350c20e90854985cd650d42
|
7
|
+
data.tar.gz: 6c05dec6b919ed99a73bccd8c2ec1a56a1dd1997a79013622d69fc7b26bbf06818f3eb4855f995bc490090303b35e0106684615cad346a176895d6642dc58ed8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strongmind-platform-sdk (2.16.
|
4
|
+
strongmind-platform-sdk (2.16.3)
|
5
5
|
aws-sdk-secretsmanager (~> 1.66)
|
6
6
|
devise
|
7
7
|
faraday (~> 2.5, >= 2.5.2)
|
@@ -38,18 +38,18 @@ GEM
|
|
38
38
|
ast (2.4.2)
|
39
39
|
attr_required (1.0.1)
|
40
40
|
aws-eventstream (1.2.0)
|
41
|
-
aws-partitions (1.
|
42
|
-
aws-sdk-core (3.
|
41
|
+
aws-partitions (1.781.0)
|
42
|
+
aws-sdk-core (3.175.0)
|
43
43
|
aws-eventstream (~> 1, >= 1.0.2)
|
44
44
|
aws-partitions (~> 1, >= 1.651.0)
|
45
45
|
aws-sigv4 (~> 1.5)
|
46
46
|
jmespath (~> 1, >= 1.6.1)
|
47
|
-
aws-sdk-secretsmanager (1.
|
47
|
+
aws-sdk-secretsmanager (1.77.0)
|
48
48
|
aws-sdk-core (~> 3, >= 3.174.0)
|
49
49
|
aws-sigv4 (~> 1.1)
|
50
50
|
aws-sigv4 (1.5.2)
|
51
51
|
aws-eventstream (~> 1, >= 1.0.2)
|
52
|
-
bcrypt (3.1.
|
52
|
+
bcrypt (3.1.19)
|
53
53
|
bindata (2.4.15)
|
54
54
|
builder (3.2.4)
|
55
55
|
concurrent-ruby (1.2.2)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
activesupport (>= 5.0.0)
|
70
70
|
faker (3.2.0)
|
71
71
|
i18n (>= 1.8.11, < 2)
|
72
|
-
faraday (2.7.
|
72
|
+
faraday (2.7.7)
|
73
73
|
faraday-net_http (>= 2.0, < 3.1)
|
74
74
|
ruby2_keywords (>= 0.0.4)
|
75
75
|
faraday-follow_redirects (0.3.0)
|
@@ -100,7 +100,7 @@ GEM
|
|
100
100
|
mini_mime (1.1.2)
|
101
101
|
mini_portile2 (2.8.2)
|
102
102
|
minitest (5.18.0)
|
103
|
-
net-imap (0.3.
|
103
|
+
net-imap (0.3.6)
|
104
104
|
date
|
105
105
|
net-protocol
|
106
106
|
net-pop (0.1.2)
|
@@ -140,7 +140,7 @@ GEM
|
|
140
140
|
parser (3.2.2.1)
|
141
141
|
ast (~> 2.4.1)
|
142
142
|
public_suffix (5.0.1)
|
143
|
-
racc (1.
|
143
|
+
racc (1.7.1)
|
144
144
|
rack (2.2.7)
|
145
145
|
rack-oauth2 (2.2.0)
|
146
146
|
activesupport
|
@@ -209,7 +209,7 @@ GEM
|
|
209
209
|
faraday (~> 2.0)
|
210
210
|
faraday-follow_redirects
|
211
211
|
thor (1.2.2)
|
212
|
-
timeout (0.
|
212
|
+
timeout (0.4.0)
|
213
213
|
typhoeus (1.4.0)
|
214
214
|
ethon (>= 0.9.0)
|
215
215
|
tzinfo (2.0.6)
|
@@ -54,13 +54,17 @@ module PlatformSdk
|
|
54
54
|
|
55
55
|
def token_expired?(jwt)
|
56
56
|
begin
|
57
|
-
expiry_time =
|
57
|
+
expiry_time = jwt_expiry_time(jwt)
|
58
58
|
rescue JWT::ExpiredSignature
|
59
59
|
return true
|
60
60
|
end
|
61
61
|
expiry_time <= Time.now.utc + 45
|
62
62
|
end
|
63
63
|
|
64
|
+
def jwt_expiry_time(jwt)
|
65
|
+
Time.at(JWT.decode(jwt, nil, false)[0]["exp"])
|
66
|
+
end
|
67
|
+
|
64
68
|
def refresh_token(jwt:, refresh_token:)
|
65
69
|
raise ArgumentError if refresh_token.nil? || jwt.nil?
|
66
70
|
return unless token_expired?(jwt)
|
@@ -80,6 +80,10 @@ module PlatformSdk
|
|
80
80
|
case api_error.response[:status]
|
81
81
|
when 404
|
82
82
|
nil
|
83
|
+
when 401
|
84
|
+
jwt_expiry_time = @auth.token.present? ? @auth.jwt_expiry_time(@auth.token[:access_token]) : "No token present"
|
85
|
+
puts "Unauthorized exception when calling OneRoster resource. Current JWT expiry time = #{jwt_expiry_time}"
|
86
|
+
raise
|
83
87
|
else
|
84
88
|
puts "Exception when calling OneRoster resource: #{api_error}"
|
85
89
|
raise
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-platform-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.16.
|
4
|
+
version: 2.16.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|