doorkeeper 5.3.3 → 5.5.0.rc2

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.

Files changed (233) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +125 -7
  3. data/README.md +6 -4
  4. data/app/controllers/doorkeeper/applications_controller.rb +4 -4
  5. data/app/controllers/doorkeeper/authorizations_controller.rb +46 -16
  6. data/app/controllers/doorkeeper/authorized_applications_controller.rb +2 -2
  7. data/app/controllers/doorkeeper/tokens_controller.rb +67 -22
  8. data/app/views/doorkeeper/applications/_form.html.erb +1 -1
  9. data/app/views/doorkeeper/applications/show.html.erb +35 -14
  10. data/app/views/doorkeeper/authorizations/form_post.html.erb +11 -0
  11. data/config/locales/en.yml +6 -2
  12. data/lib/doorkeeper.rb +111 -79
  13. data/lib/doorkeeper/config.rb +148 -94
  14. data/lib/doorkeeper/config/abstract_builder.rb +28 -0
  15. data/lib/doorkeeper/config/option.rb +26 -14
  16. data/lib/doorkeeper/config/validations.rb +53 -0
  17. data/lib/doorkeeper/engine.rb +1 -1
  18. data/lib/doorkeeper/grant_flow.rb +45 -0
  19. data/lib/doorkeeper/grant_flow/fallback_flow.rb +15 -0
  20. data/lib/doorkeeper/grant_flow/flow.rb +44 -0
  21. data/lib/doorkeeper/grant_flow/registry.rb +50 -0
  22. data/lib/doorkeeper/grape/helpers.rb +1 -1
  23. data/lib/doorkeeper/helpers/controller.rb +8 -4
  24. data/lib/doorkeeper/models/access_grant_mixin.rb +21 -18
  25. data/lib/doorkeeper/models/access_token_mixin.rb +110 -47
  26. data/lib/doorkeeper/models/application_mixin.rb +5 -4
  27. data/lib/doorkeeper/models/concerns/resource_ownerable.rb +47 -0
  28. data/lib/doorkeeper/models/concerns/revocable.rb +1 -1
  29. data/lib/doorkeeper/models/concerns/scopes.rb +5 -1
  30. data/lib/doorkeeper/models/concerns/secret_storable.rb +1 -3
  31. data/lib/doorkeeper/oauth/authorization/code.rb +19 -6
  32. data/lib/doorkeeper/oauth/authorization/context.rb +5 -5
  33. data/lib/doorkeeper/oauth/authorization/token.rb +18 -16
  34. data/lib/doorkeeper/oauth/authorization/uri_builder.rb +4 -4
  35. data/lib/doorkeeper/oauth/authorization_code_request.rb +17 -14
  36. data/lib/doorkeeper/oauth/base_request.rb +12 -20
  37. data/lib/doorkeeper/oauth/client.rb +1 -1
  38. data/lib/doorkeeper/oauth/client/credentials.rb +2 -4
  39. data/lib/doorkeeper/oauth/client_credentials/creator.rb +27 -8
  40. data/lib/doorkeeper/oauth/client_credentials/issuer.rb +4 -2
  41. data/lib/doorkeeper/oauth/client_credentials/validator.rb +4 -2
  42. data/lib/doorkeeper/oauth/client_credentials_request.rb +8 -7
  43. data/lib/doorkeeper/oauth/code_request.rb +3 -3
  44. data/lib/doorkeeper/oauth/code_response.rb +22 -12
  45. data/lib/doorkeeper/oauth/error_response.rb +6 -7
  46. data/lib/doorkeeper/oauth/helpers/scope_checker.rb +2 -8
  47. data/lib/doorkeeper/oauth/hooks/context.rb +21 -0
  48. data/lib/doorkeeper/oauth/invalid_token_response.rb +2 -2
  49. data/lib/doorkeeper/oauth/password_access_token_request.rb +24 -7
  50. data/lib/doorkeeper/oauth/pre_authorization.rb +63 -32
  51. data/lib/doorkeeper/oauth/refresh_token_request.rb +31 -22
  52. data/lib/doorkeeper/oauth/token.rb +5 -6
  53. data/lib/doorkeeper/oauth/token_introspection.rb +4 -8
  54. data/lib/doorkeeper/oauth/token_request.rb +3 -3
  55. data/lib/doorkeeper/oauth/token_response.rb +1 -1
  56. data/lib/doorkeeper/orm/active_record.rb +14 -7
  57. data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +8 -3
  58. data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +7 -3
  59. data/lib/doorkeeper/orm/active_record/mixins/application.rb +6 -3
  60. data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +5 -0
  61. data/lib/doorkeeper/rails/routes.rb +14 -20
  62. data/lib/doorkeeper/rails/routes/abstract_router.rb +35 -0
  63. data/lib/doorkeeper/rails/routes/mapper.rb +2 -2
  64. data/lib/doorkeeper/rails/routes/registry.rb +45 -0
  65. data/lib/doorkeeper/request.rb +49 -12
  66. data/lib/doorkeeper/request/refresh_token.rb +2 -1
  67. data/lib/doorkeeper/request/strategy.rb +2 -2
  68. data/lib/doorkeeper/server.rb +4 -4
  69. data/lib/doorkeeper/stale_records_cleaner.rb +4 -4
  70. data/lib/doorkeeper/version.rb +3 -7
  71. data/lib/generators/doorkeeper/confidential_applications_generator.rb +1 -1
  72. data/lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb +39 -0
  73. data/lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb +3 -1
  74. data/lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb +2 -0
  75. data/lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb +2 -0
  76. data/lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb +17 -0
  77. data/lib/generators/doorkeeper/templates/initializer.rb +48 -10
  78. data/lib/generators/doorkeeper/templates/migration.rb.erb +14 -5
  79. metadata +30 -300
  80. data/Appraisals +0 -40
  81. data/CODE_OF_CONDUCT.md +0 -46
  82. data/CONTRIBUTING.md +0 -49
  83. data/Dangerfile +0 -67
  84. data/Dockerfile +0 -29
  85. data/Gemfile +0 -25
  86. data/NEWS.md +0 -1
  87. data/RELEASING.md +0 -11
  88. data/Rakefile +0 -28
  89. data/SECURITY.md +0 -15
  90. data/UPGRADE.md +0 -2
  91. data/bin/console +0 -16
  92. data/doorkeeper.gemspec +0 -42
  93. data/gemfiles/rails_5_0.gemfile +0 -18
  94. data/gemfiles/rails_5_1.gemfile +0 -18
  95. data/gemfiles/rails_5_2.gemfile +0 -18
  96. data/gemfiles/rails_6_0.gemfile +0 -18
  97. data/gemfiles/rails_master.gemfile +0 -18
  98. data/spec/controllers/application_metal_controller_spec.rb +0 -64
  99. data/spec/controllers/applications_controller_spec.rb +0 -274
  100. data/spec/controllers/authorizations_controller_spec.rb +0 -608
  101. data/spec/controllers/protected_resources_controller_spec.rb +0 -361
  102. data/spec/controllers/token_info_controller_spec.rb +0 -50
  103. data/spec/controllers/tokens_controller_spec.rb +0 -498
  104. data/spec/dummy/Rakefile +0 -9
  105. data/spec/dummy/app/assets/config/manifest.js +0 -2
  106. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  107. data/spec/dummy/app/controllers/custom_authorizations_controller.rb +0 -9
  108. data/spec/dummy/app/controllers/full_protected_resources_controller.rb +0 -14
  109. data/spec/dummy/app/controllers/home_controller.rb +0 -18
  110. data/spec/dummy/app/controllers/metal_controller.rb +0 -13
  111. data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +0 -13
  112. data/spec/dummy/app/helpers/application_helper.rb +0 -7
  113. data/spec/dummy/app/models/user.rb +0 -7
  114. data/spec/dummy/app/views/home/index.html.erb +0 -0
  115. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  116. data/spec/dummy/config.ru +0 -6
  117. data/spec/dummy/config/application.rb +0 -49
  118. data/spec/dummy/config/boot.rb +0 -7
  119. data/spec/dummy/config/database.yml +0 -15
  120. data/spec/dummy/config/environment.rb +0 -5
  121. data/spec/dummy/config/environments/development.rb +0 -31
  122. data/spec/dummy/config/environments/production.rb +0 -64
  123. data/spec/dummy/config/environments/test.rb +0 -45
  124. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -9
  125. data/spec/dummy/config/initializers/doorkeeper.rb +0 -166
  126. data/spec/dummy/config/initializers/secret_token.rb +0 -10
  127. data/spec/dummy/config/initializers/session_store.rb +0 -10
  128. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -16
  129. data/spec/dummy/config/locales/doorkeeper.en.yml +0 -5
  130. data/spec/dummy/config/routes.rb +0 -13
  131. data/spec/dummy/db/migrate/20111122132257_create_users.rb +0 -11
  132. data/spec/dummy/db/migrate/20120312140401_add_password_to_users.rb +0 -7
  133. data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +0 -69
  134. data/spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb +0 -9
  135. data/spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb +0 -13
  136. data/spec/dummy/db/migrate/20170822064514_enable_pkce.rb +0 -8
  137. data/spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb +0 -13
  138. data/spec/dummy/db/schema.rb +0 -68
  139. data/spec/dummy/public/404.html +0 -26
  140. data/spec/dummy/public/422.html +0 -26
  141. data/spec/dummy/public/500.html +0 -26
  142. data/spec/dummy/public/favicon.ico +0 -0
  143. data/spec/dummy/script/rails +0 -9
  144. data/spec/factories.rb +0 -30
  145. data/spec/generators/application_owner_generator_spec.rb +0 -28
  146. data/spec/generators/confidential_applications_generator_spec.rb +0 -29
  147. data/spec/generators/install_generator_spec.rb +0 -36
  148. data/spec/generators/migration_generator_spec.rb +0 -28
  149. data/spec/generators/pkce_generator_spec.rb +0 -28
  150. data/spec/generators/previous_refresh_token_generator_spec.rb +0 -44
  151. data/spec/generators/templates/routes.rb +0 -4
  152. data/spec/generators/views_generator_spec.rb +0 -29
  153. data/spec/grape/grape_integration_spec.rb +0 -137
  154. data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +0 -26
  155. data/spec/lib/config_spec.rb +0 -809
  156. data/spec/lib/doorkeeper_spec.rb +0 -27
  157. data/spec/lib/models/expirable_spec.rb +0 -61
  158. data/spec/lib/models/reusable_spec.rb +0 -40
  159. data/spec/lib/models/revocable_spec.rb +0 -59
  160. data/spec/lib/models/scopes_spec.rb +0 -53
  161. data/spec/lib/models/secret_storable_spec.rb +0 -135
  162. data/spec/lib/oauth/authorization/uri_builder_spec.rb +0 -39
  163. data/spec/lib/oauth/authorization_code_request_spec.rb +0 -170
  164. data/spec/lib/oauth/base_request_spec.rb +0 -224
  165. data/spec/lib/oauth/base_response_spec.rb +0 -45
  166. data/spec/lib/oauth/client/credentials_spec.rb +0 -90
  167. data/spec/lib/oauth/client_credentials/creator_spec.rb +0 -134
  168. data/spec/lib/oauth/client_credentials/issuer_spec.rb +0 -112
  169. data/spec/lib/oauth/client_credentials/validation_spec.rb +0 -59
  170. data/spec/lib/oauth/client_credentials_integration_spec.rb +0 -27
  171. data/spec/lib/oauth/client_credentials_request_spec.rb +0 -107
  172. data/spec/lib/oauth/client_spec.rb +0 -38
  173. data/spec/lib/oauth/code_request_spec.rb +0 -46
  174. data/spec/lib/oauth/code_response_spec.rb +0 -32
  175. data/spec/lib/oauth/error_response_spec.rb +0 -64
  176. data/spec/lib/oauth/error_spec.rb +0 -21
  177. data/spec/lib/oauth/forbidden_token_response_spec.rb +0 -20
  178. data/spec/lib/oauth/helpers/scope_checker_spec.rb +0 -110
  179. data/spec/lib/oauth/helpers/unique_token_spec.rb +0 -21
  180. data/spec/lib/oauth/helpers/uri_checker_spec.rb +0 -262
  181. data/spec/lib/oauth/invalid_request_response_spec.rb +0 -73
  182. data/spec/lib/oauth/invalid_token_response_spec.rb +0 -53
  183. data/spec/lib/oauth/password_access_token_request_spec.rb +0 -190
  184. data/spec/lib/oauth/pre_authorization_spec.rb +0 -223
  185. data/spec/lib/oauth/refresh_token_request_spec.rb +0 -177
  186. data/spec/lib/oauth/scopes_spec.rb +0 -146
  187. data/spec/lib/oauth/token_request_spec.rb +0 -157
  188. data/spec/lib/oauth/token_response_spec.rb +0 -84
  189. data/spec/lib/oauth/token_spec.rb +0 -156
  190. data/spec/lib/request/strategy_spec.rb +0 -54
  191. data/spec/lib/secret_storing/base_spec.rb +0 -60
  192. data/spec/lib/secret_storing/bcrypt_spec.rb +0 -49
  193. data/spec/lib/secret_storing/plain_spec.rb +0 -44
  194. data/spec/lib/secret_storing/sha256_hash_spec.rb +0 -48
  195. data/spec/lib/server_spec.rb +0 -49
  196. data/spec/lib/stale_records_cleaner_spec.rb +0 -89
  197. data/spec/models/doorkeeper/access_grant_spec.rb +0 -161
  198. data/spec/models/doorkeeper/access_token_spec.rb +0 -622
  199. data/spec/models/doorkeeper/application_spec.rb +0 -482
  200. data/spec/requests/applications/applications_request_spec.rb +0 -259
  201. data/spec/requests/applications/authorized_applications_spec.rb +0 -32
  202. data/spec/requests/endpoints/authorization_spec.rb +0 -91
  203. data/spec/requests/endpoints/token_spec.rb +0 -75
  204. data/spec/requests/flows/authorization_code_errors_spec.rb +0 -79
  205. data/spec/requests/flows/authorization_code_spec.rb +0 -525
  206. data/spec/requests/flows/client_credentials_spec.rb +0 -166
  207. data/spec/requests/flows/implicit_grant_errors_spec.rb +0 -46
  208. data/spec/requests/flows/implicit_grant_spec.rb +0 -91
  209. data/spec/requests/flows/password_spec.rb +0 -316
  210. data/spec/requests/flows/refresh_token_spec.rb +0 -233
  211. data/spec/requests/flows/revoke_token_spec.rb +0 -157
  212. data/spec/requests/flows/skip_authorization_spec.rb +0 -66
  213. data/spec/requests/protected_resources/metal_spec.rb +0 -16
  214. data/spec/requests/protected_resources/private_api_spec.rb +0 -83
  215. data/spec/routing/custom_controller_routes_spec.rb +0 -133
  216. data/spec/routing/default_routes_spec.rb +0 -41
  217. data/spec/routing/scoped_routes_spec.rb +0 -47
  218. data/spec/spec_helper.rb +0 -54
  219. data/spec/spec_helper_integration.rb +0 -4
  220. data/spec/support/dependencies/factory_bot.rb +0 -4
  221. data/spec/support/doorkeeper_rspec.rb +0 -22
  222. data/spec/support/helpers/access_token_request_helper.rb +0 -13
  223. data/spec/support/helpers/authorization_request_helper.rb +0 -43
  224. data/spec/support/helpers/config_helper.rb +0 -11
  225. data/spec/support/helpers/model_helper.rb +0 -78
  226. data/spec/support/helpers/request_spec_helper.rb +0 -110
  227. data/spec/support/helpers/url_helper.rb +0 -62
  228. data/spec/support/orm/active_record.rb +0 -5
  229. data/spec/support/shared/controllers_shared_context.rb +0 -133
  230. data/spec/support/shared/hashing_shared_context.rb +0 -36
  231. data/spec/support/shared/models_shared_examples.rb +0 -54
  232. data/spec/validators/redirect_uri_validator_spec.rb +0 -183
  233. data/spec/version/version_spec.rb +0 -17
