doorkeeper 5.3.2 → 5.4.0

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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +84 -2
  3. data/README.md +6 -4
  4. data/app/controllers/doorkeeper/applications_controller.rb +4 -4
  5. data/app/controllers/doorkeeper/authorizations_controller.rb +31 -12
  6. data/app/controllers/doorkeeper/authorized_applications_controller.rb +2 -2
  7. data/app/controllers/doorkeeper/tokens_controller.rb +57 -20
  8. data/app/views/doorkeeper/applications/_form.html.erb +1 -1
  9. data/app/views/doorkeeper/applications/show.html.erb +19 -2
  10. data/config/locales/en.yml +3 -1
  11. data/lib/doorkeeper.rb +106 -79
  12. data/lib/doorkeeper/config.rb +64 -35
  13. data/lib/doorkeeper/config/abstract_builder.rb +28 -0
  14. data/lib/doorkeeper/config/option.rb +28 -14
  15. data/lib/doorkeeper/engine.rb +1 -1
  16. data/lib/doorkeeper/grape/helpers.rb +1 -1
  17. data/lib/doorkeeper/helpers/controller.rb +4 -4
  18. data/lib/doorkeeper/models/access_grant_mixin.rb +20 -16
  19. data/lib/doorkeeper/models/access_token_mixin.rb +108 -45
  20. data/lib/doorkeeper/models/application_mixin.rb +5 -4
  21. data/lib/doorkeeper/models/concerns/resource_ownerable.rb +47 -0
  22. data/lib/doorkeeper/models/concerns/revocable.rb +1 -1
  23. data/lib/doorkeeper/models/concerns/scopes.rb +5 -1
  24. data/lib/doorkeeper/models/concerns/secret_storable.rb +1 -3
  25. data/lib/doorkeeper/oauth/authorization/code.rb +15 -6
  26. data/lib/doorkeeper/oauth/authorization/context.rb +2 -2
  27. data/lib/doorkeeper/oauth/authorization/token.rb +8 -12
  28. data/lib/doorkeeper/oauth/authorization/uri_builder.rb +4 -4
  29. data/lib/doorkeeper/oauth/authorization_code_request.rb +18 -8
  30. data/lib/doorkeeper/oauth/base_request.rb +11 -19
  31. data/lib/doorkeeper/oauth/client.rb +1 -1
  32. data/lib/doorkeeper/oauth/client/credentials.rb +2 -4
  33. data/lib/doorkeeper/oauth/client_credentials/creator.rb +26 -8
  34. data/lib/doorkeeper/oauth/client_credentials/issuer.rb +3 -2
  35. data/lib/doorkeeper/oauth/client_credentials/validator.rb +4 -2
  36. data/lib/doorkeeper/oauth/client_credentials_request.rb +8 -7
  37. data/lib/doorkeeper/oauth/code_request.rb +3 -3
  38. data/lib/doorkeeper/oauth/code_response.rb +6 -2
  39. data/lib/doorkeeper/oauth/error_response.rb +2 -4
  40. data/lib/doorkeeper/oauth/helpers/scope_checker.rb +1 -5
  41. data/lib/doorkeeper/oauth/hooks/context.rb +21 -0
  42. data/lib/doorkeeper/oauth/invalid_token_response.rb +2 -2
  43. data/lib/doorkeeper/oauth/password_access_token_request.rb +4 -6
  44. data/lib/doorkeeper/oauth/pre_authorization.rb +36 -30
  45. data/lib/doorkeeper/oauth/refresh_token_request.rb +18 -22
  46. data/lib/doorkeeper/oauth/token.rb +5 -6
  47. data/lib/doorkeeper/oauth/token_introspection.rb +4 -8
  48. data/lib/doorkeeper/oauth/token_request.rb +3 -3
  49. data/lib/doorkeeper/oauth/token_response.rb +1 -1
  50. data/lib/doorkeeper/orm/active_record.rb +10 -2
  51. data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +8 -3
  52. data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +7 -3
  53. data/lib/doorkeeper/orm/active_record/mixins/application.rb +20 -16
  54. data/lib/doorkeeper/rails/routes.rb +13 -17
  55. data/lib/doorkeeper/rails/routes/abstract_router.rb +35 -0
  56. data/lib/doorkeeper/rails/routes/mapper.rb +2 -2
  57. data/lib/doorkeeper/rails/routes/registry.rb +45 -0
  58. data/lib/doorkeeper/request/refresh_token.rb +2 -1
  59. data/lib/doorkeeper/request/strategy.rb +2 -2
  60. data/lib/doorkeeper/server.rb +4 -4
  61. data/lib/doorkeeper/stale_records_cleaner.rb +4 -4
  62. data/lib/doorkeeper/version.rb +2 -2
  63. data/lib/generators/doorkeeper/confidential_applications_generator.rb +1 -1
  64. data/lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb +39 -0
  65. data/lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb +2 -0
  66. data/lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb +2 -0
  67. data/lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb +2 -0
  68. data/lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb +17 -0
  69. data/lib/generators/doorkeeper/templates/initializer.rb +39 -3
  70. data/lib/generators/doorkeeper/templates/migration.rb.erb +14 -5
  71. metadata +12 -295
  72. data/Appraisals +0 -40
  73. data/CODE_OF_CONDUCT.md +0 -46
  74. data/CONTRIBUTING.md +0 -49
  75. data/Dangerfile +0 -67
  76. data/Dockerfile +0 -29
  77. data/Gemfile +0 -25
  78. data/NEWS.md +0 -1
  79. data/RELEASING.md +0 -11
  80. data/Rakefile +0 -28
  81. data/SECURITY.md +0 -15
  82. data/UPGRADE.md +0 -2
  83. data/bin/console +0 -16
  84. data/doorkeeper.gemspec +0 -42
  85. data/gemfiles/rails_5_0.gemfile +0 -18
  86. data/gemfiles/rails_5_1.gemfile +0 -18
  87. data/gemfiles/rails_5_2.gemfile +0 -18
  88. data/gemfiles/rails_6_0.gemfile +0 -18
  89. data/gemfiles/rails_master.gemfile +0 -18
  90. data/spec/controllers/application_metal_controller_spec.rb +0 -64
  91. data/spec/controllers/applications_controller_spec.rb +0 -274
  92. data/spec/controllers/authorizations_controller_spec.rb +0 -608
  93. data/spec/controllers/protected_resources_controller_spec.rb +0 -361
  94. data/spec/controllers/token_info_controller_spec.rb +0 -50
  95. data/spec/controllers/tokens_controller_spec.rb +0 -498
  96. data/spec/dummy/Rakefile +0 -9
  97. data/spec/dummy/app/assets/config/manifest.js +0 -2
  98. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  99. data/spec/dummy/app/controllers/custom_authorizations_controller.rb +0 -9
  100. data/spec/dummy/app/controllers/full_protected_resources_controller.rb +0 -14
  101. data/spec/dummy/app/controllers/home_controller.rb +0 -18
  102. data/spec/dummy/app/controllers/metal_controller.rb +0 -13
  103. data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +0 -13
  104. data/spec/dummy/app/helpers/application_helper.rb +0 -7
  105. data/spec/dummy/app/models/user.rb +0 -7
  106. data/spec/dummy/app/views/home/index.html.erb +0 -0
  107. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  108. data/spec/dummy/config.ru +0 -6
  109. data/spec/dummy/config/application.rb +0 -49
  110. data/spec/dummy/config/boot.rb +0 -7
  111. data/spec/dummy/config/database.yml +0 -15
  112. data/spec/dummy/config/environment.rb +0 -5
  113. data/spec/dummy/config/environments/development.rb +0 -31
  114. data/spec/dummy/config/environments/production.rb +0 -64
  115. data/spec/dummy/config/environments/test.rb +0 -45
  116. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -9
  117. data/spec/dummy/config/initializers/doorkeeper.rb +0 -166
  118. data/spec/dummy/config/initializers/secret_token.rb +0 -10
  119. data/spec/dummy/config/initializers/session_store.rb +0 -10
  120. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -16
  121. data/spec/dummy/config/locales/doorkeeper.en.yml +0 -5
  122. data/spec/dummy/config/routes.rb +0 -13
  123. data/spec/dummy/db/migrate/20111122132257_create_users.rb +0 -11
  124. data/spec/dummy/db/migrate/20120312140401_add_password_to_users.rb +0 -7
  125. data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +0 -69
  126. data/spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb +0 -9
  127. data/spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb +0 -13
  128. data/spec/dummy/db/migrate/20170822064514_enable_pkce.rb +0 -8
  129. data/spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb +0 -13
  130. data/spec/dummy/db/schema.rb +0 -68
  131. data/spec/dummy/public/404.html +0 -26
  132. data/spec/dummy/public/422.html +0 -26
  133. data/spec/dummy/public/500.html +0 -26
  134. data/spec/dummy/public/favicon.ico +0 -0
  135. data/spec/dummy/script/rails +0 -9
  136. data/spec/factories.rb +0 -30
  137. data/spec/generators/application_owner_generator_spec.rb +0 -28
  138. data/spec/generators/confidential_applications_generator_spec.rb +0 -29
  139. data/spec/generators/install_generator_spec.rb +0 -36
  140. data/spec/generators/migration_generator_spec.rb +0 -28
  141. data/spec/generators/pkce_generator_spec.rb +0 -28
  142. data/spec/generators/previous_refresh_token_generator_spec.rb +0 -44
  143. data/spec/generators/templates/routes.rb +0 -4
  144. data/spec/generators/views_generator_spec.rb +0 -29
  145. data/spec/grape/grape_integration_spec.rb +0 -137
  146. data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +0 -26
  147. data/spec/lib/config_spec.rb +0 -809
  148. data/spec/lib/doorkeeper_spec.rb +0 -27
  149. data/spec/lib/models/expirable_spec.rb +0 -61
  150. data/spec/lib/models/reusable_spec.rb +0 -40
  151. data/spec/lib/models/revocable_spec.rb +0 -59
  152. data/spec/lib/models/scopes_spec.rb +0 -53
  153. data/spec/lib/models/secret_storable_spec.rb +0 -135
  154. data/spec/lib/oauth/authorization/uri_builder_spec.rb +0 -39
  155. data/spec/lib/oauth/authorization_code_request_spec.rb +0 -170
  156. data/spec/lib/oauth/base_request_spec.rb +0 -224
  157. data/spec/lib/oauth/base_response_spec.rb +0 -45
  158. data/spec/lib/oauth/client/credentials_spec.rb +0 -90
  159. data/spec/lib/oauth/client_credentials/creator_spec.rb +0 -134
  160. data/spec/lib/oauth/client_credentials/issuer_spec.rb +0 -112
  161. data/spec/lib/oauth/client_credentials/validation_spec.rb +0 -59
  162. data/spec/lib/oauth/client_credentials_integration_spec.rb +0 -27
  163. data/spec/lib/oauth/client_credentials_request_spec.rb +0 -107
  164. data/spec/lib/oauth/client_spec.rb +0 -38
  165. data/spec/lib/oauth/code_request_spec.rb +0 -46
  166. data/spec/lib/oauth/code_response_spec.rb +0 -32
  167. data/spec/lib/oauth/error_response_spec.rb +0 -64
  168. data/spec/lib/oauth/error_spec.rb +0 -21
  169. data/spec/lib/oauth/forbidden_token_response_spec.rb +0 -20
  170. data/spec/lib/oauth/helpers/scope_checker_spec.rb +0 -110
  171. data/spec/lib/oauth/helpers/unique_token_spec.rb +0 -21
  172. data/spec/lib/oauth/helpers/uri_checker_spec.rb +0 -262
  173. data/spec/lib/oauth/invalid_request_response_spec.rb +0 -73
  174. data/spec/lib/oauth/invalid_token_response_spec.rb +0 -53
  175. data/spec/lib/oauth/password_access_token_request_spec.rb +0 -190
  176. data/spec/lib/oauth/pre_authorization_spec.rb +0 -223
  177. data/spec/lib/oauth/refresh_token_request_spec.rb +0 -177
  178. data/spec/lib/oauth/scopes_spec.rb +0 -146
  179. data/spec/lib/oauth/token_request_spec.rb +0 -157
  180. data/spec/lib/oauth/token_response_spec.rb +0 -84
  181. data/spec/lib/oauth/token_spec.rb +0 -156
  182. data/spec/lib/request/strategy_spec.rb +0 -54
  183. data/spec/lib/secret_storing/base_spec.rb +0 -60
  184. data/spec/lib/secret_storing/bcrypt_spec.rb +0 -49
  185. data/spec/lib/secret_storing/plain_spec.rb +0 -44
  186. data/spec/lib/secret_storing/sha256_hash_spec.rb +0 -48
  187. data/spec/lib/server_spec.rb +0 -49
  188. data/spec/lib/stale_records_cleaner_spec.rb +0 -89
  189. data/spec/models/doorkeeper/access_grant_spec.rb +0 -161
  190. data/spec/models/doorkeeper/access_token_spec.rb +0 -622
  191. data/spec/models/doorkeeper/application_spec.rb +0 -482
  192. data/spec/requests/applications/applications_request_spec.rb +0 -259
  193. data/spec/requests/applications/authorized_applications_spec.rb +0 -32
  194. data/spec/requests/endpoints/authorization_spec.rb +0 -91
  195. data/spec/requests/endpoints/token_spec.rb +0 -75
  196. data/spec/requests/flows/authorization_code_errors_spec.rb +0 -79
  197. data/spec/requests/flows/authorization_code_spec.rb +0 -525
  198. data/spec/requests/flows/client_credentials_spec.rb +0 -166
  199. data/spec/requests/flows/implicit_grant_errors_spec.rb +0 -46
  200. data/spec/requests/flows/implicit_grant_spec.rb +0 -91
  201. data/spec/requests/flows/password_spec.rb +0 -316
  202. data/spec/requests/flows/refresh_token_spec.rb +0 -233
  203. data/spec/requests/flows/revoke_token_spec.rb +0 -157
  204. data/spec/requests/flows/skip_authorization_spec.rb +0 -66
  205. data/spec/requests/protected_resources/metal_spec.rb +0 -16
  206. data/spec/requests/protected_resources/private_api_spec.rb +0 -83
  207. data/spec/routing/custom_controller_routes_spec.rb +0 -133
  208. data/spec/routing/default_routes_spec.rb +0 -41
  209. data/spec/routing/scoped_routes_spec.rb +0 -47
  210. data/spec/spec_helper.rb +0 -54
  211. data/spec/spec_helper_integration.rb +0 -4
  212. data/spec/support/dependencies/factory_bot.rb +0 -4
  213. data/spec/support/doorkeeper_rspec.rb +0 -22
  214. data/spec/support/helpers/access_token_request_helper.rb +0 -13
  215. data/spec/support/helpers/authorization_request_helper.rb +0 -43
  216. data/spec/support/helpers/config_helper.rb +0 -11
  217. data/spec/support/helpers/model_helper.rb +0 -78
  218. data/spec/support/helpers/request_spec_helper.rb +0 -110
  219. data/spec/support/helpers/url_helper.rb +0 -62
  220. data/spec/support/orm/active_record.rb +0 -5
  221. data/spec/support/shared/controllers_shared_context.rb +0 -133
  222. data/spec/support/shared/hashing_shared_context.rb +0 -36
  223. data/spec/support/shared/models_shared_examples.rb +0 -54
  224. data/spec/validators/redirect_uri_validator_spec.rb +0 -183
  225. data/spec/version/version_spec.rb +0 -17
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddOwnerToApplication < ActiveRecord::Migration<%= migration_version %>
2
4
  def change
