doorkeeper 5.5.2 → 5.5.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of doorkeeper might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/README.md +13 -13
- data/app/controllers/doorkeeper/authorizations_controller.rb +1 -1
- data/app/controllers/doorkeeper/tokens_controller.rb +3 -3
- data/app/helpers/doorkeeper/dashboard_helper.rb +1 -1
- data/config/locales/en.yml +3 -0
- data/lib/doorkeeper/models/access_grant_mixin.rb +1 -1
- data/lib/doorkeeper/models/access_token_mixin.rb +1 -1
- data/lib/doorkeeper/oauth/authorization_code_request.rb +1 -1
- data/lib/doorkeeper/oauth/forbidden_token_response.rb +2 -1
- data/lib/doorkeeper/oauth/helpers/unique_token.rb +2 -2
- data/lib/doorkeeper/oauth/helpers/uri_checker.rb +1 -1
- data/lib/doorkeeper/oauth/password_access_token_request.rb +1 -1
- data/lib/doorkeeper/oauth/refresh_token_request.rb +1 -1
- data/lib/doorkeeper/oauth/token_introspection.rb +3 -3
- data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +1 -0
- data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +1 -0
- data/lib/doorkeeper/orm/active_record/mixins/application.rb +1 -0
- data/lib/doorkeeper/version.rb +1 -1
- data/lib/generators/doorkeeper/templates/initializer.rb +4 -4
- data/lib/generators/doorkeeper/templates/migration.rb.erb +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: 55c17555b9591b1a06b8164b0508ab733df8dca59e4b555e1dac3b3cc7a1112e
|
4
|
+
data.tar.gz: 56fd2b8475c97f0bc755086cc22ee1aa14d2ac47263f0e218f3cf4f9f80d5b38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b21d497b70266436f0446eec977f9ff074f646c0cdf417e08c8806529474ea91d112f0f1357a614f9e136b0dd042d665f7ea7325740254770ff01469df595390
|
7
|
+
data.tar.gz: eb23ac65993cf89d82b66e5616b231d58fd0ac928486354a2bc36fdf7173fb3ba807f434f85a45f4ea6d1600847b46bdd5ad76ea9d317c16908a114b18fdb94a
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,18 @@ User-visible changes worth mentioning.
|
|
7
7
|
|
8
8
|
## main
|
9
9
|
|
10
|
-
- [#
|
10
|
+
- [#ID] Add your PR description here.
|
11
|
+
|
12
|
+
## 5.5.4
|
13
|
+
|
14
|
+
- [#1535] Revert changes introduced in #1528 to allow query params in `redirect_uri` as per the spec.
|
15
|
+
|
16
|
+
## 5.5.3
|
17
|
+
|
18
|
+
- [#1528] Don't allow extra query params in redirect_uri.
|
19
|
+
- [#1525] I18n source for forbidden token error is now `doorkeeper.errors.messages.forbidden_token.missing_scope`.
|
20
|
+
- [#1531] Disable `strict-loading` for Doorkeeper models by default.
|
21
|
+
- [#1532] Add support for Rails 7.
|
11
22
|
|
12
23
|
## 5.5.2
|
13
24
|
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Doorkeeper — awesome OAuth 2 provider for your Rails / Grape app.
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/doorkeeper.svg)](https://rubygems.org/gems/doorkeeper)
|
4
|
-
[![Build Status](https://travis-ci.
|
4
|
+
[![Build Status](https://app.travis-ci.com/doorkeeper-gem/doorkeeper.svg?branch=main)](https://app.travis-ci.com/doorkeeper-gem/doorkeeper)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/doorkeeper-gem/doorkeeper.svg)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper)
|
6
6
|
[![Coverage Status](https://coveralls.io/repos/github/doorkeeper-gem/doorkeeper/badge.svg?branch=main)](https://coveralls.io/github/doorkeeper-gem/doorkeeper?branch=main)
|
7
7
|
[![Security](https://hakiri.io/github/doorkeeper-gem/doorkeeper/main.svg)](https://hakiri.io/github/doorkeeper-gem/doorkeeper/main)
|
@@ -14,18 +14,18 @@ functionality to your Ruby on Rails or Grape application.
|
|
14
14
|
|
15
15
|
Supported features:
|
16
16
|
|
17
|
-
- [The OAuth 2.0 Authorization Framework](https://
|
18
|
-
- [Authorization Code Flow](
|
19
|
-
- [Access Token Scopes](
|
20
|
-
- [Refresh token](
|
21
|
-
- [Implicit grant](
|
22
|
-
- [Resource Owner Password Credentials](
|
23
|
-
- [Client Credentials](
|
24
|
-
- [OAuth 2.0 Token Revocation](
|
25
|
-
- [OAuth 2.0 Token Introspection](https://
|
26
|
-
- [OAuth 2.0 Threat Model and Security Considerations](
|
27
|
-
- [OAuth 2.0 for Native Apps](https://
|
28
|
-
- [Proof Key for Code Exchange by OAuth Public Clients](https://
|
17
|
+
- [The OAuth 2.0 Authorization Framework](https://datatracker.ietf.org/doc/html/rfc6749)
|
18
|
+
- [Authorization Code Flow](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1)
|
19
|
+
- [Access Token Scopes](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3)
|
20
|
+
- [Refresh token](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5)
|
21
|
+
- [Implicit grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.2)
|
22
|
+
- [Resource Owner Password Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.3)
|
23
|
+
- [Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)
|
24
|
+
- [OAuth 2.0 Token Revocation](https://datatracker.ietf.org/doc/html/rfc7009)
|
25
|
+
- [OAuth 2.0 Token Introspection](https://datatracker.ietf.org/doc/html/rfc7662)
|
26
|
+
- [OAuth 2.0 Threat Model and Security Considerations](https://datatracker.ietf.org/doc/html/rfc6819)
|
27
|
+
- [OAuth 2.0 for Native Apps](https://datatracker.ietf.org/doc/html/rfc8252)
|
28
|
+
- [Proof Key for Code Exchange by OAuth Public Clients](https://datatracker.ietf.org/doc/html/rfc7636)
|
29
29
|
|
30
30
|
## Table of Contents
|
31
31
|
|
@@ -12,7 +12,7 @@ module Doorkeeper
|
|
12
12
|
handle_token_exception(e)
|
13
13
|
end
|
14
14
|
|
15
|
-
# OAuth 2.0 Token Revocation -
|
15
|
+
# OAuth 2.0 Token Revocation - https://datatracker.ietf.org/doc/html/rfc7009
|
16
16
|
def revoke
|
17
17
|
# The authorization server responds with HTTP status code 200 if the client
|
18
18
|
# submitted an invalid token or the token has been revoked successfully.
|
@@ -94,8 +94,8 @@ module Doorkeeper
|
|
94
94
|
# types, they set the application_id as null (since the claim cannot be
|
95
95
|
# verified).
|
96
96
|
#
|
97
|
-
# https://
|
98
|
-
# https://
|
97
|
+
# https://datatracker.ietf.org/doc/html/rfc6749#section-2.1
|
98
|
+
# https://datatracker.ietf.org/doc/html/rfc7009
|
99
99
|
def authorized?
|
100
100
|
# Token belongs to specific client, so we need to check if
|
101
101
|
# authenticated client could access it.
|
data/config/locales/en.yml
CHANGED
@@ -49,7 +49,7 @@ module Doorkeeper
|
|
49
49
|
end
|
50
50
|
|
51
51
|
# Implements PKCE code_challenge encoding without base64 padding as described in the spec.
|
52
|
-
# https://
|
52
|
+
# https://datatracker.ietf.org/doc/html/rfc7636#appendix-A
|
53
53
|
# Appendix A. Notes on Implementing Base64url Encoding without Padding
|
54
54
|
#
|
55
55
|
# This appendix describes how to implement a base64url-encoding
|
@@ -279,7 +279,7 @@ module Doorkeeper
|
|
279
279
|
end
|
280
280
|
|
281
281
|
# Access Token type: Bearer.
|
282
|
-
# @see https://
|
282
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6750
|
283
283
|
# The OAuth 2.0 Authorization Framework: Bearer Token Usage
|
284
284
|
#
|
285
285
|
def token_type
|
@@ -6,7 +6,7 @@ module Doorkeeper
|
|
6
6
|
validate :params, error: :invalid_request
|
7
7
|
validate :client, error: :invalid_client
|
8
8
|
validate :grant, error: :invalid_grant
|
9
|
-
# @see https://
|
9
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
|
10
10
|
validate :redirect_uri, error: :invalid_grant
|
11
11
|
validate :code_verifier, error: :invalid_grant
|
12
12
|
|
@@ -23,7 +23,8 @@ module Doorkeeper
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def description
|
26
|
-
@description ||=
|
26
|
+
@description ||= I18n.t("doorkeeper.errors.messages.forbidden_token.missing_scope",
|
27
|
+
oauth_scopes: @scopes.map(&:to_s).join(" "),)
|
27
28
|
end
|
28
29
|
|
29
30
|
protected
|
@@ -11,8 +11,8 @@ module Doorkeeper
|
|
11
11
|
# Access Token value must be 1*VSCHAR or
|
12
12
|
# 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" ) *"="
|
13
13
|
#
|
14
|
-
# @see https://
|
15
|
-
# @see https://
|
14
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.12
|
15
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6750#section-2.1
|
16
16
|
#
|
17
17
|
generator = options.delete(:generator) || SecureRandom.method(default_generator_method)
|
18
18
|
token_size = options.delete(:size) || 32
|
@@ -28,7 +28,7 @@ module Doorkeeper
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# RFC8252, Paragraph 7.3
|
31
|
-
# @see https://
|
31
|
+
# @see https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
|
32
32
|
if loopback_uri?(url) && loopback_uri?(client_url)
|
33
33
|
url.port = nil
|
34
34
|
client_url.port = nil
|
@@ -57,7 +57,7 @@ module Doorkeeper
|
|
57
57
|
#
|
58
58
|
# o authenticate the client if client authentication is included,
|
59
59
|
#
|
60
|
-
# @see https://
|
60
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.3
|
61
61
|
#
|
62
62
|
def validate_client
|
63
63
|
if Doorkeeper.config.skip_client_authentication_for_password_grant
|
@@ -101,7 +101,7 @@ module Doorkeeper
|
|
101
101
|
client.present?
|
102
102
|
end
|
103
103
|
|
104
|
-
# @see https://
|
104
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-1.5
|
105
105
|
#
|
106
106
|
def validate_client_match
|
107
107
|
return true if refresh_token.application_id.blank?
|
@@ -4,7 +4,7 @@ module Doorkeeper
|
|
4
4
|
module OAuth
|
5
5
|
# RFC7662 OAuth 2.0 Token Introspection
|
6
6
|
#
|
7
|
-
# @see https://
|
7
|
+
# @see https://datatracker.ietf.org/doc/html/rfc7662
|
8
8
|
class TokenIntrospection
|
9
9
|
def initialize(server, token)
|
10
10
|
@server = server
|
@@ -107,7 +107,7 @@ module Doorkeeper
|
|
107
107
|
# authorization server SHOULD NOT include any additional information
|
108
108
|
# about an inactive token, including why the token is inactive.
|
109
109
|
#
|
110
|
-
# @see https://
|
110
|
+
# @see https://datatracker.ietf.org/doc/html/rfc7662 2.2. Introspection Response
|
111
111
|
#
|
112
112
|
def failure_response
|
113
113
|
{
|
@@ -186,7 +186,7 @@ module Doorkeeper
|
|
186
186
|
# Provides context (controller) and token for generating developer-specific
|
187
187
|
# response.
|
188
188
|
#
|
189
|
-
# @see https://
|
189
|
+
# @see https://datatracker.ietf.org/doc/html/rfc7662#section-2.2
|
190
190
|
#
|
191
191
|
def customize_response(response)
|
192
192
|
customized_response = Doorkeeper.config.custom_introspection_response.call(
|
data/lib/doorkeeper/version.rb
CHANGED
@@ -276,7 +276,7 @@ Doorkeeper.configure do
|
|
276
276
|
# force_ssl_in_redirect_uri { |uri| uri.host != 'localhost' }
|
277
277
|
|
278
278
|
# Specify what redirect URI's you want to block during Application creation.
|
279
|
-
# Any redirect URI is
|
279
|
+
# Any redirect URI is allowed by default.
|
280
280
|
#
|
281
281
|
# You can use this option in order to forbid URI's with 'javascript' scheme
|
282
282
|
# for example.
|
@@ -343,8 +343,8 @@ Doorkeeper.configure do
|
|
343
343
|
#
|
344
344
|
# implicit and password grant flows have risks that you should understand
|
345
345
|
# before enabling:
|
346
|
-
#
|
347
|
-
#
|
346
|
+
# https://datatracker.ietf.org/doc/html/rfc6819#section-4.4.2
|
347
|
+
# https://datatracker.ietf.org/doc/html/rfc6819#section-4.4.3
|
348
348
|
#
|
349
349
|
# grant_flows %w[authorization_code client_credentials]
|
350
350
|
|
@@ -387,7 +387,7 @@ Doorkeeper.configure do
|
|
387
387
|
# Be default all Resource Owners are authorized to any Client (application).
|
388
388
|
#
|
389
389
|
# authorize_resource_owner_for_client do |client, resource_owner|
|
390
|
-
# resource_owner.admin? || client.
|
390
|
+
# resource_owner.admin? || client.owners_allowlist.include?(resource_owner)
|
391
391
|
# end
|
392
392
|
|
393
393
|
# Hook into the strategies' request & response life-cycle in case your
|
@@ -61,7 +61,7 @@ class CreateDoorkeeperTables < ActiveRecord::Migration<%= migration_version %>
|
|
61
61
|
# *the client MUST discard the old refresh token* and replace it with the
|
62
62
|
# new refresh token. The authorization server MAY revoke the old
|
63
63
|
# refresh token after issuing a new refresh token to the client.
|
64
|
-
# @see https://
|
64
|
+
# @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
65
65
|
#
|
66
66
|
# Doorkeeper implementation: if there is a `previous_refresh_token` column,
|
67
67
|
# refresh tokens will be revoked after a related access token is used.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Elias Philipp
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-10-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|