@@ -4,32 +4,69 @@ module Doorkeeper
4
4
  module Request
5
5
  class << self
6
6
  def authorization_strategy(response_type)
7
- build_strategy_class(response_type)
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
- get_strategy(grant_type, token_grant_types)
14
- rescue NameError
15
- raise Errors::InvalidTokenStrategy
16
- end
23
+ grant_flow = token_flows.detect do |flow|
24
+ flow.matches_grant_type?(grant_type)
25
+ end
17
26
 
18
- def get_strategy(grant_type, available)
19
- raise NameError unless available.include?(grant_type.to_s)
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
- build_strategy_class(grant_type)
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 token_grant_types
27
- Doorkeeper.config.token_grant_types
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
- def build_strategy_class(grant_or_request_type)
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
@@ -12,7 +12,8 @@ module Doorkeeper
12
12
  def request
13
13
  @request ||= OAuth::RefreshTokenRequest.new(
14
14
  Doorkeeper.config,
15
- refresh_token, credentials,
15
+ refresh_token,
16
+ credentials,
16
17
  parameters,
17
18
  )
18
19
  end
@@ -3,12 +3,12 @@
3
3
  module Doorkeeper
4
4
  module Request
5
5
  class Strategy
6
- attr_accessor :server
6
+ attr_reader :server
7
7
 
