auther 10.2.3 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +1 -1
- data/app/controllers/auther/base_controller.rb +4 -4
- data/lib/auther/authenticator.rb +1 -1
- data/lib/auther/gatekeeper.rb +2 -2
- data/lib/auther/identity.rb +1 -1
- data/lib/auther/settings.rb +9 -17
- metadata +28 -84
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7476f193b2514e72002c4637534079a4776ed6f3abd28cd928408cc5337d6e7
|
4
|
+
data.tar.gz: c5026a4e56f4c8e6b96bffd9121b4d9abd8260b19d223798bf79ff317ca99b5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbe42011d986d0d08d58c9b20c3ed4120eb555c742ad628ec52d946460ceb20c5944e2959d8944f61b900ef57898bf1f3c1f2310c04cb2b5bfff02679b37b5c1
|
7
|
+
data.tar.gz: c4fa83abc4c51680f38fa5b525114fda4c96ecc92acd139dd1b8c4dfc394fdccc9672a6532c0455d4f0f7e26190e9c1e52c6b49695c6b0be7f79d2e6539c9c26
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -145,7 +145,7 @@ The initializer can be customized as follows:
|
|
145
145
|
logout). Deauthorized redirections works as follows (in the order defined):
|
146
146
|
- The deauthorized URL (if defined).
|
147
147
|
- The auth URL.
|
148
|
-
- *
|
148
|
+
- *url* - Optional. The URL to redirect to when enforcing authentication. Default: “/login”.
|
149
149
|
- *logger* - Optional. The logger used to log path/account authorization messages. Default:
|
150
150
|
`Auther::NullLogger`.
|
151
151
|
|
@@ -6,7 +6,7 @@ module Auther
|
|
6
6
|
protect_from_forgery with: :exception
|
7
7
|
|
8
8
|
def show
|
9
|
-
redirect_to settings.
|
9
|
+
redirect_to settings.url
|
10
10
|
end
|
11
11
|
|
12
12
|
def new
|
@@ -15,7 +15,7 @@ module Auther
|
|
15
15
|
|
16
16
|
# rubocop:disable Metrics/AbcSize
|
17
17
|
def create
|
18
|
-
@account = Auther::Presenter::Account.new
|
18
|
+
@account = Auther::Presenter::Account.new(**account_params.to_h.symbolize_keys)
|
19
19
|
account = Auther::Account[settings.find_account(@account.name)]
|
20
20
|
authenticator = Auther::Authenticator.new settings.secret, account, @account
|
21
21
|
|
@@ -30,7 +30,7 @@ module Auther
|
|
30
30
|
# rubocop:enable Metrics/AbcSize
|
31
31
|
|
32
32
|
def destroy
|
33
|
-
account = Auther::Account[settings.find_account(params[:name])]
|
33
|
+
account = Auther::Account[**settings.find_account(params[:name])]
|
34
34
|
remove_credentials account
|
35
35
|
redirect_to deauthorized_url(account)
|
36
36
|
end
|
@@ -69,7 +69,7 @@ module Auther
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def deauthorized_url account
|
72
|
-
account.deauthorized_url || settings.
|
72
|
+
account.deauthorized_url || settings.url
|
73
73
|
end
|
74
74
|
|
75
75
|
def store_credentials account
|
data/lib/auther/authenticator.rb
CHANGED
@@ -36,7 +36,7 @@ module Auther
|
|
36
36
|
account_presenter.errors.add error_name, "is invalid"
|
37
37
|
false
|
38
38
|
end
|
39
|
-
rescue ActiveSupport::
|
39
|
+
rescue ActiveSupport::MessageEncryptor::InvalidMessage
|
40
40
|
log_info %(Authentication failed! Invalid credential(s) for "#{account_model.name}" account.)
|
41
41
|
false
|
42
42
|
end
|
data/lib/auther/gatekeeper.rb
CHANGED
@@ -21,7 +21,7 @@ module Auther
|
|
21
21
|
else
|
22
22
|
session[Auther::Keymaster.redirect_url_key] = request.path
|
23
23
|
denied_response = response
|
24
|
-
denied_response.redirect settings.
|
24
|
+
denied_response.redirect settings.url
|
25
25
|
denied_response.finish
|
26
26
|
end
|
27
27
|
end
|
@@ -108,7 +108,7 @@ module Auther
|
|
108
108
|
authenticated = account_authenticated? account
|
109
109
|
log_authentication authenticated, account.fetch(:name)
|
110
110
|
authenticated
|
111
|
-
rescue ActiveSupport::
|
111
|
+
rescue ActiveSupport::MessageEncryptor::InvalidMessage
|
112
112
|
log_info %(Authentication failed! Invalid credential(s) for "#{account.fetch :name}" account.)
|
113
113
|
false
|
114
114
|
end
|
data/lib/auther/identity.rb
CHANGED
data/lib/auther/settings.rb
CHANGED
@@ -2,25 +2,17 @@
|
|
2
2
|
|
3
3
|
module Auther
|
4
4
|
# Represents Auther settings.
|
5
|
-
|
6
|
-
|
5
|
+
Settings = Struct.new :title, :label, :secret, :accounts, :url, :logger, keyword_init: true do
|
6
|
+
def initialize *arguments
|
7
|
+
super
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
logger: Auther::NullLogger.new(STDOUT)
|
15
|
-
|
16
|
-
@title = title
|
17
|
-
@label = label
|
18
|
-
@secret = secret
|
19
|
-
@accounts = accounts
|
20
|
-
@auth_url = auth_url
|
21
|
-
@logger = logger
|
9
|
+
self[:title] ||= "Authorization"
|
10
|
+
self[:label] ||= "Authorization"
|
11
|
+
self[:secret] ||= ""
|
12
|
+
self[:accounts] ||= []
|
13
|
+
self[:url] ||= "/login"
|
14
|
+
self[:logger] ||= Auther::NullLogger.new STDOUT
|
22
15
|
end
|
23
|
-
# rubocop:enable Metrics/ParameterLists
|
24
16
|
|
25
17
|
def find_account name
|
26
18
|
accounts.find { |account| account.fetch(:name) == name }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auther
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
|
29
29
|
y84=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
31
|
+
date: 2020-01-01 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rails
|
@@ -36,42 +36,42 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '6.0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '6.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sass-rails
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '6.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '6.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: slim-rails
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '3.
|
67
|
+
version: '3.2'
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '3.
|
74
|
+
version: '3.2'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: ammeter
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,34 +86,6 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '1.1'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: awesome_print
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '1.8'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '1.8'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: bond
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0.5'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '0.5'
|
117
89
|
- !ruby/object:Gem::Dependency
|
118
90
|
name: bundler-audit
|
119
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,28 +106,28 @@ dependencies:
|
|
134
106
|
requirements:
|
135
107
|
- - "~>"
|
136
108
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
109
|
+
version: '14.0'
|
138
110
|
type: :development
|
139
111
|
prerelease: false
|
140
112
|
version_requirements: !ruby/object:Gem::Requirement
|
141
113
|
requirements:
|
142
114
|
- - "~>"
|
143
115
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
116
|
+
version: '14.0'
|
145
117
|
- !ruby/object:Gem::Dependency
|
146
118
|
name: git-cop
|
147
119
|
requirement: !ruby/object:Gem::Requirement
|
148
120
|
requirements:
|
149
121
|
- - "~>"
|
150
122
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
123
|
+
version: '4.0'
|
152
124
|
type: :development
|
153
125
|
prerelease: false
|
154
126
|
version_requirements: !ruby/object:Gem::Requirement
|
155
127
|
requirements:
|
156
128
|
- - "~>"
|
157
129
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
130
|
+
version: '4.0'
|
159
131
|
- !ruby/object:Gem::Dependency
|
160
132
|
name: guard-rspec
|
161
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,34 +142,20 @@ dependencies:
|
|
170
142
|
- - "~>"
|
171
143
|
- !ruby/object:Gem::Version
|
172
144
|
version: '4.7'
|
173
|
-
- !ruby/object:Gem::Dependency
|
174
|
-
name: hirb
|
175
|
-
requirement: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '0.7'
|
180
|
-
type: :development
|
181
|
-
prerelease: false
|
182
|
-
version_requirements: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '0.7'
|
187
145
|
- !ruby/object:Gem::Dependency
|
188
146
|
name: pg
|
189
147
|
requirement: !ruby/object:Gem::Requirement
|
190
148
|
requirements:
|
191
149
|
- - "~>"
|
192
150
|
- !ruby/object:Gem::Version
|
193
|
-
version: '1.
|
151
|
+
version: '1.2'
|
194
152
|
type: :development
|
195
153
|
prerelease: false
|
196
154
|
version_requirements: !ruby/object:Gem::Requirement
|
197
155
|
requirements:
|
198
156
|
- - "~>"
|
199
157
|
- !ruby/object:Gem::Version
|
200
|
-
version: '1.
|
158
|
+
version: '1.2'
|
201
159
|
- !ruby/object:Gem::Dependency
|
202
160
|
name: pry
|
203
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,14 +176,14 @@ dependencies:
|
|
218
176
|
requirements:
|
219
177
|
- - "~>"
|
220
178
|
- !ruby/object:Gem::Version
|
221
|
-
version: '3.
|
179
|
+
version: '3.7'
|
222
180
|
type: :development
|
223
181
|
prerelease: false
|
224
182
|
version_requirements: !ruby/object:Gem::Requirement
|
225
183
|
requirements:
|
226
184
|
- - "~>"
|
227
185
|
- !ruby/object:Gem::Version
|
228
|
-
version: '3.
|
186
|
+
version: '3.7'
|
229
187
|
- !ruby/object:Gem::Dependency
|
230
188
|
name: rake
|
231
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -274,84 +232,70 @@ dependencies:
|
|
274
232
|
requirements:
|
275
233
|
- - "~>"
|
276
234
|
- !ruby/object:Gem::Version
|
277
|
-
version: '0.
|
235
|
+
version: '0.78'
|
278
236
|
type: :development
|
279
237
|
prerelease: false
|
280
238
|
version_requirements: !ruby/object:Gem::Requirement
|
281
239
|
requirements:
|
282
240
|
- - "~>"
|
283
241
|
- !ruby/object:Gem::Version
|
284
|
-
version: '0.
|
242
|
+
version: '0.78'
|
285
243
|
- !ruby/object:Gem::Dependency
|
286
244
|
name: rubocop-performance
|
287
245
|
requirement: !ruby/object:Gem::Requirement
|
288
246
|
requirements:
|
289
247
|
- - "~>"
|
290
248
|
- !ruby/object:Gem::Version
|
291
|
-
version: '1.
|
249
|
+
version: '1.5'
|
292
250
|
type: :development
|
293
251
|
prerelease: false
|
294
252
|
version_requirements: !ruby/object:Gem::Requirement
|
295
253
|
requirements:
|
296
254
|
- - "~>"
|
297
255
|
- !ruby/object:Gem::Version
|
298
|
-
version: '1.
|
256
|
+
version: '1.5'
|
299
257
|
- !ruby/object:Gem::Dependency
|
300
258
|
name: rubocop-rake
|
301
259
|
requirement: !ruby/object:Gem::Requirement
|
302
260
|
requirements:
|
303
261
|
- - "~>"
|
304
262
|
- !ruby/object:Gem::Version
|
305
|
-
version: '0.
|
263
|
+
version: '0.5'
|
306
264
|
type: :development
|
307
265
|
prerelease: false
|
308
266
|
version_requirements: !ruby/object:Gem::Requirement
|
309
267
|
requirements:
|
310
268
|
- - "~>"
|
311
269
|
- !ruby/object:Gem::Version
|
312
|
-
version: '0.
|
270
|
+
version: '0.5'
|
313
271
|
- !ruby/object:Gem::Dependency
|
314
272
|
name: rubocop-rspec
|
315
273
|
requirement: !ruby/object:Gem::Requirement
|
316
274
|
requirements:
|
317
275
|
- - "~>"
|
318
276
|
- !ruby/object:Gem::Version
|
319
|
-
version: '1.
|
277
|
+
version: '1.37'
|
320
278
|
type: :development
|
321
279
|
prerelease: false
|
322
280
|
version_requirements: !ruby/object:Gem::Requirement
|
323
281
|
requirements:
|
324
282
|
- - "~>"
|
325
283
|
- !ruby/object:Gem::Version
|
326
|
-
version: '1.
|
284
|
+
version: '1.37'
|
327
285
|
- !ruby/object:Gem::Dependency
|
328
286
|
name: simplecov
|
329
287
|
requirement: !ruby/object:Gem::Requirement
|
330
288
|
requirements:
|
331
289
|
- - "~>"
|
332
290
|
- !ruby/object:Gem::Version
|
333
|
-
version: '0.
|
334
|
-
type: :development
|
335
|
-
prerelease: false
|
336
|
-
version_requirements: !ruby/object:Gem::Requirement
|
337
|
-
requirements:
|
338
|
-
- - "~>"
|
339
|
-
- !ruby/object:Gem::Version
|
340
|
-
version: '0.13'
|
341
|
-
- !ruby/object:Gem::Dependency
|
342
|
-
name: wirb
|
343
|
-
requirement: !ruby/object:Gem::Requirement
|
344
|
-
requirements:
|
345
|
-
- - "~>"
|
346
|
-
- !ruby/object:Gem::Version
|
347
|
-
version: '2.1'
|
291
|
+
version: '0.17'
|
348
292
|
type: :development
|
349
293
|
prerelease: false
|
350
294
|
version_requirements: !ruby/object:Gem::Requirement
|
351
295
|
requirements:
|
352
296
|
- - "~>"
|
353
297
|
- !ruby/object:Gem::Version
|
354
|
-
version: '
|
298
|
+
version: '0.17'
|
355
299
|
description:
|
356
300
|
email:
|
357
301
|
- brooke@alchemists.io
|
@@ -399,14 +343,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
399
343
|
requirements:
|
400
344
|
- - "~>"
|
401
345
|
- !ruby/object:Gem::Version
|
402
|
-
version: '2.
|
346
|
+
version: '2.7'
|
403
347
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
404
348
|
requirements:
|
405
349
|
- - ">="
|
406
350
|
- !ruby/object:Gem::Version
|
407
351
|
version: '0'
|
408
352
|
requirements: []
|
409
|
-
rubygems_version: 3.
|
353
|
+
rubygems_version: 3.1.2
|
410
354
|
signing_key:
|
411
355
|
specification_version: 4
|
412
356
|
summary: Enhances Rails with multi-account, form-based, database-less, application-wide
|
metadata.gz.sig
CHANGED
Binary file
|