setsuzoku 0.11.7 → 0.11.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0ab91eaa6a9400d9a0647b05050f9c36dfce42b98615e759dbeed9d57c1c386
4
- data.tar.gz: b7ec53469c182c7defc53af1f4f0aff7a2cf2ee6fba52a78bdd9ee2d8f6364c8
3
+ metadata.gz: 5ce2db23193b6cfc30d0286a655c29686d0c4a65b9f11d102fb4626354730c00
4
+ data.tar.gz: 2ed86eb0454c3c2576bca8ab2e7b5103d0ebd3cb59eaa055cbcaf59fe20c4a5f
5
5
  SHA512:
6
- metadata.gz: 10f9cc0590cd0cb0a02fe4cb03eb59eaba92dabc3534253a91fbbd5d37689b31a3b2c916ddc5c4c589a7a12bc4f3471059c5b3fb9ed40c80ed69bc34e95d735f
7
- data.tar.gz: 40672dbe7dba68c32013e4052febb2cd1a9988083a36132b9b54f16b7077a17d65c2276a8893229f12c6f0a7babb7e852021f7f4fd36cb15f2a836569efcb740
6
+ metadata.gz: c119e54f7b79cfcde12566681a236af85c0d8b06a06b3fe58087d52663477475f54b28077134b4074293d073a0ff058a9e8d88ba1faccde2db904012d8e8c85f
7
+ data.tar.gz: 4d1e2288730612ef2aa9845f642d1473d2b518e7d29561e27fffe68ac11fbba2c61e9b4052a0666ba03492b451236f0274593b687a3fd11ee7ce160f2714868f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- setsuzoku (0.11.7)
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.6)
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.3)
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.9)
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)
@@ -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.respond_to?(:"status") ? self.credential.status != 'disabled' : true
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' if self.credential.respond_to?(:"status=")
120
- attrs[:access_token] = resp.data[:access_token]
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' if self.credential.respond_to?(:"status=")
127
+ attrs[:status] = 'error'
128
128
  end
129
129
 
130
130
  # Only save Setsuzoku known fields, and any additional attributes the plugin specifies
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Setsuzoku
5
- VERSION = '0.11.7'
5
+ VERSION = '0.11.8'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setsuzoku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.7
4
+ version: 0.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Stadtler