8
8
  delegate :authorize, to: :request
9
9
 
10
10
  def initialize(server)
11
- self.server = server
11
+ @server = server
12
12
  end
13
13
 
14
14
  def request
@@ -2,19 +2,19 @@
2
2
 
3
3
  module Doorkeeper
4
4
  class Server
5
- attr_accessor :context
5
+ attr_reader :context
6
6
 
7
- def initialize(context = nil)
7
+ def initialize(context)
8
8
  @context = context
9
9
  end
10
10
 
11
11
  def authorization_request(strategy)
12
- klass = Request.authorization_strategy 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 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
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Doorkeeper
4
- def self.gem_version
5
- Gem::Version.new VERSION::STRING
6
- end
7
-
8
4
  module VERSION
9
5
  # Semantic versioning
10
6
  MAJOR = 5
11
- MINOR = 3
12
- TINY = 3
13
- PRE = nil
7
+ MINOR = 5
8
+ TINY = 0
9
+ PRE = "rc2"
14
10
 
15
11
  # Full version number
16
12
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -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 pkce
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
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddOwnerToApplication < ActiveRecord::Migration<%= migration_version %>
2
4
  def change
3
- add_column :oauth_applications, :owner_id, :integer, null: true
5
+ add_column :oauth_applications, :owner_id, :bigint, null: true
4
6
  add_column :oauth_applications, :owner_type, :string, null: true
