setsuzoku 0.11.5 → 0.11.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/setsuzoku/service/web_service/auth_strategies/o_auth_strategy.rb +13 -24
- data/lib/setsuzoku/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e0e78fe9c055eb1696a1df750b36fad06363646e465a3cbe4e86da69cd75215
|
4
|
+
data.tar.gz: 5f3c4c99f1587492b7c552205a4bfc99ff1b29631346f50206216a397686e90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d1a53b0552e7cbf2941933a80cce484f1c5c4d606fd806d230692045acb6bb6bd11b42c3427ec603353d4380af690764cfc3f1fe0f5511082fdd0bd0dcb150
|
7
|
+
data.tar.gz: 3c1f8a24908d294f221bb7bdb8c0d731693b1e43b10e42b4b6457f66dcff3fb7f15d171cead30f8bfbf6ad8098283059c1a476a807261a8868ca9134a7308145
|
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.6)
|
5
5
|
activesupport (~> 5.0)
|
6
6
|
faraday (~> 0.11)
|
7
7
|
httparty (~> 0.16.4)
|
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
safe_yaml (1.0.5)
|
58
58
|
sorbet (0.5.5675)
|
59
59
|
sorbet-static (= 0.5.5675)
|
60
|
-
sorbet-runtime (0.5.
|
60
|
+
sorbet-runtime (0.5.5878)
|
61
61
|
sorbet-static (0.5.5675-universal-darwin-14)
|
62
62
|
thread_safe (0.3.6)
|
63
63
|
tzinfo (1.2.7)
|
@@ -114,34 +114,23 @@ module Setsuzoku
|
|
114
114
|
|
115
115
|
resp = self.api_strategy.call_external_api(request: request, strategy: :auth)
|
116
116
|
|
117
|
+
attrs = {}
|
117
118
|
if resp.data && resp.data[:access_token]
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
end
|
126
|
-
|
127
|
-
self.plugin.set_credential_fields!(resp) if self.plugin.respond_to?(:set_credential_fields!)
|
128
|
-
|
129
|
-
#TODO: figure out a better way to do this when we add other integrations...
|
130
|
-
#
|
131
|
-
# if self.is_a?(FacebookIntegration)
|
132
|
-
# resp = self.exchange_for_long_lived_token
|
133
|
-
# if resp && resp.data['access_token']
|
134
|
-
# self.token = resp.data['access_token']
|
135
|
-
# self.refresh_token = resp.data['access_token']
|
136
|
-
# self.expires_on = 59.days.from_now
|
137
|
-
# end
|
138
|
-
# end
|
119
|
+
attrs[:status] = 'active' if self.credential.respond_to?(:"status=")
|
120
|
+
attrs[:access_token] = resp.data[:access_token]
|
121
|
+
attrs[:refresh_token] = resp.data[:refresh_token] if resp.data.key?(:refresh_token)
|
122
|
+
attrs[:expires_on] = resp.data[:expires_in].to_i.seconds.from_now if resp.data[:expires_in]
|
123
|
+
|
124
|
+
plugin_attrs = self.plugin.credential_fields_to_update(resp) if self.plugin.respond_to?(:credential_fields_to_update)
|
125
|
+
attrs.merge!(plugin_attrs)
|
139
126
|
else
|
140
|
-
|
127
|
+
attrs[:status] = 'error' if self.credential.respond_to?(:"status=")
|
141
128
|
end
|
142
129
|
|
143
|
-
|
144
|
-
|
130
|
+
# Only save Setsuzoku known fields, and any additional attributes the plugin specifies
|
131
|
+
# in credential_fields_to_update.
|
132
|
+
if self.credential.respond_to?(:"update_attributes")
|
133
|
+
self.credential.update_attributes(attrs) && resp.success
|
145
134
|
else
|
146
135
|
resp.success
|
147
136
|
end
|
data/lib/setsuzoku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: setsuzoku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Stadtler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|