doorkeeper 5.3.2 → 5.5.0.rc1
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 +106 -2
- data/README.md +6 -4
- data/app/controllers/doorkeeper/applications_controller.rb +4 -4
- data/app/controllers/doorkeeper/authorizations_controller.rb +32 -12
- data/app/controllers/doorkeeper/authorized_applications_controller.rb +2 -2
- data/app/controllers/doorkeeper/tokens_controller.rb +60 -20
- data/app/views/doorkeeper/applications/_form.html.erb +1 -1
- data/app/views/doorkeeper/applications/show.html.erb +19 -2
- data/config/locales/en.yml +3 -2
- data/lib/doorkeeper.rb +107 -79
- data/lib/doorkeeper/config.rb +140 -94
- data/lib/doorkeeper/config/abstract_builder.rb +28 -0
- data/lib/doorkeeper/config/option.rb +26 -14
- data/lib/doorkeeper/config/validations.rb +53 -0
- data/lib/doorkeeper/engine.rb +1 -1
- data/lib/doorkeeper/grant_flow.rb +43 -0
- data/lib/doorkeeper/grant_flow/fallback_flow.rb +15 -0
- data/lib/doorkeeper/grant_flow/flow.rb +34 -0
- data/lib/doorkeeper/grant_flow/registry.rb +50 -0
- data/lib/doorkeeper/grape/helpers.rb +1 -1
- data/lib/doorkeeper/helpers/controller.rb +6 -4
- data/lib/doorkeeper/models/access_grant_mixin.rb +20 -16
- data/lib/doorkeeper/models/access_token_mixin.rb +110 -47
- data/lib/doorkeeper/models/application_mixin.rb +5 -4
- data/lib/doorkeeper/models/concerns/resource_ownerable.rb +47 -0
- data/lib/doorkeeper/models/concerns/revocable.rb +1 -1
- data/lib/doorkeeper/models/concerns/scopes.rb +5 -1
- data/lib/doorkeeper/models/concerns/secret_storable.rb +1 -3
- data/lib/doorkeeper/oauth/authorization/code.rb +15 -6
- data/lib/doorkeeper/oauth/authorization/context.rb +5 -5
- data/lib/doorkeeper/oauth/authorization/token.rb +14 -16
- data/lib/doorkeeper/oauth/authorization/uri_builder.rb +4 -4
- data/lib/doorkeeper/oauth/authorization_code_request.rb +17 -14
- data/lib/doorkeeper/oauth/base_request.rb +12 -20
- data/lib/doorkeeper/oauth/client.rb +1 -1
- data/lib/doorkeeper/oauth/client/credentials.rb +2 -4
- data/lib/doorkeeper/oauth/client_credentials/creator.rb +27 -8
- data/lib/doorkeeper/oauth/client_credentials/issuer.rb +4 -2
- data/lib/doorkeeper/oauth/client_credentials/validator.rb +4 -2
- data/lib/doorkeeper/oauth/client_credentials_request.rb +8 -7
- data/lib/doorkeeper/oauth/code_request.rb +3 -3
- data/lib/doorkeeper/oauth/code_response.rb +28 -14
- data/lib/doorkeeper/oauth/error_response.rb +6 -7
- data/lib/doorkeeper/oauth/helpers/scope_checker.rb +2 -8
- data/lib/doorkeeper/oauth/hooks/context.rb +21 -0
- data/lib/doorkeeper/oauth/invalid_token_response.rb +2 -2
- data/lib/doorkeeper/oauth/password_access_token_request.rb +24 -7
- data/lib/doorkeeper/oauth/pre_authorization.rb +41 -31
- data/lib/doorkeeper/oauth/refresh_token_request.rb +31 -22
- data/lib/doorkeeper/oauth/token.rb +5 -6
- data/lib/doorkeeper/oauth/token_introspection.rb +4 -8
- data/lib/doorkeeper/oauth/token_request.rb +3 -3
- data/lib/doorkeeper/oauth/token_response.rb +1 -1
- data/lib/doorkeeper/orm/active_record.rb +10 -2
- data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +8 -3
- data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +7 -3
- data/lib/doorkeeper/orm/active_record/mixins/application.rb +20 -16
- data/lib/doorkeeper/rails/routes.rb +14 -18
- data/lib/doorkeeper/rails/routes/abstract_router.rb +35 -0
- data/lib/doorkeeper/rails/routes/mapper.rb +2 -2
- data/lib/doorkeeper/rails/routes/registry.rb +45 -0
- data/lib/doorkeeper/request.rb +49 -12
- data/lib/doorkeeper/request/refresh_token.rb +2 -1
- data/lib/doorkeeper/request/strategy.rb +2 -2
- data/lib/doorkeeper/server.rb +4 -4
- data/lib/doorkeeper/stale_records_cleaner.rb +4 -4
- data/lib/doorkeeper/version.rb +3 -3
- data/lib/generators/doorkeeper/confidential_applications_generator.rb +1 -1
- data/lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb +39 -0
- data/lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb +2 -0
- data/lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb +2 -0
- data/lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb +2 -0
- data/lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb +17 -0
- data/lib/generators/doorkeeper/templates/initializer.rb +48 -10
- data/lib/generators/doorkeeper/templates/migration.rb.erb +14 -5
- metadata +21 -299
- data/Appraisals +0 -40
- data/CODE_OF_CONDUCT.md +0 -46
- data/CONTRIBUTING.md +0 -49
- data/Dangerfile +0 -67
- data/Dockerfile +0 -29
- data/Gemfile +0 -25
- data/NEWS.md +0 -1
- data/RELEASING.md +0 -11
- data/Rakefile +0 -28
- data/SECURITY.md +0 -15
- data/UPGRADE.md +0 -2
- data/bin/console +0 -16
- data/doorkeeper.gemspec +0 -42
- data/gemfiles/rails_5_0.gemfile +0 -18
- data/gemfiles/rails_5_1.gemfile +0 -18
- data/gemfiles/rails_5_2.gemfile +0 -18
- data/gemfiles/rails_6_0.gemfile +0 -18
- data/gemfiles/rails_master.gemfile +0 -18
- data/spec/controllers/application_metal_controller_spec.rb +0 -64
- data/spec/controllers/applications_controller_spec.rb +0 -274
- data/spec/controllers/authorizations_controller_spec.rb +0 -608
- data/spec/controllers/protected_resources_controller_spec.rb +0 -361
- data/spec/controllers/token_info_controller_spec.rb +0 -50
- data/spec/controllers/tokens_controller_spec.rb +0 -498
- data/spec/dummy/Rakefile +0 -9
- data/spec/dummy/app/assets/config/manifest.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/dummy/app/controllers/custom_authorizations_controller.rb +0 -9
- data/spec/dummy/app/controllers/full_protected_resources_controller.rb +0 -14
- data/spec/dummy/app/controllers/home_controller.rb +0 -18
- data/spec/dummy/app/controllers/metal_controller.rb +0 -13
- data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +0 -13
- data/spec/dummy/app/helpers/application_helper.rb +0 -7
- data/spec/dummy/app/models/user.rb +0 -7
- data/spec/dummy/app/views/home/index.html.erb +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config.ru +0 -6
- data/spec/dummy/config/application.rb +0 -49
- data/spec/dummy/config/boot.rb +0 -7
- data/spec/dummy/config/database.yml +0 -15
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -31
- data/spec/dummy/config/environments/production.rb +0 -64
- data/spec/dummy/config/environments/test.rb +0 -45
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -9
- data/spec/dummy/config/initializers/doorkeeper.rb +0 -166
- data/spec/dummy/config/initializers/secret_token.rb +0 -10
- data/spec/dummy/config/initializers/session_store.rb +0 -10
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -16
- data/spec/dummy/config/locales/doorkeeper.en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -13
- data/spec/dummy/db/migrate/20111122132257_create_users.rb +0 -11
- data/spec/dummy/db/migrate/20120312140401_add_password_to_users.rb +0 -7
- data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +0 -69
- data/spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb +0 -9
- data/spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb +0 -13
- data/spec/dummy/db/migrate/20170822064514_enable_pkce.rb +0 -8
- data/spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb +0 -13
- data/spec/dummy/db/schema.rb +0 -68
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -9
- data/spec/factories.rb +0 -30
- data/spec/generators/application_owner_generator_spec.rb +0 -28
- data/spec/generators/confidential_applications_generator_spec.rb +0 -29
- data/spec/generators/install_generator_spec.rb +0 -36
- data/spec/generators/migration_generator_spec.rb +0 -28
- data/spec/generators/pkce_generator_spec.rb +0 -28
- data/spec/generators/previous_refresh_token_generator_spec.rb +0 -44
- data/spec/generators/templates/routes.rb +0 -4
- data/spec/generators/views_generator_spec.rb +0 -29
- data/spec/grape/grape_integration_spec.rb +0 -137
- data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +0 -26
- data/spec/lib/config_spec.rb +0 -809
- data/spec/lib/doorkeeper_spec.rb +0 -27
- data/spec/lib/models/expirable_spec.rb +0 -61
- data/spec/lib/models/reusable_spec.rb +0 -40
- data/spec/lib/models/revocable_spec.rb +0 -59
- data/spec/lib/models/scopes_spec.rb +0 -53
- data/spec/lib/models/secret_storable_spec.rb +0 -135
- data/spec/lib/oauth/authorization/uri_builder_spec.rb +0 -39
- data/spec/lib/oauth/authorization_code_request_spec.rb +0 -170
- data/spec/lib/oauth/base_request_spec.rb +0 -224
- data/spec/lib/oauth/base_response_spec.rb +0 -45
- data/spec/lib/oauth/client/credentials_spec.rb +0 -90
- data/spec/lib/oauth/client_credentials/creator_spec.rb +0 -134
- data/spec/lib/oauth/client_credentials/issuer_spec.rb +0 -112
- data/spec/lib/oauth/client_credentials/validation_spec.rb +0 -59
- data/spec/lib/oauth/client_credentials_integration_spec.rb +0 -27
- data/spec/lib/oauth/client_credentials_request_spec.rb +0 -107
- data/spec/lib/oauth/client_spec.rb +0 -38
- data/spec/lib/oauth/code_request_spec.rb +0 -46
- data/spec/lib/oauth/code_response_spec.rb +0 -32
- data/spec/lib/oauth/error_response_spec.rb +0 -64
- data/spec/lib/oauth/error_spec.rb +0 -21
- data/spec/lib/oauth/forbidden_token_response_spec.rb +0 -20
- data/spec/lib/oauth/helpers/scope_checker_spec.rb +0 -110
- data/spec/lib/oauth/helpers/unique_token_spec.rb +0 -21
- data/spec/lib/oauth/helpers/uri_checker_spec.rb +0 -262
- data/spec/lib/oauth/invalid_request_response_spec.rb +0 -73
- data/spec/lib/oauth/invalid_token_response_spec.rb +0 -53
- data/spec/lib/oauth/password_access_token_request_spec.rb +0 -190
- data/spec/lib/oauth/pre_authorization_spec.rb +0 -223
- data/spec/lib/oauth/refresh_token_request_spec.rb +0 -177
- data/spec/lib/oauth/scopes_spec.rb +0 -146
- data/spec/lib/oauth/token_request_spec.rb +0 -157
- data/spec/lib/oauth/token_response_spec.rb +0 -84
- data/spec/lib/oauth/token_spec.rb +0 -156
- data/spec/lib/request/strategy_spec.rb +0 -54
- data/spec/lib/secret_storing/base_spec.rb +0 -60
- data/spec/lib/secret_storing/bcrypt_spec.rb +0 -49
- data/spec/lib/secret_storing/plain_spec.rb +0 -44
- data/spec/lib/secret_storing/sha256_hash_spec.rb +0 -48
- data/spec/lib/server_spec.rb +0 -49
- data/spec/lib/stale_records_cleaner_spec.rb +0 -89
- data/spec/models/doorkeeper/access_grant_spec.rb +0 -161
- data/spec/models/doorkeeper/access_token_spec.rb +0 -622
- data/spec/models/doorkeeper/application_spec.rb +0 -482
- data/spec/requests/applications/applications_request_spec.rb +0 -259
- data/spec/requests/applications/authorized_applications_spec.rb +0 -32
- data/spec/requests/endpoints/authorization_spec.rb +0 -91
- data/spec/requests/endpoints/token_spec.rb +0 -75
- data/spec/requests/flows/authorization_code_errors_spec.rb +0 -79
- data/spec/requests/flows/authorization_code_spec.rb +0 -525
- data/spec/requests/flows/client_credentials_spec.rb +0 -166
- data/spec/requests/flows/implicit_grant_errors_spec.rb +0 -46
- data/spec/requests/flows/implicit_grant_spec.rb +0 -91
- data/spec/requests/flows/password_spec.rb +0 -316
- data/spec/requests/flows/refresh_token_spec.rb +0 -233
- data/spec/requests/flows/revoke_token_spec.rb +0 -157
- data/spec/requests/flows/skip_authorization_spec.rb +0 -66
- data/spec/requests/protected_resources/metal_spec.rb +0 -16
- data/spec/requests/protected_resources/private_api_spec.rb +0 -83
- data/spec/routing/custom_controller_routes_spec.rb +0 -133
- data/spec/routing/default_routes_spec.rb +0 -41
- data/spec/routing/scoped_routes_spec.rb +0 -47
- data/spec/spec_helper.rb +0 -54
- data/spec/spec_helper_integration.rb +0 -4
- data/spec/support/dependencies/factory_bot.rb +0 -4
- data/spec/support/doorkeeper_rspec.rb +0 -22
- data/spec/support/helpers/access_token_request_helper.rb +0 -13
- data/spec/support/helpers/authorization_request_helper.rb +0 -43
- data/spec/support/helpers/config_helper.rb +0 -11
- data/spec/support/helpers/model_helper.rb +0 -78
- data/spec/support/helpers/request_spec_helper.rb +0 -110
- data/spec/support/helpers/url_helper.rb +0 -62
- data/spec/support/orm/active_record.rb +0 -5
- data/spec/support/shared/controllers_shared_context.rb +0 -133
- data/spec/support/shared/hashing_shared_context.rb +0 -36
- data/spec/support/shared/models_shared_examples.rb +0 -54
- data/spec/validators/redirect_uri_validator_spec.rb +0 -183
- data/spec/version/version_spec.rb +0 -17
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Doorkeeper
|
4
|
+
module Rails
|
5
|
+
class Routes
|
6
|
+
# Thread-safe registry of any Doorkeeper additional routes.
|
7
|
+
# Used to allow implementing of Doorkeeper extensions that must
|
8
|
+
# use their own routes.
|
9
|
+
#
|
10
|
+
module Registry
|
11
|
+
ROUTES_ACCESS_LOCK = Mutex.new
|
12
|
+
ROUTES_DEFINITION_LOCK = Mutex.new
|
13
|
+
|
14
|
+
InvalidRouterClass = Class.new(StandardError)
|
15
|
+
|
16
|
+
# Collection of additional registered routes for Doorkeeper.
|
17
|
+
#
|
18
|
+
# @return [Array<Object>] set of registered routes
|
19
|
+
#
|
20
|
+
def registered_routes
|
21
|
+
ROUTES_DEFINITION_LOCK.synchronize do
|
22
|
+
@registered_routes ||= Set.new
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Registers additional routes in the Doorkeeper registry
|
27
|
+
#
|
28
|
+
# @param [Object] routes
|
29
|
+
# routes class
|
30
|
+
#
|
31
|
+
def register_routes(routes)
|
32
|
+
if !routes.is_a?(Module) || !(routes < AbstractRouter)
|
33
|
+
raise InvalidRouterClass, "routes class must include Doorkeeper::Rails::AbstractRouter"
|
34
|
+
end
|
35
|
+
|
36
|
+
ROUTES_ACCESS_LOCK.synchronize do
|
37
|
+
registered_routes << routes
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
alias register register_routes
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/doorkeeper/request.rb
CHANGED
@@ -4,32 +4,69 @@ module Doorkeeper
|
|
4
4
|
module Request
|
5
5
|
class << self
|
6
6
|
def authorization_strategy(response_type)
|
7
|
-
|
7
|
+
grant_flow = authorization_flows.detect do |flow|
|
8
|
+
flow.matches_response_type?(response_type)
|
9
|
+
end
|
10
|
+
|
11
|
+
if grant_flow
|
12
|
+
grant_flow.response_type_strategy
|
13
|
+
else
|
14
|
+
# [NOTE]: this will be removed in a newer versions of Doorkeeper.
|
15
|
+
# For retro-compatibility only
|
16
|
+
build_fallback_strategy_class(response_type)
|
17
|
+
end
|
8
18
|
end
|
9
19
|
|
10
20
|
def token_strategy(grant_type)
|
11
21
|
raise Errors::MissingRequiredParameter, :grant_type if grant_type.blank?
|
12
22
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
23
|
+
grant_flow = token_flows.detect do |flow|
|
24
|
+
flow.matches_grant_type?(grant_type)
|
25
|
+
end
|
17
26
|
|
18
|
-
|
19
|
-
|
27
|
+
if grant_flow
|
28
|
+
grant_flow.grant_type_strategy
|
29
|
+
else
|
30
|
+
# [NOTE]: this will be removed in a newer versions of Doorkeeper.
|
31
|
+
# For retro-compatibility only
|
32
|
+
raise Errors::InvalidTokenStrategy unless available.include?(grant_type.to_s)
|
20
33
|
|
21
|
-
|
34
|
+
strategy_class = build_fallback_strategy_class(grant_type)
|
35
|
+
raise Errors::InvalidTokenStrategy unless strategy_class
|
36
|
+
|
37
|
+
strategy_class
|
38
|
+
end
|
22
39
|
end
|
23
40
|
|
24
41
|
private
|
25
42
|
|
26
|
-
def
|
27
|
-
Doorkeeper.
|
43
|
+
def authorization_flows
|
44
|
+
Doorkeeper.configuration.authorization_response_flows
|
45
|
+
end
|
46
|
+
|
47
|
+
def token_flows
|
48
|
+
Doorkeeper.configuration.token_grant_flows
|
28
49
|
end
|
29
50
|
|
30
|
-
|
51
|
+
# [NOTE]: this will be removed in a newer versions of Doorkeeper.
|
52
|
+
# For retro-compatibility only
|
53
|
+
def available
|
54
|
+
Doorkeeper.config.deprecated_token_grant_types_resolver
|
55
|
+
end
|
56
|
+
|
57
|
+
def build_fallback_strategy_class(grant_or_request_type)
|
31
58
|
strategy_class_name = grant_or_request_type.to_s.tr(" ", "_").camelize
|
32
|
-
"Doorkeeper::Request::#{strategy_class_name}".constantize
|
59
|
+
fallback_strategy = "Doorkeeper::Request::#{strategy_class_name}".constantize
|
60
|
+
|
61
|
+
::Kernel.warn <<~WARNING
|
62
|
+
[DOORKEEPER] #{fallback_strategy} found using fallback, it must be
|
63
|
+
registered using `Doorkeeper::GrantFlow.register(grant_flow_name, **options)`.
|
64
|
+
This functionality will be removed in a newer versions of Doorkeeper.
|
65
|
+
WARNING
|
66
|
+
|
67
|
+
fallback_strategy
|
68
|
+
rescue NameError
|
69
|
+
raise Errors::InvalidTokenStrategy
|
33
70
|
end
|
34
71
|
end
|
35
72
|
end
|
data/lib/doorkeeper/server.rb
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
module Doorkeeper
|
4
4
|
class Server
|
5
|
-
|
5
|
+
attr_reader :context
|
6
6
|
|
7
|
-
def initialize(context
|
7
|
+
def initialize(context)
|
8
8
|
@context = context
|
9
9
|
end
|
10
10
|
|
11
11
|
def authorization_request(strategy)
|
12
|
-
klass = Request.authorization_strategy
|
12
|
+
klass = Request.authorization_strategy(strategy)
|
13
13
|
klass.new(self)
|
14
14
|
end
|
15
15
|
|
16
16
|
def token_request(strategy)
|
17
|
-
klass = Request.token_strategy
|
17
|
+
klass = Request.token_strategy(strategy)
|
18
18
|
klass.new(self)
|
19
19
|
end
|
20
20
|
|
@@ -13,12 +13,12 @@ module Doorkeeper
|
|
13
13
|
raise Doorkeeper::Errors::NoOrmCleaner, "'#{configured_orm}' ORM has no cleaner!"
|
14
14
|
end
|
15
15
|
|
16
|
-
def self.configured_orm
|
17
|
-
Doorkeeper.config.orm
|
18
|
-
end
|
19
|
-
|
20
16
|
def self.new(base_scope)
|
21
17
|
self.for(base_scope)
|
22
18
|
end
|
19
|
+
|
20
|
+
def self.configured_orm
|
21
|
+
Doorkeeper.config.orm
|
22
|
+
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/doorkeeper/version.rb
CHANGED
@@ -12,7 +12,7 @@ module Doorkeeper
|
|
12
12
|
source_root File.expand_path("templates", __dir__)
|
13
13
|
desc "Add confidential column to Doorkeeper applications"
|
14
14
|
|
15
|
-
def
|
15
|
+
def confidential_applications
|
16
16
|
migration_template(
|
17
17
|
"add_confidential_to_applications.rb.erb",
|
18
18
|
"db/migrate/add_confidential_to_applications.rb",
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
require "rails/generators/active_record"
|
5
|
+
|
6
|
+
module Doorkeeper
|
7
|
+
# Generates migration with polymorphic resource owner required
|
8
|
+
# database columns for Doorkeeper Access Token and Access Grant
|
9
|
+
# models.
|
10
|
+
#
|
11
|
+
class EnablePolymorphicResourceOwnerGenerator < ::Rails::Generators::Base
|
12
|
+
include ::Rails::Generators::Migration
|
13
|
+
source_root File.expand_path("templates", __dir__)
|
14
|
+
desc "Provide support for polymorphic Resource Owner."
|
15
|
+
|
16
|
+
def enable_polymorphic_resource_owner
|
17
|
+
migration_template(
|
18
|
+
"enable_polymorphic_resource_owner_migration.rb.erb",
|
19
|
+
"db/migrate/enable_polymorphic_resource_owner.rb",
|
20
|
+
migration_version: migration_version,
|
21
|
+
)
|
22
|
+
gsub_file(
|
23
|
+
"config/initializers/doorkeeper.rb",
|
24
|
+
"# use_polymorphic_resource_owner",
|
25
|
+
"use_polymorphic_resource_owner",
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.next_migration_number(dirname)
|
30
|
+
ActiveRecord::Generators::Base.next_migration_number(dirname)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def migration_version
|
36
|
+
"[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class EnablePolymorphicResourceOwner < ActiveRecord::Migration<%= migration_version %>
|
4
|
+
def change
|
5
|
+
add_column :oauth_access_tokens, :resource_owner_type, :string
|
6
|
+
add_column :oauth_access_grants, :resource_owner_type, :string
|
7
|
+
change_column_null :oauth_access_grants, :resource_owner_type, false
|
8
|
+
|
9
|
+
add_index :oauth_access_tokens,
|
10
|
+
[:resource_owner_id, :resource_owner_type],
|
11
|
+
name: 'polymorphic_owner_oauth_access_tokens'
|
12
|
+
|
13
|
+
add_index :oauth_access_grants,
|
14
|
+
[:resource_owner_id, :resource_owner_type],
|
15
|
+
name: 'polymorphic_owner_oauth_access_grants'
|
16
|
+
end
|
17
|
+
end
|
@@ -58,6 +58,23 @@ Doorkeeper.configure do
|
|
58
58
|
# end
|
59
59
|
# end
|
60
60
|
|
61
|
+
# Enables polymorphic Resource Owner association for Access Tokens and Access Grants.
|
62
|
+
# By default this option is disabled.
|
63
|
+
#
|
64
|
+
# Make sure you properly setup you database and have all the required columns (run
|
65
|
+
# `bundle exec rails generate doorkeeper:enable_polymorphic_resource_owner` and execute Rails
|
66
|
+
# migrations).
|
67
|
+
#
|
68
|
+
# If this option enabled, Doorkeeper will store not only Resource Owner primary key
|
69
|
+
# value, but also it's type (class name). See "Polymorphic Associations" section of
|
70
|
+
# Rails guides: https://guides.rubyonrails.org/association_basics.html#polymorphic-associations
|
71
|
+
#
|
72
|
+
# [NOTE] If you apply this option on already existing project don't forget to manually
|
73
|
+
# update `resource_owner_type` column in the database and fix migration template as it will
|
74
|
+
# set NOT NULL constraint for Access Grants table.
|
75
|
+
#
|
76
|
+
# use_polymorphic_resource_owner
|
77
|
+
|
61
78
|
# If you are planning to use Doorkeeper in Rails 5 API-only application, then you might
|
62
79
|
# want to use API mode that will skip all the views management and change the way how
|
63
80
|
# Doorkeeper responds to a requests.
|
@@ -86,12 +103,13 @@ Doorkeeper.configure do
|
|
86
103
|
#
|
87
104
|
# `context` has the following properties available:
|
88
105
|
#
|
89
|
-
# `client` - the OAuth client application (see Doorkeeper::OAuth::Client)
|
90
|
-
# `grant_type` - the grant type of the request (see Doorkeeper::OAuth)
|
91
|
-
# `scopes` - the requested scopes (see Doorkeeper::OAuth::Scopes)
|
106
|
+
# * `client` - the OAuth client application (see Doorkeeper::OAuth::Client)
|
107
|
+
# * `grant_type` - the grant type of the request (see Doorkeeper::OAuth)
|
108
|
+
# * `scopes` - the requested scopes (see Doorkeeper::OAuth::Scopes)
|
109
|
+
# * `resource_owner` - authorized resource owner instance (if present)
|
92
110
|
#
|
93
111
|
# custom_access_token_expires_in do |context|
|
94
|
-
# context.client.
|
112
|
+
# context.client.additional_settings.implicit_oauth_expiration
|
95
113
|
# end
|
96
114
|
|
97
115
|
# Use a custom class for generating the access token.
|
@@ -150,8 +168,7 @@ Doorkeeper.configure do
|
|
150
168
|
# since plain values can no longer be retrieved.
|
151
169
|
#
|
152
170
|
# Note: If you are already a user of doorkeeper and have existing tokens
|
153
|
-
# in your installation, they will be invalid without
|
154
|
-
# setting `fallback_to_plain_secrets` below.
|
171
|
+
# in your installation, they will be invalid without adding 'fallback: :plain'.
|
155
172
|
#
|
156
173
|
# hash_token_secrets
|
157
174
|
# By default, token secrets will be hashed using the
|
@@ -185,7 +202,9 @@ Doorkeeper.configure do
|
|
185
202
|
# This will ensure that old access tokens and secrets
|
186
203
|
# will remain valid even if the hashing above is enabled.
|
187
204
|
#
|
188
|
-
#
|
205
|
+
# This can be done by adding 'fallback: plain', e.g. :
|
206
|
+
#
|
207
|
+
# hash_application_secrets using: '::Doorkeeper::SecretStoring::BCrypt', fallback: :plain
|
189
208
|
|
190
209
|
# Issue access tokens with refresh token (disabled by default), you may also
|
191
210
|
# pass a block which accepts `context` to customize when to give a refresh
|
@@ -360,6 +379,17 @@ Doorkeeper.configure do
|
|
360
379
|
# client.grant_flows.include?(grant_flow)
|
361
380
|
# end
|
362
381
|
|
382
|
+
# If you need arbitrary Resource Owner-Client authorization you can enable this option
|
383
|
+
# and implement the check your need. Config option must respond to #call and return
|
384
|
+
# true in case resource owner authorized for the specific application or false in other
|
385
|
+
# cases.
|
386
|
+
#
|
387
|
+
# Be default all Resource Owners are authorized to any Client (application).
|
388
|
+
#
|
389
|
+
# authorize_resource_owner_for_client do |client, resource_owner|
|
390
|
+
# resource_owner.admin? || client.owners_whitelist.include?(resource_owner)
|
391
|
+
# end
|
392
|
+
|
363
393
|
# Hook into the strategies' request & response life-cycle in case your
|
364
394
|
# application needs advanced customization or logging:
|
365
395
|
#
|
@@ -372,17 +402,25 @@ Doorkeeper.configure do
|
|
372
402
|
# end
|
373
403
|
|
374
404
|
# Hook into Authorization flow in order to implement Single Sign Out
|
375
|
-
# or add any other functionality.
|
405
|
+
# or add any other functionality. Inside the block you have an access
|
406
|
+
# to `controller` (authorizations controller instance) and `context`
|
407
|
+
# (Doorkeeper::OAuth::Hooks::Context instance) which provides pre auth
|
408
|
+
# or auth objects with issued token based on hook type (before or after).
|
376
409
|
#
|
377
|
-
# before_successful_authorization do |controller|
|
410
|
+
# before_successful_authorization do |controller, context|
|
378
411
|
# Rails.logger.info(controller.request.params.inspect)
|
412
|
+
#
|
413
|
+
# Rails.logger.info(context.pre_auth.inspect)
|
379
414
|
# end
|
380
415
|
#
|
381
|
-
# after_successful_authorization do |controller|
|
416
|
+
# after_successful_authorization do |controller, context|
|
382
417
|
# controller.session[:logout_urls] <<
|
383
418
|
# Doorkeeper::Application
|
384
419
|
# .find_by(controller.request.params.slice(:redirect_uri))
|
385
420
|
# .logout_uri
|
421
|
+
#
|
422
|
+
# Rails.logger.info(context.auth.inspect)
|
423
|
+
# Rails.logger.info(context.issued_token)
|
386
424
|
# end
|
387
425
|
|
388
426
|
# Under some circumstances you might want to have applications auto-approved,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class CreateDoorkeeperTables < ActiveRecord::Migration<%= migration_version %>
|
2
4
|
def change
|
3
5
|
create_table :oauth_applications do |t|
|
@@ -55,12 +57,19 @@ class CreateDoorkeeperTables < ActiveRecord::Migration<%= migration_version %>
|
|
55
57
|
t.datetime :created_at, null: false
|
56
58
|
t.string :scopes
|
57
59
|
|
58
|
-
#
|
60
|
+
# The authorization server MAY issue a new refresh token, in which case
|
61
|
+
# *the client MUST discard the old refresh token* and replace it with the
|
62
|
+
# new refresh token. The authorization server MAY revoke the old
|
63
|
+
# refresh token after issuing a new refresh token to the client.
|
64
|
+
# @see https://tools.ietf.org/html/rfc6749#section-6
|
65
|
+
#
|
66
|
+
# Doorkeeper implementation: if there is a `previous_refresh_token` column,
|
59
67
|
# refresh tokens will be revoked after a related access token is used.
|
60
|
-
# If there is no previous_refresh_token column,
|
61
|
-
#
|
62
|
-
#
|
63
|
-
# instantly
|
68
|
+
# If there is no `previous_refresh_token` column, previous tokens are
|
69
|
+
# revoked as soon as a new access token is created.
|
70
|
+
#
|
71
|
+
# Comment out this line if you want refresh tokens to be instantly
|
72
|
+
# revoked after use.
|
64
73
|
t.string :previous_refresh_token, null: false, default: ""
|
65
74
|
end
|
66
75
|
|
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.
|
4
|
+
version: 5.5.0.rc1
|
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: 2020-
|
14
|
+
date: 2020-08-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|
@@ -75,14 +75,14 @@ dependencies:
|
|
75
75
|
requirements:
|
76
76
|
- - "~>"
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: '
|
78
|
+
version: '8.0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - "~>"
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
85
|
+
version: '8.0'
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: database_cleaner
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,14 +103,14 @@ dependencies:
|
|
103
103
|
requirements:
|
104
104
|
- - "~>"
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: '
|
106
|
+
version: '6.0'
|
107
107
|
type: :development
|
108
108
|
prerelease: false
|
109
109
|
version_requirements: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
111
|
- - "~>"
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: '
|
113
|
+
version: '6.0'
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: generator_spec
|
116
116
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,20 +174,9 @@ executables: []
|
|
174
174
|
extensions: []
|
175
175
|
extra_rdoc_files: []
|
176
176
|
files:
|
177
|
-
- Appraisals
|
178
177
|
- CHANGELOG.md
|
179
|
-
- CODE_OF_CONDUCT.md
|
180
|
-
- CONTRIBUTING.md
|
181
|
-
- Dangerfile
|
182
|
-
- Dockerfile
|
183
|
-
- Gemfile
|
184
178
|
- MIT-LICENSE
|
185
|
-
- NEWS.md
|
186
179
|
- README.md
|
187
|
-
- RELEASING.md
|
188
|
-
- Rakefile
|
189
|
-
- SECURITY.md
|
190
|
-
- UPGRADE.md
|
191
180
|
- app/assets/stylesheets/doorkeeper/admin/application.css
|
192
181
|
- app/assets/stylesheets/doorkeeper/application.css
|
193
182
|
- app/controllers/doorkeeper/application_controller.rb
|
@@ -211,19 +200,18 @@ files:
|
|
211
200
|
- app/views/doorkeeper/authorized_applications/index.html.erb
|
212
201
|
- app/views/layouts/doorkeeper/admin.html.erb
|
213
202
|
- app/views/layouts/doorkeeper/application.html.erb
|
214
|
-
- bin/console
|
215
203
|
- config/locales/en.yml
|
216
|
-
- doorkeeper.gemspec
|
217
|
-
- gemfiles/rails_5_0.gemfile
|
218
|
-
- gemfiles/rails_5_1.gemfile
|
219
|
-
- gemfiles/rails_5_2.gemfile
|
220
|
-
- gemfiles/rails_6_0.gemfile
|
221
|
-
- gemfiles/rails_master.gemfile
|
222
204
|
- lib/doorkeeper.rb
|
223
205
|
- lib/doorkeeper/config.rb
|
206
|
+
- lib/doorkeeper/config/abstract_builder.rb
|
224
207
|
- lib/doorkeeper/config/option.rb
|
208
|
+
- lib/doorkeeper/config/validations.rb
|
225
209
|
- lib/doorkeeper/engine.rb
|
226
210
|
- lib/doorkeeper/errors.rb
|
211
|
+
- lib/doorkeeper/grant_flow.rb
|
212
|
+
- lib/doorkeeper/grant_flow/fallback_flow.rb
|
213
|
+
- lib/doorkeeper/grant_flow/flow.rb
|
214
|
+
- lib/doorkeeper/grant_flow/registry.rb
|
227
215
|
- lib/doorkeeper/grape/authorization_decorator.rb
|
228
216
|
- lib/doorkeeper/grape/helpers.rb
|
229
217
|
- lib/doorkeeper/helpers/controller.rb
|
@@ -234,6 +222,7 @@ files:
|
|
234
222
|
- lib/doorkeeper/models/concerns/expirable.rb
|
235
223
|
- lib/doorkeeper/models/concerns/orderable.rb
|
236
224
|
- lib/doorkeeper/models/concerns/ownership.rb
|
225
|
+
- lib/doorkeeper/models/concerns/resource_ownerable.rb
|
237
226
|
- lib/doorkeeper/models/concerns/reusable.rb
|
238
227
|
- lib/doorkeeper/models/concerns/revocable.rb
|
239
228
|
- lib/doorkeeper/models/concerns/scopes.rb
|
@@ -260,6 +249,7 @@ files:
|
|
260
249
|
- lib/doorkeeper/oauth/helpers/scope_checker.rb
|
261
250
|
- lib/doorkeeper/oauth/helpers/unique_token.rb
|
262
251
|
- lib/doorkeeper/oauth/helpers/uri_checker.rb
|
252
|
+
- lib/doorkeeper/oauth/hooks/context.rb
|
263
253
|
- lib/doorkeeper/oauth/invalid_request_response.rb
|
264
254
|
- lib/doorkeeper/oauth/invalid_token_response.rb
|
265
255
|
- lib/doorkeeper/oauth/nonstandard.rb
|
@@ -282,8 +272,10 @@ files:
|
|
282
272
|
- lib/doorkeeper/orm/active_record/stale_records_cleaner.rb
|
283
273
|
- lib/doorkeeper/rails/helpers.rb
|
284
274
|
- lib/doorkeeper/rails/routes.rb
|
275
|
+
- lib/doorkeeper/rails/routes/abstract_router.rb
|
285
276
|
- lib/doorkeeper/rails/routes/mapper.rb
|
286
277
|
- lib/doorkeeper/rails/routes/mapping.rb
|
278
|
+
- lib/doorkeeper/rails/routes/registry.rb
|
287
279
|
- lib/doorkeeper/rake.rb
|
288
280
|
- lib/doorkeeper/rake/db.rake
|
289
281
|
- lib/doorkeeper/rake/setup.rake
|
@@ -305,6 +297,7 @@ files:
|
|
305
297
|
- lib/doorkeeper/version.rb
|
306
298
|
- lib/generators/doorkeeper/application_owner_generator.rb
|
307
299
|
- lib/generators/doorkeeper/confidential_applications_generator.rb
|
300
|
+
- lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb
|
308
301
|
- lib/generators/doorkeeper/install_generator.rb
|
309
302
|
- lib/generators/doorkeeper/migration_generator.rb
|
310
303
|
- lib/generators/doorkeeper/pkce_generator.rb
|
@@ -314,145 +307,10 @@ files:
|
|
314
307
|
- lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb
|
315
308
|
- lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb
|
316
309
|
- lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb
|
310
|
+
- lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
|
317
311
|
- lib/generators/doorkeeper/templates/initializer.rb
|
318
312
|
- lib/generators/doorkeeper/templates/migration.rb.erb
|
319
313
|
- lib/generators/doorkeeper/views_generator.rb
|
320
|
-
- spec/controllers/application_metal_controller_spec.rb
|
321
|
-
- spec/controllers/applications_controller_spec.rb
|
322
|
-
- spec/controllers/authorizations_controller_spec.rb
|
323
|
-
- spec/controllers/protected_resources_controller_spec.rb
|
324
|
-
- spec/controllers/token_info_controller_spec.rb
|
325
|
-
- spec/controllers/tokens_controller_spec.rb
|
326
|
-
- spec/dummy/Rakefile
|
327
|
-
- spec/dummy/app/assets/config/manifest.js
|
328
|
-
- spec/dummy/app/controllers/application_controller.rb
|
329
|
-
- spec/dummy/app/controllers/custom_authorizations_controller.rb
|
330
|
-
- spec/dummy/app/controllers/full_protected_resources_controller.rb
|
331
|
-
- spec/dummy/app/controllers/home_controller.rb
|
332
|
-
- spec/dummy/app/controllers/metal_controller.rb
|
333
|
-
- spec/dummy/app/controllers/semi_protected_resources_controller.rb
|
334
|
-
- spec/dummy/app/helpers/application_helper.rb
|
335
|
-
- spec/dummy/app/models/user.rb
|
336
|
-
- spec/dummy/app/views/home/index.html.erb
|
337
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
338
|
-
- spec/dummy/config.ru
|
339
|
-
- spec/dummy/config/application.rb
|
340
|
-
- spec/dummy/config/boot.rb
|
341
|
-
- spec/dummy/config/database.yml
|
342
|
-
- spec/dummy/config/environment.rb
|
343
|
-
- spec/dummy/config/environments/development.rb
|
344
|
-
- spec/dummy/config/environments/production.rb
|
345
|
-
- spec/dummy/config/environments/test.rb
|
346
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
347
|
-
- spec/dummy/config/initializers/doorkeeper.rb
|
348
|
-
- spec/dummy/config/initializers/secret_token.rb
|
349
|
-
- spec/dummy/config/initializers/session_store.rb
|
350
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
351
|
-
- spec/dummy/config/locales/doorkeeper.en.yml
|
352
|
-
- spec/dummy/config/routes.rb
|
353
|
-
- spec/dummy/db/migrate/20111122132257_create_users.rb
|
354
|
-
- spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
|
355
|
-
- spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
|
356
|
-
- spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
|
357
|
-
- spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb
|
358
|
-
- spec/dummy/db/migrate/20170822064514_enable_pkce.rb
|
359
|
-
- spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb
|
360
|
-
- spec/dummy/db/schema.rb
|
361
|
-
- spec/dummy/public/404.html
|
362
|
-
- spec/dummy/public/422.html
|
363
|
-
- spec/dummy/public/500.html
|
364
|
-
- spec/dummy/public/favicon.ico
|
365
|
-
- spec/dummy/script/rails
|
366
|
-
- spec/factories.rb
|
367
|
-
- spec/generators/application_owner_generator_spec.rb
|
368
|
-
- spec/generators/confidential_applications_generator_spec.rb
|
369
|
-
- spec/generators/install_generator_spec.rb
|
370
|
-
- spec/generators/migration_generator_spec.rb
|
371
|
-
- spec/generators/pkce_generator_spec.rb
|
372
|
-
- spec/generators/previous_refresh_token_generator_spec.rb
|
373
|
-
- spec/generators/templates/routes.rb
|
374
|
-
- spec/generators/views_generator_spec.rb
|
375
|
-
- spec/grape/grape_integration_spec.rb
|
376
|
-
- spec/helpers/doorkeeper/dashboard_helper_spec.rb
|
377
|
-
- spec/lib/config_spec.rb
|
378
|
-
- spec/lib/doorkeeper_spec.rb
|
379
|
-
- spec/lib/models/expirable_spec.rb
|
380
|
-
- spec/lib/models/reusable_spec.rb
|
381
|
-
- spec/lib/models/revocable_spec.rb
|
382
|
-
- spec/lib/models/scopes_spec.rb
|
383
|
-
- spec/lib/models/secret_storable_spec.rb
|
384
|
-
- spec/lib/oauth/authorization/uri_builder_spec.rb
|
385
|
-
- spec/lib/oauth/authorization_code_request_spec.rb
|
386
|
-
- spec/lib/oauth/base_request_spec.rb
|
387
|
-
- spec/lib/oauth/base_response_spec.rb
|
388
|
-
- spec/lib/oauth/client/credentials_spec.rb
|
389
|
-
- spec/lib/oauth/client_credentials/creator_spec.rb
|
390
|
-
- spec/lib/oauth/client_credentials/issuer_spec.rb
|
391
|
-
- spec/lib/oauth/client_credentials/validation_spec.rb
|
392
|
-
- spec/lib/oauth/client_credentials_integration_spec.rb
|
393
|
-
- spec/lib/oauth/client_credentials_request_spec.rb
|
394
|
-
- spec/lib/oauth/client_spec.rb
|
395
|
-
- spec/lib/oauth/code_request_spec.rb
|
396
|
-
- spec/lib/oauth/code_response_spec.rb
|
397
|
-
- spec/lib/oauth/error_response_spec.rb
|
398
|
-
- spec/lib/oauth/error_spec.rb
|
399
|
-
- spec/lib/oauth/forbidden_token_response_spec.rb
|
400
|
-
- spec/lib/oauth/helpers/scope_checker_spec.rb
|
401
|
-
- spec/lib/oauth/helpers/unique_token_spec.rb
|
402
|
-
- spec/lib/oauth/helpers/uri_checker_spec.rb
|
403
|
-
- spec/lib/oauth/invalid_request_response_spec.rb
|
404
|
-
- spec/lib/oauth/invalid_token_response_spec.rb
|
405
|
-
- spec/lib/oauth/password_access_token_request_spec.rb
|
406
|
-
- spec/lib/oauth/pre_authorization_spec.rb
|
407
|
-
- spec/lib/oauth/refresh_token_request_spec.rb
|
408
|
-
- spec/lib/oauth/scopes_spec.rb
|
409
|
-
- spec/lib/oauth/token_request_spec.rb
|
410
|
-
- spec/lib/oauth/token_response_spec.rb
|
411
|
-
- spec/lib/oauth/token_spec.rb
|
412
|
-
- spec/lib/request/strategy_spec.rb
|
413
|
-
- spec/lib/secret_storing/base_spec.rb
|
414
|
-
- spec/lib/secret_storing/bcrypt_spec.rb
|
415
|
-
- spec/lib/secret_storing/plain_spec.rb
|
416
|
-
- spec/lib/secret_storing/sha256_hash_spec.rb
|
417
|
-
- spec/lib/server_spec.rb
|
418
|
-
- spec/lib/stale_records_cleaner_spec.rb
|
419
|
-
- spec/models/doorkeeper/access_grant_spec.rb
|
420
|
-
- spec/models/doorkeeper/access_token_spec.rb
|
421
|
-
- spec/models/doorkeeper/application_spec.rb
|
422
|
-
- spec/requests/applications/applications_request_spec.rb
|
423
|
-
- spec/requests/applications/authorized_applications_spec.rb
|
424
|
-
- spec/requests/endpoints/authorization_spec.rb
|
425
|
-
- spec/requests/endpoints/token_spec.rb
|
426
|
-
- spec/requests/flows/authorization_code_errors_spec.rb
|
427
|
-
- spec/requests/flows/authorization_code_spec.rb
|
428
|
-
- spec/requests/flows/client_credentials_spec.rb
|
429
|
-
- spec/requests/flows/implicit_grant_errors_spec.rb
|
430
|
-
- spec/requests/flows/implicit_grant_spec.rb
|
431
|
-
- spec/requests/flows/password_spec.rb
|
432
|
-
- spec/requests/flows/refresh_token_spec.rb
|
433
|
-
- spec/requests/flows/revoke_token_spec.rb
|
434
|
-
- spec/requests/flows/skip_authorization_spec.rb
|
435
|
-
- spec/requests/protected_resources/metal_spec.rb
|
436
|
-
- spec/requests/protected_resources/private_api_spec.rb
|
437
|
-
- spec/routing/custom_controller_routes_spec.rb
|
438
|
-
- spec/routing/default_routes_spec.rb
|
439
|
-
- spec/routing/scoped_routes_spec.rb
|
440
|
-
- spec/spec_helper.rb
|
441
|
-
- spec/spec_helper_integration.rb
|
442
|
-
- spec/support/dependencies/factory_bot.rb
|
443
|
-
- spec/support/doorkeeper_rspec.rb
|
444
|
-
- spec/support/helpers/access_token_request_helper.rb
|
445
|
-
- spec/support/helpers/authorization_request_helper.rb
|
446
|
-
- spec/support/helpers/config_helper.rb
|
447
|
-
- spec/support/helpers/model_helper.rb
|
448
|
-
- spec/support/helpers/request_spec_helper.rb
|
449
|
-
- spec/support/helpers/url_helper.rb
|
450
|
-
- spec/support/orm/active_record.rb
|
451
|
-
- spec/support/shared/controllers_shared_context.rb
|
452
|
-
- spec/support/shared/hashing_shared_context.rb
|
453
|
-
- spec/support/shared/models_shared_examples.rb
|
454
|
-
- spec/validators/redirect_uri_validator_spec.rb
|
455
|
-
- spec/version/version_spec.rb
|
456
314
|
- vendor/assets/stylesheets/doorkeeper/bootstrap.min.css
|
457
315
|
homepage: https://github.com/doorkeeper-gem/doorkeeper
|
458
316
|
licenses:
|
@@ -474,148 +332,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
474
332
|
version: '2.4'
|
475
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
476
334
|
requirements:
|
477
|
-
- - "
|
335
|
+
- - ">"
|
478
336
|
- !ruby/object:Gem::Version
|
479
|
-
version:
|
337
|
+
version: 1.3.1
|
480
338
|
requirements: []
|
481
339
|
rubygems_version: 3.0.2
|
482
340
|
signing_key:
|
483
341
|
specification_version: 4
|
484
342
|
summary: OAuth 2 provider for Rails and Grape
|
485
|
-
test_files:
|
486
|
-
- spec/controllers/application_metal_controller_spec.rb
|
487
|
-
- spec/controllers/applications_controller_spec.rb
|
488
|
-
- spec/controllers/authorizations_controller_spec.rb
|
489
|
-
- spec/controllers/protected_resources_controller_spec.rb
|
490
|
-
- spec/controllers/token_info_controller_spec.rb
|
491
|
-
- spec/controllers/tokens_controller_spec.rb
|
492
|
-
- spec/dummy/Rakefile
|
493
|
-
- spec/dummy/app/assets/config/manifest.js
|
494
|
-
- spec/dummy/app/controllers/application_controller.rb
|
495
|
-
- spec/dummy/app/controllers/custom_authorizations_controller.rb
|
496
|
-
- spec/dummy/app/controllers/full_protected_resources_controller.rb
|
497
|
-
- spec/dummy/app/controllers/home_controller.rb
|
498
|
-
- spec/dummy/app/controllers/metal_controller.rb
|
499
|
-
- spec/dummy/app/controllers/semi_protected_resources_controller.rb
|
500
|
-
- spec/dummy/app/helpers/application_helper.rb
|
501
|
-
- spec/dummy/app/models/user.rb
|
502
|
-
- spec/dummy/app/views/home/index.html.erb
|
503
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
504
|
-
- spec/dummy/config.ru
|
505
|
-
- spec/dummy/config/application.rb
|
506
|
-
- spec/dummy/config/boot.rb
|
507
|
-
- spec/dummy/config/database.yml
|
508
|
-
- spec/dummy/config/environment.rb
|
509
|
-
- spec/dummy/config/environments/development.rb
|
510
|
-
- spec/dummy/config/environments/production.rb
|
511
|
-
- spec/dummy/config/environments/test.rb
|
512
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
513
|
-
- spec/dummy/config/initializers/doorkeeper.rb
|
514
|
-
- spec/dummy/config/initializers/secret_token.rb
|
515
|
-
- spec/dummy/config/initializers/session_store.rb
|
516
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
517
|
-
- spec/dummy/config/locales/doorkeeper.en.yml
|
518
|
-
- spec/dummy/config/routes.rb
|
519
|
-
- spec/dummy/db/migrate/20111122132257_create_users.rb
|
520
|
-
- spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
|
521
|
-
- spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
|
522
|
-
- spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
|
523
|
-
- spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb
|
524
|
-
- spec/dummy/db/migrate/20170822064514_enable_pkce.rb
|
525
|
-
- spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb
|
526
|
-
- spec/dummy/db/schema.rb
|
527
|
-
- spec/dummy/public/404.html
|
528
|
-
- spec/dummy/public/422.html
|
529
|
-
- spec/dummy/public/500.html
|
530
|
-
- spec/dummy/public/favicon.ico
|
531
|
-
- spec/dummy/script/rails
|
532
|
-
- spec/factories.rb
|
533
|
-
- spec/generators/application_owner_generator_spec.rb
|
534
|
-
- spec/generators/confidential_applications_generator_spec.rb
|
535
|
-
- spec/generators/install_generator_spec.rb
|
536
|
-
- spec/generators/migration_generator_spec.rb
|
537
|
-
- spec/generators/pkce_generator_spec.rb
|
538
|
-
- spec/generators/previous_refresh_token_generator_spec.rb
|
539
|
-
- spec/generators/templates/routes.rb
|
540
|
-
- spec/generators/views_generator_spec.rb
|
541
|
-
- spec/grape/grape_integration_spec.rb
|
542
|
-
- spec/helpers/doorkeeper/dashboard_helper_spec.rb
|
543
|
-
- spec/lib/config_spec.rb
|
544
|
-
- spec/lib/doorkeeper_spec.rb
|
545
|
-
- spec/lib/models/expirable_spec.rb
|
546
|
-
- spec/lib/models/reusable_spec.rb
|
547
|
-
- spec/lib/models/revocable_spec.rb
|
548
|
-
- spec/lib/models/scopes_spec.rb
|
549
|
-
- spec/lib/models/secret_storable_spec.rb
|
550
|
-
- spec/lib/oauth/authorization/uri_builder_spec.rb
|
551
|
-
- spec/lib/oauth/authorization_code_request_spec.rb
|
552
|
-
- spec/lib/oauth/base_request_spec.rb
|
553
|
-
- spec/lib/oauth/base_response_spec.rb
|
554
|
-
- spec/lib/oauth/client/credentials_spec.rb
|
555
|
-
- spec/lib/oauth/client_credentials/creator_spec.rb
|
556
|
-
- spec/lib/oauth/client_credentials/issuer_spec.rb
|
557
|
-
- spec/lib/oauth/client_credentials/validation_spec.rb
|
558
|
-
- spec/lib/oauth/client_credentials_integration_spec.rb
|
559
|
-
- spec/lib/oauth/client_credentials_request_spec.rb
|
560
|
-
- spec/lib/oauth/client_spec.rb
|
561
|
-
- spec/lib/oauth/code_request_spec.rb
|
562
|
-
- spec/lib/oauth/code_response_spec.rb
|
563
|
-
- spec/lib/oauth/error_response_spec.rb
|
564
|
-
- spec/lib/oauth/error_spec.rb
|
565
|
-
- spec/lib/oauth/forbidden_token_response_spec.rb
|
566
|
-
- spec/lib/oauth/helpers/scope_checker_spec.rb
|
567
|
-
- spec/lib/oauth/helpers/unique_token_spec.rb
|
568
|
-
- spec/lib/oauth/helpers/uri_checker_spec.rb
|
569
|
-
- spec/lib/oauth/invalid_request_response_spec.rb
|
570
|
-
- spec/lib/oauth/invalid_token_response_spec.rb
|
571
|
-
- spec/lib/oauth/password_access_token_request_spec.rb
|
572
|
-
- spec/lib/oauth/pre_authorization_spec.rb
|
573
|
-
- spec/lib/oauth/refresh_token_request_spec.rb
|
574
|
-
- spec/lib/oauth/scopes_spec.rb
|
575
|
-
- spec/lib/oauth/token_request_spec.rb
|
576
|
-
- spec/lib/oauth/token_response_spec.rb
|
577
|
-
- spec/lib/oauth/token_spec.rb
|
578
|
-
- spec/lib/request/strategy_spec.rb
|
579
|
-
- spec/lib/secret_storing/base_spec.rb
|
580
|
-
- spec/lib/secret_storing/bcrypt_spec.rb
|
581
|
-
- spec/lib/secret_storing/plain_spec.rb
|
582
|
-
- spec/lib/secret_storing/sha256_hash_spec.rb
|
583
|
-
- spec/lib/server_spec.rb
|
584
|
-
- spec/lib/stale_records_cleaner_spec.rb
|
585
|
-
- spec/models/doorkeeper/access_grant_spec.rb
|
586
|
-
- spec/models/doorkeeper/access_token_spec.rb
|
587
|
-
- spec/models/doorkeeper/application_spec.rb
|
588
|
-
- spec/requests/applications/applications_request_spec.rb
|
589
|
-
- spec/requests/applications/authorized_applications_spec.rb
|
590
|
-
- spec/requests/endpoints/authorization_spec.rb
|
591
|
-
- spec/requests/endpoints/token_spec.rb
|
592
|
-
- spec/requests/flows/authorization_code_errors_spec.rb
|
593
|
-
- spec/requests/flows/authorization_code_spec.rb
|
594
|
-
- spec/requests/flows/client_credentials_spec.rb
|
595
|
-
- spec/requests/flows/implicit_grant_errors_spec.rb
|
596
|
-
- spec/requests/flows/implicit_grant_spec.rb
|
597
|
-
- spec/requests/flows/password_spec.rb
|
598
|
-
- spec/requests/flows/refresh_token_spec.rb
|
599
|
-
- spec/requests/flows/revoke_token_spec.rb
|
600
|
-
- spec/requests/flows/skip_authorization_spec.rb
|
601
|
-
- spec/requests/protected_resources/metal_spec.rb
|
602
|
-
- spec/requests/protected_resources/private_api_spec.rb
|
603
|
-
- spec/routing/custom_controller_routes_spec.rb
|
604
|
-
- spec/routing/default_routes_spec.rb
|
605
|
-
- spec/routing/scoped_routes_spec.rb
|
606
|
-
- spec/spec_helper.rb
|
607
|
-
- spec/spec_helper_integration.rb
|
608
|
-
- spec/support/dependencies/factory_bot.rb
|
609
|
-
- spec/support/doorkeeper_rspec.rb
|
610
|
-
- spec/support/helpers/access_token_request_helper.rb
|
611
|
-
- spec/support/helpers/authorization_request_helper.rb
|
612
|
-
- spec/support/helpers/config_helper.rb
|
613
|
-
- spec/support/helpers/model_helper.rb
|
614
|
-
- spec/support/helpers/request_spec_helper.rb
|
615
|
-
- spec/support/helpers/url_helper.rb
|
616
|
-
- spec/support/orm/active_record.rb
|
617
|
-
- spec/support/shared/controllers_shared_context.rb
|
618
|
-
- spec/support/shared/hashing_shared_context.rb
|
619
|
-
- spec/support/shared/models_shared_examples.rb
|
620
|
-
- spec/validators/redirect_uri_validator_spec.rb
|
621
|
-
- spec/version/version_spec.rb
|
343
|
+
test_files: []
|