5
7
  add_index :oauth_applications, [:owner_id, :owner_type]
6
8
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddPreviousRefreshTokenToAccessTokens < ActiveRecord::Migration<%= migration_version %>
2
4
  def change
3
5
  add_column(
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class EnablePkce < ActiveRecord::Migration<%= migration_version %>
2
4
  def change
3
5
  add_column :oauth_access_grants, :code_challenge, :string, null: true
@@ -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.application.additional_settings.implicit_oauth_expiration
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 enabling the additional
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
- # fallback_to_plain_secrets
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
- # If there is a previous_refresh_token column,
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
- # previous tokens are revoked as soon as a new access token is created.
62
- # Comment out this line if you'd rather have refresh tokens
63
- # instantly revoked.
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.3.3
4
+ version: 5.5.0.rc2
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-05-07 00:00:00.000000000 Z
14
+ date: 2021-01-21 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: '6.0'
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: '6.0'
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: '5.0'
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: '5.0'
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
@@ -205,25 +194,25 @@ files:
205
194
  - app/views/doorkeeper/applications/new.html.erb
206
195
  - app/views/doorkeeper/applications/show.html.erb
207
196
  - app/views/doorkeeper/authorizations/error.html.erb
197
+ - app/views/doorkeeper/authorizations/form_post.html.erb
208
198
  - app/views/doorkeeper/authorizations/new.html.erb
209
199
  - app/views/doorkeeper/authorizations/show.html.erb
210
200
  - app/views/doorkeeper/authorized_applications/_delete_form.html.erb
211
201
  - app/views/doorkeeper/authorized_applications/index.html.erb
212
202
  - app/views/layouts/doorkeeper/admin.html.erb
213
203
  - app/views/layouts/doorkeeper/application.html.erb
214
- - bin/console
215
204
  - 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
205
  - lib/doorkeeper.rb
223
206
  - lib/doorkeeper/config.rb
207
+ - lib/doorkeeper/config/abstract_builder.rb
224
208
  - lib/doorkeeper/config/option.rb
209
+ - lib/doorkeeper/config/validations.rb
225
210
  - lib/doorkeeper/engine.rb
226
211
  - lib/doorkeeper/errors.rb
212
+ - lib/doorkeeper/grant_flow.rb
213
+ - lib/doorkeeper/grant_flow/fallback_flow.rb
214
+ - lib/doorkeeper/grant_flow/flow.rb
215
+ - lib/doorkeeper/grant_flow/registry.rb
227
216
  - lib/doorkeeper/grape/authorization_decorator.rb
228
217
  - lib/doorkeeper/grape/helpers.rb
229
218
  - lib/doorkeeper/helpers/controller.rb
@@ -234,6 +223,7 @@ files:
234
223
  - lib/doorkeeper/models/concerns/expirable.rb
235
224
  - lib/doorkeeper/models/concerns/orderable.rb
236
225
  - lib/doorkeeper/models/concerns/ownership.rb
226
+ - lib/doorkeeper/models/concerns/resource_ownerable.rb
237
227
  - lib/doorkeeper/models/concerns/reusable.rb
238
228
  - lib/doorkeeper/models/concerns/revocable.rb
239
229
  - lib/doorkeeper/models/concerns/scopes.rb
@@ -260,6 +250,7 @@ files:
260
250
  - lib/doorkeeper/oauth/helpers/scope_checker.rb
261
251
  - lib/doorkeeper/oauth/helpers/unique_token.rb
262
252
  - lib/doorkeeper/oauth/helpers/uri_checker.rb
253
+ - lib/doorkeeper/oauth/hooks/context.rb
263
254
  - lib/doorkeeper/oauth/invalid_request_response.rb
264
255
  - lib/doorkeeper/oauth/invalid_token_response.rb
265
256
  - lib/doorkeeper/oauth/nonstandard.rb
@@ -282,8 +273,10 @@ files:
282
273
  - lib/doorkeeper/orm/active_record/stale_records_cleaner.rb
283
274
  - lib/doorkeeper/rails/helpers.rb
284
275
  - lib/doorkeeper/rails/routes.rb
276
+ - lib/doorkeeper/rails/routes/abstract_router.rb
285
277
  - lib/doorkeeper/rails/routes/mapper.rb
286
278
  - lib/doorkeeper/rails/routes/mapping.rb
279
+ - lib/doorkeeper/rails/routes/registry.rb
287
280
  - lib/doorkeeper/rake.rb
288
281
  - lib/doorkeeper/rake/db.rake
289
282
  - lib/doorkeeper/rake/setup.rake
@@ -305,6 +298,7 @@ files:
305
298
  - lib/doorkeeper/version.rb
306
299
  - lib/generators/doorkeeper/application_owner_generator.rb
307
300
  - lib/generators/doorkeeper/confidential_applications_generator.rb
301
+ - lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb
308
302
  - lib/generators/doorkeeper/install_generator.rb
309
303
  - lib/generators/doorkeeper/migration_generator.rb
310
304
  - lib/generators/doorkeeper/pkce_generator.rb
@@ -314,145 +308,10 @@ files:
314
308
  - lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb
315
309
  - lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb
316
310
  - lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb
311
+ - lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
317
312
  - lib/generators/doorkeeper/templates/initializer.rb
318
313
  - lib/generators/doorkeeper/templates/migration.rb.erb
319
314
  - 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
315
  - vendor/assets/stylesheets/doorkeeper/bootstrap.min.css
457
316
  homepage: https://github.com/doorkeeper-gem/doorkeeper
458
317
  licenses:
@@ -463,7 +322,14 @@ metadata:
463
322
  source_code_uri: https://github.com/doorkeeper-gem/doorkeeper
464
323
  bug_tracker_uri: https://github.com/doorkeeper-gem/doorkeeper/issues
465
324
  documentation_uri: https://doorkeeper.gitbook.io/guides/
466
- post_install_message:
325
+ post_install_message: "Starting from 5.5.0.rc1 Doorkeeper requires client authentication
326
+ for Resource Owner Password Grant\nas stated in the OAuth RFC. You have to create
327
+ a new OAuth client (Doorkeeper::Application) if you didn't\nhave it before and use
328
+ client credentials in HTTP Basic auth if you previously used this grant flow without\nclient
329
+ authentication. \n\nTo opt out of this you could set the \"skip_client_authentication_for_password_grant\"
330
+ configuration option\nto \"true\", but note that this is in violation of the OAuth
331
+ spec and represents a security risk.\n\nRead https://github.com/doorkeeper-gem/doorkeeper/issues/561#issuecomment-612857163
332
+ for more details."
467
333
  rdoc_options: []
468
334
  require_paths:
469
335
  - lib
@@ -474,148 +340,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
474
340
  version: '2.4'
475
341
  required_rubygems_version: !ruby/object:Gem::Requirement
476
342
  requirements:
477
- - - ">="
343
+ - - ">"
478
344
  - !ruby/object:Gem::Version
479
- version: '0'
345
+ version: 1.3.1
480
346
  requirements: []
481
347
  rubygems_version: 3.1.2
482
348
  signing_key:
483
349
  specification_version: 4
484
350
  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
351
+ test_files: []