infinum_id 2.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/Gemfile.lock +120 -88
- data/app/controllers/infinum_id/api/webhooks_controller.rb +19 -2
- data/app/services/infinum_id/resources/updater.rb +1 -1
- data/config/routes.rb +1 -0
- data/lib/infinum_id/version.rb +1 -1
- data/lib/infinum_id.rb +4 -4
- metadata +4 -4
- data/CHANGES.md +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67137fa0c4e6919f124afc28ddebd3b01f91ee27f25620fe99fe22cc38addfc9
|
4
|
+
data.tar.gz: e5288ff536d9ff6cc3af37c9078e7ea069413751dff418d8348be826a6d4bcff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5d194290db76dfbe9f1d9caffe2b509d7c064b1a1de9bfb7f12a583aa2666f45f82b99e825ff304bae472015f7740e38bab10a30b5461fa4a6e4c9cea30c43
|
7
|
+
data.tar.gz: e5d62e234ff27943d88499cb68421b81b091aeacce9d487e4b9ce5084a8a43687894e35e0b553f4892d202cbe6bcc79a8e9c540e08e035f2b1851f8fd481637d
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [v2.1.0](https://github.com/infinum/rails-infinum-id-engine/tree/v2.1.0) (2021-05-26)
|
4
|
+
[Full Changelog](https://github.com/infinum/rails-infinum-id-engine/compare/v2.0.1...v2.1.0)
|
5
|
+
|
6
|
+
### Enhancements
|
7
|
+
|
8
|
+
- Added endpoint for updating existing users: `InfinumId::Api::WebhooksController#update_resource_callback` [\#15](https://github.com/infinum/rails-infinum-id-engine/pull/15)
|
9
|
+
|
10
|
+
|
11
|
+
## [v2.0.1](https://github.com/infinum/rails-infinum-id-engine/tree/v2.0.1) (2020-10-01)
|
12
|
+
[Full Changelog](https://github.com/infinum/rails-infinum-id-engine/compare/v2.0.0...v2.0.1)
|
13
|
+
|
14
|
+
### Bugfixes
|
15
|
+
|
16
|
+
- Fix missing provider
|
17
|
+
|
18
|
+
|
19
|
+
## [v2.0.0](https://github.com/infinum/rails-infinum-id-engine/tree/v2.0.0) (2020-09-18)
|
20
|
+
[Full Changelog](https://github.com/infinum/rails-infinum-id-engine/compare/v1.6.0...v2.0.0)
|
21
|
+
|
22
|
+
### Breaking changes / Deprecations
|
23
|
+
* [BREAKING] Removed `InfinumId::AfterResourceCreate` and `InfinumId::AfterResourceUpdate` classes.
|
24
|
+
* [BREAKING] Added `InfinumId::AfterResourceUpsert` and `InfinumId::AfterResourceIntent` classes. see [Webhooks](README.md#webhooks) for more info
|
25
|
+
* [BREAKING] Removed `/webhooks#update_resource_callback` and `/webhooks#create_resource_callback` routes.
|
26
|
+
* [BREAKING] Added `/webhook#upsert_resource_callback` route.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
infinum_id (2.
|
4
|
+
infinum_id (2.1.0)
|
5
5
|
blueprinter
|
6
6
|
bundler
|
7
7
|
devise
|
@@ -13,60 +13,77 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
actioncable (
|
17
|
-
actionpack (=
|
16
|
+
actioncable (6.1.3.2)
|
17
|
+
actionpack (= 6.1.3.2)
|
18
|
+
activesupport (= 6.1.3.2)
|
18
19
|
nio4r (~> 2.0)
|
19
20
|
websocket-driver (>= 0.6.1)
|
20
|
-
|
21
|
-
actionpack (=
|
22
|
-
|
23
|
-
|
21
|
+
actionmailbox (6.1.3.2)
|
22
|
+
actionpack (= 6.1.3.2)
|
23
|
+
activejob (= 6.1.3.2)
|
24
|
+
activerecord (= 6.1.3.2)
|
25
|
+
activestorage (= 6.1.3.2)
|
26
|
+
activesupport (= 6.1.3.2)
|
27
|
+
mail (>= 2.7.1)
|
28
|
+
actionmailer (6.1.3.2)
|
29
|
+
actionpack (= 6.1.3.2)
|
30
|
+
actionview (= 6.1.3.2)
|
31
|
+
activejob (= 6.1.3.2)
|
32
|
+
activesupport (= 6.1.3.2)
|
24
33
|
mail (~> 2.5, >= 2.5.4)
|
25
34
|
rails-dom-testing (~> 2.0)
|
26
|
-
actionpack (
|
27
|
-
actionview (=
|
28
|
-
activesupport (=
|
29
|
-
rack (~> 2.0)
|
35
|
+
actionpack (6.1.3.2)
|
36
|
+
actionview (= 6.1.3.2)
|
37
|
+
activesupport (= 6.1.3.2)
|
38
|
+
rack (~> 2.0, >= 2.0.9)
|
30
39
|
rack-test (>= 0.6.3)
|
31
40
|
rails-dom-testing (~> 2.0)
|
32
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
33
|
-
|
34
|
-
|
41
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
42
|
+
actiontext (6.1.3.2)
|
43
|
+
actionpack (= 6.1.3.2)
|
44
|
+
activerecord (= 6.1.3.2)
|
45
|
+
activestorage (= 6.1.3.2)
|
46
|
+
activesupport (= 6.1.3.2)
|
47
|
+
nokogiri (>= 1.8.5)
|
48
|
+
actionview (6.1.3.2)
|
49
|
+
activesupport (= 6.1.3.2)
|
35
50
|
builder (~> 3.1)
|
36
51
|
erubi (~> 1.4)
|
37
52
|
rails-dom-testing (~> 2.0)
|
38
|
-
rails-html-sanitizer (~> 1.
|
39
|
-
activejob (
|
40
|
-
activesupport (=
|
53
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
54
|
+
activejob (6.1.3.2)
|
55
|
+
activesupport (= 6.1.3.2)
|
41
56
|
globalid (>= 0.3.6)
|
42
|
-
activemodel (
|
43
|
-
activesupport (=
|
44
|
-
activerecord (
|
45
|
-
activemodel (=
|
46
|
-
activesupport (=
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
activerecord (=
|
51
|
-
|
52
|
-
|
57
|
+
activemodel (6.1.3.2)
|
58
|
+
activesupport (= 6.1.3.2)
|
59
|
+
activerecord (6.1.3.2)
|
60
|
+
activemodel (= 6.1.3.2)
|
61
|
+
activesupport (= 6.1.3.2)
|
62
|
+
activestorage (6.1.3.2)
|
63
|
+
actionpack (= 6.1.3.2)
|
64
|
+
activejob (= 6.1.3.2)
|
65
|
+
activerecord (= 6.1.3.2)
|
66
|
+
activesupport (= 6.1.3.2)
|
67
|
+
marcel (~> 1.0.0)
|
68
|
+
mini_mime (~> 1.0.2)
|
69
|
+
activesupport (6.1.3.2)
|
53
70
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
54
|
-
i18n (>=
|
55
|
-
minitest (
|
56
|
-
tzinfo (~>
|
71
|
+
i18n (>= 1.6, < 2)
|
72
|
+
minitest (>= 5.1)
|
73
|
+
tzinfo (~> 2.0)
|
74
|
+
zeitwerk (~> 2.3)
|
57
75
|
addressable (2.6.0)
|
58
76
|
public_suffix (>= 2.0.2, < 4.0)
|
59
|
-
arel (9.0.0)
|
60
77
|
bcrypt (3.1.16)
|
61
|
-
blueprinter (0.25.
|
62
|
-
builder (3.2.
|
78
|
+
blueprinter (0.25.3)
|
79
|
+
builder (3.2.4)
|
63
80
|
byebug (10.0.2)
|
64
81
|
coderay (1.1.2)
|
65
|
-
concurrent-ruby (1.1.
|
82
|
+
concurrent-ruby (1.1.8)
|
66
83
|
crack (0.4.3)
|
67
84
|
safe_yaml (~> 1.0.0)
|
68
|
-
crass (1.0.
|
69
|
-
devise (4.
|
85
|
+
crass (1.0.6)
|
86
|
+
devise (4.8.0)
|
70
87
|
bcrypt (~> 3.0)
|
71
88
|
orm_adapter (~> 0.1)
|
72
89
|
railties (>= 4.1.0)
|
@@ -76,14 +93,12 @@ GEM
|
|
76
93
|
docile (1.3.1)
|
77
94
|
domain_name (0.5.20190701)
|
78
95
|
unf (>= 0.0.5, < 1.0.0)
|
79
|
-
dry-configurable (0.
|
96
|
+
dry-configurable (0.12.1)
|
80
97
|
concurrent-ruby (~> 1.0)
|
81
|
-
dry-core (~> 0.
|
82
|
-
|
83
|
-
dry-core (0.4.9)
|
98
|
+
dry-core (~> 0.5, >= 0.5.0)
|
99
|
+
dry-core (0.5.0)
|
84
100
|
concurrent-ruby (~> 1.0)
|
85
|
-
|
86
|
-
erubi (1.8.0)
|
101
|
+
erubi (1.10.0)
|
87
102
|
factory_bot (5.0.0)
|
88
103
|
activesupport (>= 4.2.0)
|
89
104
|
factory_bot_rails (5.0.0)
|
@@ -91,9 +106,20 @@ GEM
|
|
91
106
|
railties (>= 4.2.0)
|
92
107
|
faker (1.9.1)
|
93
108
|
i18n (>= 0.7)
|
94
|
-
faraday (1.
|
109
|
+
faraday (1.4.2)
|
110
|
+
faraday-em_http (~> 1.0)
|
111
|
+
faraday-em_synchrony (~> 1.0)
|
112
|
+
faraday-excon (~> 1.1)
|
113
|
+
faraday-net_http (~> 1.0)
|
114
|
+
faraday-net_http_persistent (~> 1.1)
|
95
115
|
multipart-post (>= 1.2, < 3)
|
96
|
-
|
116
|
+
ruby2_keywords (>= 0.0.4)
|
117
|
+
faraday-em_http (1.0.0)
|
118
|
+
faraday-em_synchrony (1.0.0)
|
119
|
+
faraday-excon (1.1.0)
|
120
|
+
faraday-net_http (1.0.1)
|
121
|
+
faraday-net_http_persistent (1.1.0)
|
122
|
+
ffi (1.15.1)
|
97
123
|
ffi-compiler (1.0.1)
|
98
124
|
ffi (>= 1.0.0)
|
99
125
|
rake
|
@@ -109,44 +135,44 @@ GEM
|
|
109
135
|
http-cookie (1.0.3)
|
110
136
|
domain_name (~> 0.5)
|
111
137
|
http-form_data (2.3.0)
|
112
|
-
http-parser (1.2.
|
138
|
+
http-parser (1.2.3)
|
113
139
|
ffi-compiler (>= 1.0, < 2.0)
|
114
|
-
i18n (1.
|
140
|
+
i18n (1.8.10)
|
115
141
|
concurrent-ruby (~> 1.0)
|
116
142
|
json (2.1.0)
|
117
|
-
jwt (2.2.
|
118
|
-
loofah (2.
|
143
|
+
jwt (2.2.3)
|
144
|
+
loofah (2.9.1)
|
119
145
|
crass (~> 1.0.2)
|
120
146
|
nokogiri (>= 1.5.9)
|
121
147
|
mail (2.7.1)
|
122
148
|
mini_mime (>= 0.1.1)
|
123
|
-
marcel (0.
|
124
|
-
mimemagic (~> 0.3.2)
|
149
|
+
marcel (1.0.1)
|
125
150
|
method_source (0.9.2)
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
minitest (5.11.3)
|
151
|
+
mini_mime (1.0.3)
|
152
|
+
mini_portile2 (2.5.1)
|
153
|
+
minitest (5.14.4)
|
130
154
|
multi_json (1.15.0)
|
131
155
|
multi_xml (0.6.0)
|
132
156
|
multipart-post (2.1.1)
|
133
|
-
nio4r (2.
|
134
|
-
nokogiri (1.
|
135
|
-
mini_portile2 (~> 2.
|
136
|
-
|
157
|
+
nio4r (2.5.7)
|
158
|
+
nokogiri (1.11.5)
|
159
|
+
mini_portile2 (~> 2.5.0)
|
160
|
+
racc (~> 1.4)
|
161
|
+
oauth2 (1.4.7)
|
137
162
|
faraday (>= 0.8, < 2.0)
|
138
163
|
jwt (>= 1.0, < 3.0)
|
139
164
|
multi_json (~> 1.3)
|
140
165
|
multi_xml (~> 0.5)
|
141
166
|
rack (>= 1.2, < 3)
|
142
|
-
omniauth (
|
167
|
+
omniauth (2.0.4)
|
143
168
|
hashie (>= 3.4.6)
|
144
169
|
rack (>= 1.6.2, < 3)
|
170
|
+
rack-protection
|
145
171
|
omniauth-infinum_id (1.2.1)
|
146
172
|
omniauth-oauth2
|
147
|
-
omniauth-oauth2 (1.7.
|
173
|
+
omniauth-oauth2 (1.7.1)
|
148
174
|
oauth2 (~> 1.4)
|
149
|
-
omniauth (
|
175
|
+
omniauth (>= 1.9, < 3)
|
150
176
|
orm_adapter (0.5.0)
|
151
177
|
pry (0.12.2)
|
152
178
|
coderay (~> 1.1.0)
|
@@ -157,33 +183,38 @@ GEM
|
|
157
183
|
pry-rails (0.3.9)
|
158
184
|
pry (>= 0.10.4)
|
159
185
|
public_suffix (3.0.3)
|
186
|
+
racc (1.5.2)
|
160
187
|
rack (2.2.3)
|
188
|
+
rack-protection (2.1.0)
|
189
|
+
rack
|
161
190
|
rack-test (1.1.0)
|
162
191
|
rack (>= 1.0, < 3)
|
163
|
-
rails (
|
164
|
-
actioncable (=
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
192
|
+
rails (6.1.3.2)
|
193
|
+
actioncable (= 6.1.3.2)
|
194
|
+
actionmailbox (= 6.1.3.2)
|
195
|
+
actionmailer (= 6.1.3.2)
|
196
|
+
actionpack (= 6.1.3.2)
|
197
|
+
actiontext (= 6.1.3.2)
|
198
|
+
actionview (= 6.1.3.2)
|
199
|
+
activejob (= 6.1.3.2)
|
200
|
+
activemodel (= 6.1.3.2)
|
201
|
+
activerecord (= 6.1.3.2)
|
202
|
+
activestorage (= 6.1.3.2)
|
203
|
+
activesupport (= 6.1.3.2)
|
204
|
+
bundler (>= 1.15.0)
|
205
|
+
railties (= 6.1.3.2)
|
175
206
|
sprockets-rails (>= 2.0.0)
|
176
207
|
rails-dom-testing (2.0.3)
|
177
208
|
activesupport (>= 4.2.0)
|
178
209
|
nokogiri (>= 1.6)
|
179
|
-
rails-html-sanitizer (1.0
|
180
|
-
loofah (~> 2.
|
181
|
-
railties (
|
182
|
-
actionpack (=
|
183
|
-
activesupport (=
|
210
|
+
rails-html-sanitizer (1.3.0)
|
211
|
+
loofah (~> 2.3)
|
212
|
+
railties (6.1.3.2)
|
213
|
+
actionpack (= 6.1.3.2)
|
214
|
+
activesupport (= 6.1.3.2)
|
184
215
|
method_source
|
185
216
|
rake (>= 0.8.7)
|
186
|
-
thor (
|
217
|
+
thor (~> 1.0)
|
187
218
|
rake (10.5.0)
|
188
219
|
responders (3.0.1)
|
189
220
|
actionpack (>= 5.0)
|
@@ -209,24 +240,24 @@ GEM
|
|
209
240
|
rspec-mocks (~> 3.8.0)
|
210
241
|
rspec-support (~> 3.8.0)
|
211
242
|
rspec-support (3.8.0)
|
243
|
+
ruby2_keywords (0.0.4)
|
212
244
|
safe_yaml (1.0.4)
|
213
245
|
simplecov (0.16.1)
|
214
246
|
docile (~> 1.1)
|
215
247
|
json (>= 1.8, < 3)
|
216
248
|
simplecov-html (~> 0.10.0)
|
217
249
|
simplecov-html (0.10.2)
|
218
|
-
sprockets (
|
250
|
+
sprockets (4.0.2)
|
219
251
|
concurrent-ruby (~> 1.0)
|
220
252
|
rack (> 1, < 3)
|
221
|
-
sprockets-rails (3.2.
|
253
|
+
sprockets-rails (3.2.2)
|
222
254
|
actionpack (>= 4.0)
|
223
255
|
activesupport (>= 4.0)
|
224
256
|
sprockets (>= 3.0.0)
|
225
257
|
sqlite3 (1.3.13)
|
226
|
-
thor (
|
227
|
-
|
228
|
-
|
229
|
-
thread_safe (~> 0.1)
|
258
|
+
thor (1.1.0)
|
259
|
+
tzinfo (2.0.4)
|
260
|
+
concurrent-ruby (~> 1.0)
|
230
261
|
unf (0.1.4)
|
231
262
|
unf_ext
|
232
263
|
unf_ext (0.0.7.7)
|
@@ -236,9 +267,10 @@ GEM
|
|
236
267
|
addressable (>= 2.3.6)
|
237
268
|
crack (>= 0.3.2)
|
238
269
|
hashdiff
|
239
|
-
websocket-driver (0.7.
|
270
|
+
websocket-driver (0.7.4)
|
240
271
|
websocket-extensions (>= 0.1.0)
|
241
|
-
websocket-extensions (0.1.
|
272
|
+
websocket-extensions (0.1.5)
|
273
|
+
zeitwerk (2.4.2)
|
242
274
|
|
243
275
|
PLATFORMS
|
244
276
|
ruby
|
@@ -9,10 +9,22 @@ module InfinumId
|
|
9
9
|
render json: { resource_name.underscore => 'updated' }
|
10
10
|
end
|
11
11
|
|
12
|
+
def update_resource_callback
|
13
|
+
return head :not_found if resource.blank?
|
14
|
+
|
15
|
+
intent, resource = update
|
16
|
+
|
17
|
+
InfinumId::AfterResourceUpsert.call(resource, params[:user], intent)
|
18
|
+
|
19
|
+
render json: { resource_name.underscore => 'updated' }
|
20
|
+
end
|
21
|
+
|
12
22
|
private
|
13
23
|
|
14
24
|
def user_params
|
15
|
-
params.require(:user)
|
25
|
+
params.require(:user)
|
26
|
+
.permit(InfinumId.resource_attributes)
|
27
|
+
.merge(provider: params[:provider])
|
16
28
|
end
|
17
29
|
|
18
30
|
def resource
|
@@ -21,12 +33,17 @@ module InfinumId
|
|
21
33
|
resource_class.find_by(email: user_params[:email])
|
22
34
|
end
|
23
35
|
|
36
|
+
def update
|
37
|
+
resource.update(user_params)
|
38
|
+
[InfinumId::AfterResourceIntent::UPDATE, resource]
|
39
|
+
end
|
40
|
+
|
24
41
|
def upsert
|
25
42
|
if resource
|
26
43
|
resource.update(user_params)
|
27
44
|
[InfinumId::AfterResourceIntent::UPDATE, resource]
|
28
45
|
else
|
29
|
-
@resource = resource_class.create(user_params
|
46
|
+
@resource = resource_class.create(user_params)
|
30
47
|
|
31
48
|
[InfinumId::AfterResourceIntent::CREATE, resource]
|
32
49
|
end
|
data/config/routes.rb
CHANGED
data/lib/infinum_id/version.rb
CHANGED
data/lib/infinum_id.rb
CHANGED
@@ -10,12 +10,12 @@ module InfinumId
|
|
10
10
|
extend Dry::Configurable
|
11
11
|
|
12
12
|
setting :service_name, reader: true
|
13
|
-
setting :resource_name, 'User', reader: true
|
14
|
-
setting :infinum_id_send_email, false, reader: true
|
15
|
-
setting :send_invite_request, true, reader: true
|
13
|
+
setting :resource_name, default: 'User', reader: true
|
14
|
+
setting :infinum_id_send_email, default: false, reader: true
|
15
|
+
setting :send_invite_request, default: true, reader: true
|
16
16
|
|
17
17
|
setting :resource_attributes,
|
18
|
-
[:uid, :email, :first_name, :last_name, :deactivated_at, :employee],
|
18
|
+
default: [:uid, :email, :first_name, :last_name, :deactivated_at, :employee],
|
19
19
|
reader: true
|
20
20
|
|
21
21
|
def self.resource_class
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infinum_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dajana Jeroncic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -301,7 +301,7 @@ files:
|
|
301
301
|
- ".rspec"
|
302
302
|
- ".rubocop.yml"
|
303
303
|
- ".travis.yml"
|
304
|
-
-
|
304
|
+
- CHANGELOG.md
|
305
305
|
- CODE_OF_CONDUCT.md
|
306
306
|
- Gemfile
|
307
307
|
- Gemfile.lock
|
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
359
|
- !ruby/object:Gem::Version
|
360
360
|
version: '0'
|
361
361
|
requirements: []
|
362
|
-
rubygems_version: 3.
|
362
|
+
rubygems_version: 3.2.15
|
363
363
|
signing_key:
|
364
364
|
specification_version: 4
|
365
365
|
summary: Write a short summary, because RubyGems requires one.
|
data/CHANGES.md
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
## Version 2.0.0
|
4
|
-
|
5
|
-
Released of September 18, 2020
|
6
|
-
|
7
|
-
Changes:
|
8
|
-
* [BREAKING] Removed `InfinumId::AfterResourceCreate` and `InfinumId::AfterResourceUpdate` classes.
|
9
|
-
* [BREAKING] Added `InfinumId::AfterResourceUpsert` and `InfinumId::AfterResourceIntent` classes. see [Webhooks](README.md#webhooks) for more info
|
10
|
-
* [BREAKING] Removed `/webhooks#update_resource_callback` and `/webhooks#create_resource_callback` routes.
|
11
|
-
* [BREAKING] Added `/webhook#upsert_resource_callback` route.
|