3
5
  add_column :oauth_applications, :owner_id, :integer, null: true
@@ -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.
@@ -360,6 +377,17 @@ Doorkeeper.configure do
360
377
  # client.grant_flows.include?(grant_flow)
361
378
  # end
362
379
 
380
+ # If you need arbitrary Resource Owner-Client authorization you can enable this option
381
+ # and implement the check your need. Config option must respond to #call and return
382
+ # true in case resource owner authorized for the specific application or false in other
383
+ # cases.
384
+ #
385
+ # Be default all Resource Owners are authorized to any Client (application).
386
+ #
387
+ # authorize_resource_owner_for_client do |client, resource_owner|
388
+ # resource_owner.admin? || client.owners_whitelist.include?(resource_owner)
389
+ # end
390
+
363
391
  # Hook into the strategies' request & response life-cycle in case your
364
392
  # application needs advanced customization or logging:
365
393
  #
@@ -372,17 +400,25 @@ Doorkeeper.configure do
372
400
  # end
373
401
 
374
402
  # Hook into Authorization flow in order to implement Single Sign Out
375
- # or add any other functionality.
403
+ # or add any other functionality. Inside the block you have an access
404
+ # to `controller` (authorizations controller instance) and `context`
405
+ # (Doorkeeper::OAuth::Hooks::Context instance) which provides pre auth
406
+ # or auth objects with issued token based on hook type (before or after).
376
407
  #
