rodauth-oauth 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/generators/{roda → rodauth}/oauth/install_generator.rb +0 -0
- data/lib/generators/{roda → rodauth}/oauth/templates/app/models/oauth_application.rb +0 -0
- data/lib/generators/{roda → rodauth}/oauth/templates/app/models/oauth_grant.rb +0 -0
- data/lib/generators/{roda → rodauth}/oauth/templates/app/models/oauth_token.rb +0 -0
- data/lib/generators/{roda → rodauth}/oauth/templates/db/migrate/create_rodauth_oauth.rb +1 -1
- data/lib/generators/{roda → rodauth}/oauth/views_generator.rb +0 -0
- data/lib/rodauth/features/oauth.rb +24 -7
- data/lib/rodauth/features/oauth_jwt.rb +9 -0
- data/lib/rodauth/features/oidc.rb +9 -0
- data/lib/rodauth/oauth/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 366fa7201a8cb26525b2abdfab0c4108a4afbef4fa8697cf57e874919eda2afd
|
4
|
+
data.tar.gz: 958b9fd8b4cd2996a85b96fac6dff6a6b35832adcdaed4d81e20842041a1299e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb496f7d438c0447ba4ef899f9ec37549cea355fb5c670818cd040970c1316c13442caa58aebc4ea66cd92f2f369d6ff7c39b502190e2d4fec2f95d5e27b4279
|
7
|
+
data.tar.gz: 73048d860285b29056ade97d9092103e2cae18fa9967df603ddce9c83c10fd5c44891e7282f3195d0b79b2d73bf12c748483a811f404d50fb29df40da26a6bf4
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
### 0.5.1 (19/03/2021)
|
6
|
+
|
7
|
+
#### Improvements
|
8
|
+
|
9
|
+
* Changing "Callback URL" to "Redirect URL" in default templates;
|
10
|
+
|
11
|
+
#### Bugfixes
|
12
|
+
|
13
|
+
* (rails integration) Fixed templates location;
|
14
|
+
* (rails integration) Fixed migration name from generator;
|
15
|
+
* (rails integration) fixed links, html tags, styling and unassigned variables from a few view templates;
|
16
|
+
* `oauth_application_path` is now compliant with prefixes and other url helpers, while now having a `oauth_application_url` counterpart;
|
17
|
+
* (rails integration) skipping csrf checks for "/userinfo" request (OIDC)
|
18
|
+
|
5
19
|
### 0.5.0 (08/02/2021)
|
6
20
|
|
7
21
|
#### RP-Initiated Logout
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -139,7 +139,15 @@ module Rodauth
|
|
139
139
|
auth_value_method :already_in_use_response_status, 409
|
140
140
|
|
141
141
|
# OAuth Applications
|
142
|
-
auth_value_method :
|
142
|
+
auth_value_method :oauth_applications_route, "oauth-applications"
|
143
|
+
def oauth_applications_path(opts = {})
|
144
|
+
route_path(oauth_applications_route, opts)
|
145
|
+
end
|
146
|
+
|
147
|
+
def oauth_applications_url(opts = {})
|
148
|
+
route_url(oauth_applications_route, opts)
|
149
|
+
end
|
150
|
+
|
143
151
|
auth_value_method :oauth_applications_table, :oauth_applications
|
144
152
|
|
145
153
|
auth_value_method :oauth_applications_id_column, :id
|
@@ -192,6 +200,7 @@ module Rodauth
|
|
192
200
|
auth_value_method :oauth_unique_id_generation_retries, 3
|
193
201
|
|
194
202
|
auth_value_methods(
|
203
|
+
:oauth_application_path,
|
195
204
|
:fetch_access_token,
|
196
205
|
:oauth_unique_id_generator,
|
197
206
|
:secret_matches?,
|
@@ -363,9 +372,13 @@ module Rodauth
|
|
363
372
|
end
|
364
373
|
end
|
365
374
|
|
375
|
+
def oauth_application_path(id)
|
376
|
+
"#{oauth_applications_path}/#{id}"
|
377
|
+
end
|
378
|
+
|
366
379
|
# /oauth-applications routes
|
367
380
|
def oauth_applications
|
368
|
-
request.on(
|
381
|
+
request.on(oauth_applications_route) do
|
369
382
|
require_account
|
370
383
|
|
371
384
|
request.get "new" do
|
@@ -422,16 +435,20 @@ module Rodauth
|
|
422
435
|
false
|
423
436
|
when revoke_path
|
424
437
|
!json_request?
|
425
|
-
when authorize_path,
|
438
|
+
when authorize_path, oauth_applications_path
|
426
439
|
only_json? ? false : super
|
427
440
|
else
|
428
441
|
super
|
429
442
|
end
|
430
443
|
end
|
431
444
|
|
432
|
-
# Overrides
|
433
|
-
def
|
434
|
-
super ||
|
445
|
+
# Overrides session_value, so that a valid authorization token also authenticates a request
|
446
|
+
def session_value
|
447
|
+
super || begin
|
448
|
+
return unless authorization_token
|
449
|
+
|
450
|
+
authorization_token[oauth_tokens_account_id_column]
|
451
|
+
end
|
435
452
|
end
|
436
453
|
|
437
454
|
def accepts_json?
|
@@ -1350,7 +1367,7 @@ module Rodauth
|
|
1350
1367
|
issuer: issuer,
|
1351
1368
|
authorization_endpoint: authorize_url,
|
1352
1369
|
token_endpoint: token_url,
|
1353
|
-
registration_endpoint:
|
1370
|
+
registration_endpoint: oauth_applications_url,
|
1354
1371
|
scopes_supported: oauth_application_scopes,
|
1355
1372
|
response_types_supported: responses_supported,
|
1356
1373
|
response_modes_supported: response_modes_supported,
|
@@ -62,6 +62,15 @@ module Rodauth
|
|
62
62
|
authorization_required unless scopes.any? { |scope| token_scopes.include?(scope) }
|
63
63
|
end
|
64
64
|
|
65
|
+
# Overrides session_value, so that a valid authorization token also authenticates a request
|
66
|
+
def session_value
|
67
|
+
super || begin
|
68
|
+
return unless authorization_token
|
69
|
+
|
70
|
+
authorization_token["sub"]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
65
74
|
private
|
66
75
|
|
67
76
|
unless method_defined?(:last_account_login_at)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodauth-oauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Implementation of the OAuth 2.0 protocol on top of rodauth.
|
14
14
|
email:
|
@@ -23,12 +23,12 @@ files:
|
|
23
23
|
- CHANGELOG.md
|
24
24
|
- LICENSE.txt
|
25
25
|
- README.md
|
26
|
-
- lib/generators/
|
27
|
-
- lib/generators/
|
28
|
-
- lib/generators/
|
29
|
-
- lib/generators/
|
30
|
-
- lib/generators/
|
31
|
-
- lib/generators/
|
26
|
+
- lib/generators/rodauth/oauth/install_generator.rb
|
27
|
+
- lib/generators/rodauth/oauth/templates/app/models/oauth_application.rb
|
28
|
+
- lib/generators/rodauth/oauth/templates/app/models/oauth_grant.rb
|
29
|
+
- lib/generators/rodauth/oauth/templates/app/models/oauth_token.rb
|
30
|
+
- lib/generators/rodauth/oauth/templates/db/migrate/create_rodauth_oauth.rb
|
31
|
+
- lib/generators/rodauth/oauth/views_generator.rb
|
32
32
|
- lib/rodauth/features/oauth.rb
|
33
33
|
- lib/rodauth/features/oauth_http_mac.rb
|
34
34
|
- lib/rodauth/features/oauth_jwt.rb
|