setsuzoku 0.11.7 → 0.11.8
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: 5ce2db23193b6cfc30d0286a655c29686d0c4a65b9f11d102fb4626354730c00
|
|
4
|
+
data.tar.gz: 2ed86eb0454c3c2576bca8ab2e7b5103d0ebd3cb59eaa055cbcaf59fe20c4a5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c119e54f7b79cfcde12566681a236af85c0d8b06a06b3fe58087d52663477475f54b28077134b4074293d073a0ff058a9e8d88ba1faccde2db904012d8e8c85f
|
|
7
|
+
data.tar.gz: 4d1e2288730612ef2aa9845f642d1473d2b518e7d29561e27fffe68ac11fbba2c61e9b4052a0666ba03492b451236f0274593b687a3fd11ee7ce160f2714868f
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
setsuzoku (0.11.
|
|
4
|
+
setsuzoku (0.11.8)
|
|
5
5
|
activesupport (~> 5.0)
|
|
6
6
|
faraday (~> 0.11)
|
|
7
7
|
httparty (~> 0.16.4)
|
|
@@ -18,7 +18,7 @@ GEM
|
|
|
18
18
|
tzinfo (~> 1.1)
|
|
19
19
|
addressable (2.7.0)
|
|
20
20
|
public_suffix (>= 2.0.2, < 5.0)
|
|
21
|
-
concurrent-ruby (1.1.
|
|
21
|
+
concurrent-ruby (1.1.7)
|
|
22
22
|
crack (0.4.3)
|
|
23
23
|
safe_yaml (~> 1.0.0)
|
|
24
24
|
diff-lcs (1.4.2)
|
|
@@ -28,7 +28,7 @@ GEM
|
|
|
28
28
|
httparty (0.16.4)
|
|
29
29
|
mime-types (~> 3.0)
|
|
30
30
|
multi_xml (>= 0.5.2)
|
|
31
|
-
i18n (1.8.
|
|
31
|
+
i18n (1.8.5)
|
|
32
32
|
concurrent-ruby (~> 1.0)
|
|
33
33
|
mime-types (3.3.1)
|
|
34
34
|
mime-types-data (~> 3.2015)
|
|
@@ -37,7 +37,7 @@ GEM
|
|
|
37
37
|
minitest (5.14.1)
|
|
38
38
|
multi_xml (0.6.0)
|
|
39
39
|
multipart-post (2.1.1)
|
|
40
|
-
nokogiri (1.10.
|
|
40
|
+
nokogiri (1.10.10)
|
|
41
41
|
mini_portile2 (~> 2.4.0)
|
|
42
42
|
public_suffix (4.0.5)
|
|
43
43
|
rake (10.5.0)
|
data/lib/setsuzoku/credential.rb
CHANGED
|
@@ -14,6 +14,12 @@ module Setsuzoku
|
|
|
14
14
|
sig { abstract.returns(Struct) }
|
|
15
15
|
def self.stub_credential; end
|
|
16
16
|
|
|
17
|
+
# The status of the credential.
|
|
18
|
+
#
|
|
19
|
+
# @return [Hash] the status of the credential.
|
|
20
|
+
sig { abstract.returns(String) }
|
|
21
|
+
def status; end
|
|
22
|
+
|
|
17
23
|
# A settings object for the credential.
|
|
18
24
|
#
|
|
19
25
|
# @return [Hash] the settings for the credential.
|
|
@@ -71,7 +71,7 @@ module Setsuzoku
|
|
|
71
71
|
# @return [Boolean] true if the token is invalid.
|
|
72
72
|
sig { returns(T::Boolean) }
|
|
73
73
|
def token_is_invalid?
|
|
74
|
-
active = self.credential.
|
|
74
|
+
active = self.credential.status != 'disabled'
|
|
75
75
|
active && !self.credential.expires_on.blank? &&
|
|
76
76
|
!self.credential.refresh_token.blank? &&
|
|
77
77
|
(self.credential.expires_on < refresh_before_expiration_time)
|
|
@@ -116,15 +116,15 @@ module Setsuzoku
|
|
|
116
116
|
|
|
117
117
|
attrs = {}
|
|
118
118
|
if resp.data && resp.data[:access_token]
|
|
119
|
-
attrs[:status] = 'active'
|
|
120
|
-
attrs[:
|
|
119
|
+
attrs[:status] = 'active'
|
|
120
|
+
attrs[:token] = resp.data[:access_token]
|
|
121
121
|
attrs[:refresh_token] = resp.data[:refresh_token] if resp.data.key?(:refresh_token)
|
|
122
122
|
attrs[:expires_on] = resp.data[:expires_in].to_i.seconds.from_now if resp.data[:expires_in]
|
|
123
123
|
|
|
124
124
|
plugin_attrs = self.plugin.credential_fields_to_update(resp) if self.plugin.respond_to?(:credential_fields_to_update)
|
|
125
125
|
attrs.merge!(plugin_attrs)
|
|
126
126
|
else
|
|
127
|
-
attrs[:status] = 'error'
|
|
127
|
+
attrs[:status] = 'error'
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
# Only save Setsuzoku known fields, and any additional attributes the plugin specifies
|
data/lib/setsuzoku/version.rb
CHANGED