377
- # before_successful_authorization do |controller|
408
+ # before_successful_authorization do |controller, context|
378
409
  # Rails.logger.info(controller.request.params.inspect)
410
+ #
411
+ # Rails.logger.info(context.pre_auth.inspect)
379
412
  # end
380
413
  #
381
- # after_successful_authorization do |controller|
414
+ # after_successful_authorization do |controller, context|
382
415
  # controller.session[:logout_urls] <<
383
416
  # Doorkeeper::Application
384
417
  # .find_by(controller.request.params.slice(:redirect_uri))
385
418
  # .logout_uri
419
+ #
420
+ # Rails.logger.info(context.auth.inspect)
421
+ # Rails.logger.info(context.issued_token)
386
422
  # end
387
423
 
388
424
  # 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.2
4
+ version: 5.4.0
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-02 00:00:00.000000000 Z
14
+ date: 2020-05-11 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
@@ -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,16 +200,10 @@ 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
225
208
  - lib/doorkeeper/engine.rb
226
209
  - lib/doorkeeper/errors.rb
@@ -234,6 +217,7 @@ files:
234
217
  - lib/doorkeeper/models/concerns/expirable.rb
235
218
  - lib/doorkeeper/models/concerns/orderable.rb
236
219
  - lib/doorkeeper/models/concerns/ownership.rb
220
+ - lib/doorkeeper/models/concerns/resource_ownerable.rb
237
221
  - lib/doorkeeper/models/concerns/reusable.rb
238
222
  - lib/doorkeeper/models/concerns/revocable.rb
239
223
  - lib/doorkeeper/models/concerns/scopes.rb
@@ -260,6 +244,7 @@ files:
260
244
  - lib/doorkeeper/oauth/helpers/scope_checker.rb
261
245
  - lib/doorkeeper/oauth/helpers/unique_token.rb
262
246
  - lib/doorkeeper/oauth/helpers/uri_checker.rb
247
+ - lib/doorkeeper/oauth/hooks/context.rb
263
248
  - lib/doorkeeper/oauth/invalid_request_response.rb
264
249
  - lib/doorkeeper/oauth/invalid_token_response.rb
265
250
  - lib/doorkeeper/oauth/nonstandard.rb
@@ -282,8 +267,10 @@ files:
282
267
  - lib/doorkeeper/orm/active_record/stale_records_cleaner.rb
283
268
  - lib/doorkeeper/rails/helpers.rb
284
269
  - lib/doorkeeper/rails/routes.rb
270
+ - lib/doorkeeper/rails/routes/abstract_router.rb
285
271
  - lib/doorkeeper/rails/routes/mapper.rb
286
272
  - lib/doorkeeper/rails/routes/mapping.rb
273
+ - lib/doorkeeper/rails/routes/registry.rb
287
274
  - lib/doorkeeper/rake.rb
288
275
  - lib/doorkeeper/rake/db.rake
289
276
  - lib/doorkeeper/rake/setup.rake
@@ -305,6 +292,7 @@ files:
305
292
  - lib/doorkeeper/version.rb
306
293
  - lib/generators/doorkeeper/application_owner_generator.rb
307
294
  - lib/generators/doorkeeper/confidential_applications_generator.rb
295
+ - lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb
308
296
  - lib/generators/doorkeeper/install_generator.rb
309
297
  - lib/generators/doorkeeper/migration_generator.rb
310
298
  - lib/generators/doorkeeper/pkce_generator.rb
@@ -314,145 +302,10 @@ files:
314
302
  - lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb
315
303
  - lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb
316
304
  - lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb
305
+ - lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb
317
306
  - lib/generators/doorkeeper/templates/initializer.rb
318
307
  - lib/generators/doorkeeper/templates/migration.rb.erb
319
308
  - 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
309
  - vendor/assets/stylesheets/doorkeeper/bootstrap.min.css
457
310
  homepage: https://github.com/doorkeeper-gem/doorkeeper
458
311
  licenses:
@@ -482,140 +335,4 @@ rubygems_version: 3.0.2
482
335
  signing_key:
483
336
  specification_version: 4
484
337
  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
338
+ test_files: []