doorkeeper 4.2.6 → 5.5.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of doorkeeper might be problematic. Click here for more details.

Files changed (274) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1049 -0
  3. data/README.md +110 -353
  4. data/app/assets/stylesheets/doorkeeper/admin/application.css +2 -2
  5. data/app/controllers/doorkeeper/application_controller.rb +6 -7
  6. data/app/controllers/doorkeeper/application_metal_controller.rb +7 -11
  7. data/app/controllers/doorkeeper/applications_controller.rb +65 -16
  8. data/app/controllers/doorkeeper/authorizations_controller.rb +97 -17
  9. data/app/controllers/doorkeeper/authorized_applications_controller.rb +22 -3
  10. data/app/controllers/doorkeeper/token_info_controller.rb +16 -4
  11. data/app/controllers/doorkeeper/tokens_controller.rb +115 -38
  12. data/app/helpers/doorkeeper/dashboard_helper.rb +10 -6
  13. data/app/views/doorkeeper/applications/_delete_form.html.erb +3 -1
  14. data/app/views/doorkeeper/applications/_form.html.erb +33 -21
  15. data/app/views/doorkeeper/applications/edit.html.erb +1 -1
  16. data/app/views/doorkeeper/applications/index.html.erb +18 -6
  17. data/app/views/doorkeeper/applications/new.html.erb +1 -1
  18. data/app/views/doorkeeper/applications/show.html.erb +40 -16
  19. data/app/views/doorkeeper/authorizations/error.html.erb +1 -1
  20. data/app/views/doorkeeper/authorizations/form_post.html.erb +15 -0
  21. data/app/views/doorkeeper/authorizations/new.html.erb +6 -0
  22. data/app/views/doorkeeper/authorized_applications/index.html.erb +0 -1
  23. data/app/views/layouts/doorkeeper/admin.html.erb +16 -14
  24. data/config/locales/en.yml +34 -7
  25. data/lib/doorkeeper/config/abstract_builder.rb +28 -0
  26. data/lib/doorkeeper/config/option.rb +82 -0
  27. data/lib/doorkeeper/config/validations.rb +53 -0
  28. data/lib/doorkeeper/config.rb +514 -167
  29. data/lib/doorkeeper/engine.rb +11 -5
  30. data/lib/doorkeeper/errors.rb +25 -16
  31. data/lib/doorkeeper/grant_flow/fallback_flow.rb +15 -0
  32. data/lib/doorkeeper/grant_flow/flow.rb +44 -0
  33. data/lib/doorkeeper/grant_flow/registry.rb +50 -0
  34. data/lib/doorkeeper/grant_flow.rb +45 -0
  35. data/lib/doorkeeper/grape/authorization_decorator.rb +6 -4
  36. data/lib/doorkeeper/grape/helpers.rb +23 -12
  37. data/lib/doorkeeper/helpers/controller.rb +51 -14
  38. data/lib/doorkeeper/models/access_grant_mixin.rb +94 -27
  39. data/lib/doorkeeper/models/access_token_mixin.rb +284 -96
  40. data/lib/doorkeeper/models/application_mixin.rb +58 -27
  41. data/lib/doorkeeper/models/concerns/accessible.rb +2 -0
  42. data/lib/doorkeeper/models/concerns/expirable.rb +12 -6
  43. data/lib/doorkeeper/models/concerns/orderable.rb +15 -0
  44. data/lib/doorkeeper/models/concerns/ownership.rb +4 -7
  45. data/lib/doorkeeper/models/concerns/resource_ownerable.rb +47 -0
  46. data/lib/doorkeeper/models/concerns/reusable.rb +19 -0
  47. data/lib/doorkeeper/models/concerns/revocable.rb +3 -27
  48. data/lib/doorkeeper/models/concerns/scopes.rb +12 -2
  49. data/lib/doorkeeper/models/concerns/secret_storable.rb +106 -0
  50. data/lib/doorkeeper/oauth/authorization/code.rb +48 -12
  51. data/lib/doorkeeper/oauth/authorization/context.rb +17 -0
  52. data/lib/doorkeeper/oauth/authorization/token.rb +66 -28
  53. data/lib/doorkeeper/oauth/authorization/uri_builder.rb +7 -5
  54. data/lib/doorkeeper/oauth/authorization_code_request.rb +63 -10
  55. data/lib/doorkeeper/oauth/base_request.rb +35 -19
  56. data/lib/doorkeeper/oauth/base_response.rb +2 -0
  57. data/lib/doorkeeper/oauth/client/credentials.rb +9 -7
  58. data/lib/doorkeeper/oauth/client.rb +10 -11
  59. data/lib/doorkeeper/oauth/client_credentials/creator.rb +47 -4
  60. data/lib/doorkeeper/oauth/client_credentials/issuer.rb +16 -9
  61. data/lib/doorkeeper/oauth/client_credentials/validator.rb +56 -0
  62. data/lib/doorkeeper/oauth/client_credentials_request.rb +10 -11
  63. data/lib/doorkeeper/oauth/code_request.rb +8 -12
  64. data/lib/doorkeeper/oauth/code_response.rb +27 -15
  65. data/lib/doorkeeper/oauth/error.rb +5 -3
  66. data/lib/doorkeeper/oauth/error_response.rb +35 -15
  67. data/lib/doorkeeper/oauth/forbidden_token_response.rb +11 -3
  68. data/lib/doorkeeper/oauth/helpers/scope_checker.rb +23 -18
  69. data/lib/doorkeeper/oauth/helpers/unique_token.rb +20 -3
  70. data/lib/doorkeeper/oauth/helpers/uri_checker.rb +53 -3
  71. data/lib/doorkeeper/oauth/hooks/context.rb +21 -0
  72. data/lib/doorkeeper/oauth/invalid_request_response.rb +43 -0
  73. data/lib/doorkeeper/oauth/invalid_token_response.rb +29 -5
  74. data/lib/doorkeeper/oauth/nonstandard.rb +39 -0
  75. data/lib/doorkeeper/oauth/password_access_token_request.rb +44 -10
  76. data/lib/doorkeeper/oauth/pre_authorization.rb +135 -26
  77. data/lib/doorkeeper/oauth/refresh_token_request.rb +60 -31
  78. data/lib/doorkeeper/oauth/scopes.rb +26 -12
  79. data/lib/doorkeeper/oauth/token.rb +13 -9
  80. data/lib/doorkeeper/oauth/token_introspection.rb +202 -0
  81. data/lib/doorkeeper/oauth/token_request.rb +8 -20
  82. data/lib/doorkeeper/oauth/token_response.rb +14 -10
  83. data/lib/doorkeeper/oauth.rb +13 -0
  84. data/lib/doorkeeper/orm/active_record/access_grant.rb +6 -4
  85. data/lib/doorkeeper/orm/active_record/access_token.rb +5 -42
  86. data/lib/doorkeeper/orm/active_record/application.rb +6 -20
  87. data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +69 -0
  88. data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +60 -0
  89. data/lib/doorkeeper/orm/active_record/mixins/application.rb +199 -0
  90. data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +66 -0
  91. data/lib/doorkeeper/orm/active_record/stale_records_cleaner.rb +33 -0
  92. data/lib/doorkeeper/orm/active_record.rb +37 -8
  93. data/lib/doorkeeper/rails/helpers.rb +14 -13
  94. data/lib/doorkeeper/rails/routes/abstract_router.rb +35 -0
  95. data/lib/doorkeeper/rails/routes/mapper.rb +4 -2
  96. data/lib/doorkeeper/rails/routes/mapping.rb +9 -7
  97. data/lib/doorkeeper/rails/routes/registry.rb +45 -0
  98. data/lib/doorkeeper/rails/routes.rb +41 -28
  99. data/lib/doorkeeper/rake/db.rake +40 -0
  100. data/lib/doorkeeper/rake/setup.rake +11 -0
  101. data/lib/doorkeeper/rake.rb +14 -0
  102. data/lib/doorkeeper/request/authorization_code.rb +6 -4
  103. data/lib/doorkeeper/request/client_credentials.rb +3 -3
  104. data/lib/doorkeeper/request/code.rb +1 -1
  105. data/lib/doorkeeper/request/password.rb +5 -14
  106. data/lib/doorkeeper/request/refresh_token.rb +6 -5
  107. data/lib/doorkeeper/request/strategy.rb +4 -2
  108. data/lib/doorkeeper/request/token.rb +1 -1
  109. data/lib/doorkeeper/request.rb +62 -29
  110. data/lib/doorkeeper/secret_storing/base.rb +64 -0
  111. data/lib/doorkeeper/secret_storing/bcrypt.rb +60 -0
  112. data/lib/doorkeeper/secret_storing/plain.rb +33 -0
  113. data/lib/doorkeeper/secret_storing/sha256_hash.rb +26 -0
  114. data/lib/doorkeeper/server.rb +9 -11
  115. data/lib/doorkeeper/stale_records_cleaner.rb +24 -0
  116. data/lib/doorkeeper/validations.rb +5 -2
  117. data/lib/doorkeeper/version.rb +12 -1
  118. data/lib/doorkeeper.rb +111 -62
  119. data/lib/generators/doorkeeper/application_owner_generator.rb +28 -13
  120. data/lib/generators/doorkeeper/confidential_applications_generator.rb +33 -0
  121. data/lib/generators/doorkeeper/enable_polymorphic_resource_owner_generator.rb +39 -0
  122. data/lib/generators/doorkeeper/install_generator.rb +19 -9
  123. data/lib/generators/doorkeeper/migration_generator.rb +27 -10
  124. data/lib/generators/doorkeeper/pkce_generator.rb +33 -0
  125. data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +31 -19
  126. data/lib/generators/doorkeeper/templates/add_confidential_to_applications.rb.erb +13 -0
  127. data/lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb +9 -0
  128. data/{spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb → lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb.erb} +3 -1
  129. data/lib/generators/doorkeeper/templates/enable_pkce_migration.rb.erb +8 -0
  130. data/lib/generators/doorkeeper/templates/enable_polymorphic_resource_owner_migration.rb.erb +17 -0
  131. data/lib/generators/doorkeeper/templates/initializer.rb +412 -33
  132. data/lib/generators/doorkeeper/templates/migration.rb.erb +88 -0
  133. data/lib/generators/doorkeeper/views_generator.rb +8 -4
  134. data/vendor/assets/stylesheets/doorkeeper/bootstrap.min.css +4 -5
  135. metadata +114 -276
  136. data/.coveralls.yml +0 -1
  137. data/.gitignore +0 -19
  138. data/.hound.yml +0 -13
  139. data/.rspec +0 -1
  140. data/.travis.yml +0 -26
  141. data/Appraisals +0 -14
  142. data/CONTRIBUTING.md +0 -47
  143. data/Gemfile +0 -10
  144. data/NEWS.md +0 -606
  145. data/RELEASING.md +0 -10
  146. data/Rakefile +0 -20
  147. data/app/validators/redirect_uri_validator.rb +0 -34
  148. data/doorkeeper.gemspec +0 -29
  149. data/gemfiles/rails_4_2.gemfile +0 -11
  150. data/gemfiles/rails_5_0.gemfile +0 -12
  151. data/gemfiles/rails_5_1.gemfile +0 -13
  152. data/lib/doorkeeper/oauth/client_credentials/validation.rb +0 -45
  153. data/lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb +0 -7
  154. data/lib/generators/doorkeeper/templates/add_previous_refresh_token_to_access_tokens.rb +0 -11
  155. data/lib/generators/doorkeeper/templates/migration.rb +0 -68
  156. data/spec/controllers/application_metal_controller.rb +0 -10
  157. data/spec/controllers/applications_controller_spec.rb +0 -58
  158. data/spec/controllers/authorizations_controller_spec.rb +0 -218
  159. data/spec/controllers/protected_resources_controller_spec.rb +0 -300
  160. data/spec/controllers/token_info_controller_spec.rb +0 -52
  161. data/spec/controllers/tokens_controller_spec.rb +0 -88
  162. data/spec/dummy/Rakefile +0 -7
  163. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  164. data/spec/dummy/app/controllers/custom_authorizations_controller.rb +0 -7
  165. data/spec/dummy/app/controllers/full_protected_resources_controller.rb +0 -12
  166. data/spec/dummy/app/controllers/home_controller.rb +0 -17
  167. data/spec/dummy/app/controllers/metal_controller.rb +0 -11
  168. data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +0 -11
  169. data/spec/dummy/app/helpers/application_helper.rb +0 -5
  170. data/spec/dummy/app/models/user.rb +0 -5
  171. data/spec/dummy/app/views/home/index.html.erb +0 -0
  172. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  173. data/spec/dummy/config/application.rb +0 -23
  174. data/spec/dummy/config/boot.rb +0 -9
  175. data/spec/dummy/config/database.yml +0 -15
  176. data/spec/dummy/config/environment.rb +0 -5
  177. data/spec/dummy/config/environments/development.rb +0 -29
  178. data/spec/dummy/config/environments/production.rb +0 -62
  179. data/spec/dummy/config/environments/test.rb +0 -44
  180. data/spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb +0 -6
  181. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  182. data/spec/dummy/config/initializers/doorkeeper.rb +0 -96
  183. data/spec/dummy/config/initializers/secret_token.rb +0 -9
  184. data/spec/dummy/config/initializers/session_store.rb +0 -8
  185. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  186. data/spec/dummy/config/locales/doorkeeper.en.yml +0 -5
  187. data/spec/dummy/config/routes.rb +0 -52
  188. data/spec/dummy/config.ru +0 -4
  189. data/spec/dummy/db/migrate/20111122132257_create_users.rb +0 -9
  190. data/spec/dummy/db/migrate/20120312140401_add_password_to_users.rb +0 -5
  191. data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +0 -60
  192. data/spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb +0 -7
  193. data/spec/dummy/db/schema.rb +0 -67
  194. data/spec/dummy/public/404.html +0 -26
  195. data/spec/dummy/public/422.html +0 -26
  196. data/spec/dummy/public/500.html +0 -26
  197. data/spec/dummy/public/favicon.ico +0 -0
  198. data/spec/dummy/script/rails +0 -6
  199. data/spec/factories.rb +0 -28
  200. data/spec/generators/application_owner_generator_spec.rb +0 -22
  201. data/spec/generators/install_generator_spec.rb +0 -31
  202. data/spec/generators/migration_generator_spec.rb +0 -20
  203. data/spec/generators/templates/routes.rb +0 -3
  204. data/spec/generators/views_generator_spec.rb +0 -27
  205. data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +0 -24
  206. data/spec/lib/config_spec.rb +0 -334
  207. data/spec/lib/doorkeeper_spec.rb +0 -150
  208. data/spec/lib/models/expirable_spec.rb +0 -50
  209. data/spec/lib/models/revocable_spec.rb +0 -59
  210. data/spec/lib/models/scopes_spec.rb +0 -43
  211. data/spec/lib/oauth/authorization/uri_builder_spec.rb +0 -41
  212. data/spec/lib/oauth/authorization_code_request_spec.rb +0 -80
  213. data/spec/lib/oauth/base_request_spec.rb +0 -160
  214. data/spec/lib/oauth/base_response_spec.rb +0 -45
  215. data/spec/lib/oauth/client/credentials_spec.rb +0 -88
  216. data/spec/lib/oauth/client_credentials/creator_spec.rb +0 -44
  217. data/spec/lib/oauth/client_credentials/issuer_spec.rb +0 -86
  218. data/spec/lib/oauth/client_credentials/validation_spec.rb +0 -54
  219. data/spec/lib/oauth/client_credentials_integration_spec.rb +0 -27
  220. data/spec/lib/oauth/client_credentials_request_spec.rb +0 -104
  221. data/spec/lib/oauth/client_spec.rb +0 -39
  222. data/spec/lib/oauth/code_request_spec.rb +0 -45
  223. data/spec/lib/oauth/code_response_spec.rb +0 -34
  224. data/spec/lib/oauth/error_response_spec.rb +0 -61
  225. data/spec/lib/oauth/error_spec.rb +0 -23
  226. data/spec/lib/oauth/forbidden_token_response_spec.rb +0 -23
  227. data/spec/lib/oauth/helpers/scope_checker_spec.rb +0 -64
  228. data/spec/lib/oauth/helpers/unique_token_spec.rb +0 -20
  229. data/spec/lib/oauth/helpers/uri_checker_spec.rb +0 -104
  230. data/spec/lib/oauth/invalid_token_response_spec.rb +0 -56
  231. data/spec/lib/oauth/password_access_token_request_spec.rb +0 -90
  232. data/spec/lib/oauth/pre_authorization_spec.rb +0 -155
  233. data/spec/lib/oauth/refresh_token_request_spec.rb +0 -154
  234. data/spec/lib/oauth/scopes_spec.rb +0 -122
  235. data/spec/lib/oauth/token_request_spec.rb +0 -98
  236. data/spec/lib/oauth/token_response_spec.rb +0 -85
  237. data/spec/lib/oauth/token_spec.rb +0 -116
  238. data/spec/lib/request/strategy_spec.rb +0 -53
  239. data/spec/lib/server_spec.rb +0 -49
  240. data/spec/models/doorkeeper/access_grant_spec.rb +0 -36
  241. data/spec/models/doorkeeper/access_token_spec.rb +0 -394
  242. data/spec/models/doorkeeper/application_spec.rb +0 -179
  243. data/spec/requests/applications/applications_request_spec.rb +0 -94
  244. data/spec/requests/applications/authorized_applications_spec.rb +0 -30
  245. data/spec/requests/endpoints/authorization_spec.rb +0 -71
  246. data/spec/requests/endpoints/token_spec.rb +0 -64
  247. data/spec/requests/flows/authorization_code_errors_spec.rb +0 -76
  248. data/spec/requests/flows/authorization_code_spec.rb +0 -148
  249. data/spec/requests/flows/client_credentials_spec.rb +0 -58
  250. data/spec/requests/flows/implicit_grant_errors_spec.rb +0 -32
  251. data/spec/requests/flows/implicit_grant_spec.rb +0 -61
  252. data/spec/requests/flows/password_spec.rb +0 -115
  253. data/spec/requests/flows/refresh_token_spec.rb +0 -174
  254. data/spec/requests/flows/revoke_token_spec.rb +0 -157
  255. data/spec/requests/flows/skip_authorization_spec.rb +0 -59
  256. data/spec/requests/protected_resources/metal_spec.rb +0 -14
  257. data/spec/requests/protected_resources/private_api_spec.rb +0 -81
  258. data/spec/routing/custom_controller_routes_spec.rb +0 -71
  259. data/spec/routing/default_routes_spec.rb +0 -35
  260. data/spec/routing/scoped_routes_spec.rb +0 -31
  261. data/spec/spec_helper.rb +0 -4
  262. data/spec/spec_helper_integration.rb +0 -63
  263. data/spec/support/dependencies/factory_girl.rb +0 -2
  264. data/spec/support/helpers/access_token_request_helper.rb +0 -11
  265. data/spec/support/helpers/authorization_request_helper.rb +0 -41
  266. data/spec/support/helpers/config_helper.rb +0 -9
  267. data/spec/support/helpers/model_helper.rb +0 -67
  268. data/spec/support/helpers/request_spec_helper.rb +0 -84
  269. data/spec/support/helpers/url_helper.rb +0 -55
  270. data/spec/support/http_method_shim.rb +0 -38
  271. data/spec/support/orm/active_record.rb +0 -3
  272. data/spec/support/shared/controllers_shared_context.rb +0 -69
  273. data/spec/support/shared/models_shared_examples.rb +0 -52
  274. data/spec/validators/redirect_uri_validator_spec.rb +0 -78
data/README.md CHANGED
@@ -1,371 +1,154 @@
1
- # Doorkeeper - awesome OAuth2 provider for your Rails app.
1
+ # Doorkeeper awesome OAuth 2 provider for your Rails / Grape app.
2
2
 
3
- [![Build Status](https://travis-ci.org/doorkeeper-gem/doorkeeper.svg?branch=master)](https://travis-ci.org/doorkeeper-gem/doorkeeper)
4
- [![Dependency Status](https://gemnasium.com/doorkeeper-gem/doorkeeper.svg?travis)](https://gemnasium.com/doorkeeper-gem/doorkeeper)
5
- [![Code Climate](https://codeclimate.com/github/doorkeeper-gem/doorkeeper.svg)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper)
6
3
  [![Gem Version](https://badge.fury.io/rb/doorkeeper.svg)](https://rubygems.org/gems/doorkeeper)
7
- [![Security](https://hakiri.io/github/doorkeeper-gem/doorkeeper/master.svg)](https://hakiri.io/github/doorkeeper-gem/doorkeeper/master)
8
-
9
- Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider
10
- functionality to your Rails or Grape application.
11
-
12
- [PR 567]: https://github.com/doorkeeper-gem/doorkeeper/pull/567
13
-
14
-
15
- ## Documentation valid for `master` branch
16
-
17
- Please check the documentation for the version of doorkeeper you are using in:
18
- https://github.com/doorkeeper-gem/doorkeeper/releases
19
-
20
- - See the [wiki](https://github.com/doorkeeper-gem/doorkeeper/wiki)
21
- - For general questions, please post in [Stack Overflow](http://stackoverflow.com/questions/tagged/doorkeeper)
4
+ [![Build Status](https://app.travis-ci.com/doorkeeper-gem/doorkeeper.svg?branch=main)](https://app.travis-ci.com/doorkeeper-gem/doorkeeper)
5
+ [![Code Climate](https://codeclimate.com/github/doorkeeper-gem/doorkeeper.svg)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper)
6
+ [![Coverage Status](https://coveralls.io/repos/github/doorkeeper-gem/doorkeeper/badge.svg?branch=main)](https://coveralls.io/github/doorkeeper-gem/doorkeeper?branch=main)
7
+ [![Security](https://hakiri.io/github/doorkeeper-gem/doorkeeper/main.svg)](https://hakiri.io/github/doorkeeper-gem/doorkeeper/main)
8
+ [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
9
+ [![GuardRails badge](https://badges.guardrails.io/doorkeeper-gem/doorkeeper.svg?token=66768ce8f6995814df81f65a2cff40f739f688492704f973e62809e15599bb62)](https://dashboard.guardrails.io/default/gh/doorkeeper-gem/doorkeeper)
10
+ [![Dependabot](https://img.shields.io/badge/dependabot-enabled-success.svg)](https://dependabot.com)
11
+
12
+ Doorkeeper is a gem (Rails engine) that makes it easy to introduce OAuth 2 provider
13
+ functionality to your Ruby on Rails or Grape application.
14
+
15
+ Supported features:
16
+
17
+ - [The OAuth 2.0 Authorization Framework](https://datatracker.ietf.org/doc/html/rfc6749)
18
+ - [Authorization Code Flow](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1)
19
+ - [Access Token Scopes](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3)
20
+ - [Refresh token](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5)
21
+ - [Implicit grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.2)
22
+ - [Resource Owner Password Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.3)
23
+ - [Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)
24
+ - [OAuth 2.0 Token Revocation](https://datatracker.ietf.org/doc/html/rfc7009)
25
+ - [OAuth 2.0 Token Introspection](https://datatracker.ietf.org/doc/html/rfc7662)
26
+ - [OAuth 2.0 Threat Model and Security Considerations](https://datatracker.ietf.org/doc/html/rfc6819)
27
+ - [OAuth 2.0 for Native Apps](https://datatracker.ietf.org/doc/html/rfc8252)
28
+ - [Proof Key for Code Exchange by OAuth Public Clients](https://datatracker.ietf.org/doc/html/rfc7636)
22
29
 
23
30
  ## Table of Contents
24
31
 
25
32
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
26
33
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
27
34
 
35
+
36
+ - [Documentation](#documentation)
28
37
  - [Installation](#installation)
29
- - [Configuration](#configuration)
30
- - [Active Record](#active-record)
31
- - [Other ORMs](#other-orms)
32
- - [Routes](#routes)
33
- - [Authenticating](#authenticating)
34
- - [Internationalization (I18n)](#internationalization-i18n)
35
- - [Protecting resources with OAuth (a.k.a your API endpoint)](#protecting-resources-with-oauth-aka-your-api-endpoint)
36
- - [Protect your API with OAuth when using Grape](#protect-your-api-with-oauth-when-using-grape)
37
- - [Route Constraints and other integrations](#route-constraints-and-other-integrations)
38
- - [Access Token Scopes](#access-token-scopes)
39
- - [Custom Access Token Generator](#custom-access-token-generator)
40
- - [Authenticated resource owner](#authenticated-resource-owner)
41
- - [Applications list](#applications-list)
42
- - [Other customizations](#other-customizations)
43
- - [Upgrading](#upgrading)
38
+ - [Ruby on Rails](#ruby-on-rails)
39
+ - [Grape](#grape)
40
+ - [ORMs](#orms)
41
+ - [Extensions](#extensions)
42
+ - [Example Applications](#example-applications)
43
+ - [Tutorials](#tutorials)
44
+ - [Sponsors](#sponsors)
44
45
  - [Development](#development)
45
46
  - [Contributing](#contributing)
46
- - [Other resources](#other-resources)
47
- - [Wiki](#wiki)
48
- - [Screencast](#screencast)
49
- - [Client applications](#client-applications)
50
- - [Contributors](#contributors)
51
- - [IETF Standards](#ietf-standards)
52
- - [License](#license)
47
+ - [Contributors](#contributors)
48
+ - [License](#license)
53
49
 
54
50
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
55
51
 
56
- ## Installation
57
-
58
- Put this in your Gemfile:
59
-
60
- ``` ruby
61
- gem 'doorkeeper'
62
- ```
63
-
64
- Run the installation generator with:
65
-
66
- rails generate doorkeeper:install
67
-
68
- This will install the doorkeeper initializer into `config/initializers/doorkeeper.rb`.
69
-
70
- ## Configuration
71
-
72
- ### Active Record
73
-
74
- By default doorkeeper is configured to use active record, so to start you have
75
- to generate the migration tables:
76
-
77
- rails generate doorkeeper:migration
78
-
79
- You may want to add foreign keys to your migration. For example, if you plan on
80
- using `User` as the resource owner, add the following line to the migration file
81
- for each table that includes a `resource_owner_id` column:
82
-
83
- ```ruby
84
- add_foreign_key :table_name, :users, column: :resource_owner_id
85
- ```
86
-
87
- Then run migrations:
88
-
89
- ```sh
90
- rake db:migrate
91
- ```
92
-
93
- ### Other ORMs
94
-
95
- See [doorkeeper-mongodb project] for Mongoid and MongoMapper support. Follow along
96
- the implementation in that repository to extend doorkeeper with other ORMs.
97
-
98
- [doorkeeper-mongodb project]: https://github.com/doorkeeper-gem/doorkeeper-mongodb
99
-
100
- If you are using [Sequel gem] then you can add [doorkeeper-sequel extension] to your project.
101
- Follow configuration instructions for setting up the necessary Doorkeeper ORM.
102
-
103
- [Sequel gem]: https://github.com/jeremyevans/sequel/
104
- [doorkeeper-sequel extension]: https://github.com/nbulaj/doorkeeper-sequel
105
-
106
- ### Routes
107
-
108
- The installation script will also automatically add the Doorkeeper routes into
109
- your app, like this:
110
-
111
- ``` ruby
112
- Rails.application.routes.draw do
113
- use_doorkeeper
114
- # your routes
115
- end
116
- ```
117
-
118
- This will mount following routes:
119
-
120
- GET /oauth/authorize/:code
121
- GET /oauth/authorize
122
- POST /oauth/authorize
123
- DELETE /oauth/authorize
124
- POST /oauth/token
125
- POST /oauth/revoke
126
- resources /oauth/applications
127
- GET /oauth/authorized_applications
128
- DELETE /oauth/authorized_applications/:id
129
- GET /oauth/token/info
130
-
131
- For more information on how to customize routes, check out [this page on the
132
- wiki](https://github.com/doorkeeper-gem/doorkeeper/wiki/Customizing-routes).
133
-
134
- ### Authenticating
135
-
136
- You need to configure Doorkeeper in order to provide `resource_owner` model
137
- and authentication block in `config/initializers/doorkeeper.rb`:
138
-
139
- ``` ruby
140
- Doorkeeper.configure do
141
- resource_owner_authenticator do
142
- User.find_by_id(session[:current_user_id]) || redirect_to(login_url)
143
- end
144
- end
145
- ```
146
-
147
- This code is run in the context of your application so you have access to your
148
- models, session or routes helpers. However, since this code is not run in the
149
- context of your application's `ApplicationController` it doesn't have access to
150
- the methods defined over there.
151
-
152
- You may want to check other ways of authentication
153
- [here](https://github.com/doorkeeper-gem/doorkeeper/wiki/Authenticating-using-Clearance-or-DIY).
154
-
155
-
156
- ### Internationalization (I18n)
157
-
158
- See language files in [the I18n repository](https://github.com/doorkeeper-gem/doorkeeper-i18n).
159
-
160
-
161
- ## Protecting resources with OAuth (a.k.a your API endpoint)
162
-
163
- To protect your API with OAuth, you just need to setup `before_action`s
164
- specifying the actions you want to protect. For example:
165
-
166
- ``` ruby
167
- class Api::V1::ProductsController < Api::V1::ApiController
168
- before_action :doorkeeper_authorize! # Require access token for all actions
169
-
170
- # your actions
171
- end
172
- ```
173
-
174
- You can pass any option `before_action` accepts, such as `if`, `only`,
175
- `except`, and others.
176
-
177
- ### Protect your API with OAuth when using Grape
52
+ ## Documentation
178
53
 
179
- As of [PR 567] doorkeeper has helpers for Grape >= 0.10. One of them is
180
- `doorkeeper_authorize!` and can be used in a similar way as an example above.
181
- Note that you have to use `require 'doorkeeper/grape/helpers'` and
182
- `helpers Doorkeeper::Grape::Helpers`.
54
+ This documentation is valid for `main` branch. Please check the documentation for the version of doorkeeper you are using in:
55
+ https://github.com/doorkeeper-gem/doorkeeper/releases.
183
56
 
184
- For more information about integration with Grape see the [Wiki].
185
-
186
- [PR 567]: https://github.com/doorkeeper-gem/doorkeeper/pull/567
187
- [Wiki]: https://github.com/doorkeeper-gem/doorkeeper/wiki/Grape-Integration
188
-
189
- ``` ruby
190
- require 'doorkeeper/grape/helpers'
191
-
192
- module API
193
- module V1
194
- class Users < Grape::API
195
- helpers Doorkeeper::Grape::Helpers
196
-
197
- before do
198
- doorkeeper_authorize!
199
- end
200
-
201
- route_setting :scopes, ['user:email']
202
- get :emails do
203
- [{'email' => current_user.email}]
204
- end
205
-
206
- # ...
207
- end
208
- end
209
- end
210
- ```
57
+ Additionally, other resources can be found on:
211
58
 
59
+ - [Guides](https://doorkeeper.gitbook.io/guides/) with how-to get started and configuration documentation
60
+ - See the [Wiki](https://github.com/doorkeeper-gem/doorkeeper/wiki) with articles and other documentation
61
+ - Screencast from [railscasts.com](http://railscasts.com/): [#353
62
+ OAuth with
63
+ Doorkeeper](http://railscasts.com/episodes/353-oauth-with-doorkeeper)
64
+ - See [upgrade guides](https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions)
65
+ - For general questions, please post on [Stack Overflow](http://stackoverflow.com/questions/tagged/doorkeeper)
66
+ - See [SECURITY.md](SECURITY.md) for this project's security disclose
67
+ policy
212
68
 
213
- ### Route Constraints and other integrations
69
+ ## Installation
214
70
 
215
- You can leverage the `Doorkeeper.authenticate` facade to easily extract a
216
- `Doorkeeper::OAuth::Token` based on the current request. You can then ensure
217
- that token is still good, find its associated `#resource_owner_id`, etc.
71
+ Installation depends on the framework you're using. The first step is to add the following to your Gemfile:
218
72
 
219
73
  ```ruby
220
- module Constraint
221
- class Authenticated
222
-
223
- def matches?(request)
224
- token = Doorkeeper.authenticate(request)
225
- token && token.accessible?
226
- end
227
-
228
- end
229
- end
74
+ gem 'doorkeeper'
230
75
  ```
231
76
 
232
- For more information about integration and other integrations, check out [the
233
- related wiki
234
- page](https://github.com/doorkeeper-gem/doorkeeper/wiki/ActionController::Metal-with-doorkeeper).
77
+ And run `bundle install`. After this, check out the guide related to the framework you're using.
235
78
 
236
- ### Access Token Scopes
79
+ ### Ruby on Rails
237
80
 
238
- You can also require the access token to have specific scopes in certain
239
- actions:
81
+ Doorkeeper currently supports Ruby on Rails >= 5.0. See the guide [here](https://doorkeeper.gitbook.io/guides/ruby-on-rails/getting-started).
240
82
 
241
- First configure the scopes in `initializers/doorkeeper.rb`
83
+ ### Grape
242
84
 
243
- ```ruby
244
- Doorkeeper.configure do
245
- default_scopes :public # if no scope was requested, this will be the default
246
- optional_scopes :admin, :write
247
- end
248
- ```
85
+ Guide for integration with Grape framework can be found [here](https://doorkeeper.gitbook.io/guides/grape/grape).
249
86
 
250
- And in your controllers:
87
+ ## ORMs
251
88
 
252
- ```ruby
253
- class Api::V1::ProductsController < Api::V1::ApiController
254
- before_action -> { doorkeeper_authorize! :public }, only: :index
255
- before_action only: [:create, :update, :destroy] do
256
- doorkeeper_authorize! :admin, :write
257
- end
258
- end
259
- ```
89
+ Doorkeeper supports Active Record by default, but can be configured to work with the following ORMs:
260
90
 
261
- Please note that there is a logical OR between multiple required scopes. In the
262
- above example, `doorkeeper_authorize! :admin, :write` means that the access
263
- token is required to have either `:admin` scope or `:write` scope, but does not
264
- need have both of them.
91
+ | ORM | Support via |
92
+ | :--- | :--- |
93
+ | Active Record | by default |
94
+ | MongoDB | [doorkeeper-gem/doorkeeper-mongodb](https://github.com/doorkeeper-gem/doorkeeper-mongodb) |
95
+ | Sequel | [nbulaj/doorkeeper-sequel](https://github.com/nbulaj/doorkeeper-sequel) |
96
+ | Couchbase | [acaprojects/doorkeeper-couchbase](https://github.com/acaprojects/doorkeeper-couchbase) |
97
+ | RethinkDB | [aca-labs/doorkeeper-rethinkdb](https://github.com/aca-labs/doorkeeper-rethinkdb) |
265
98
 
266
- If you want to require the access token to have multiple scopes at the same
267
- time, use multiple `doorkeeper_authorize!`, for example:
99
+ ## Extensions
268
100
 
269
- ```ruby
270
- class Api::V1::ProductsController < Api::V1::ApiController
271
- before_action -> { doorkeeper_authorize! :public }, only: :index
272
- before_action only: [:create, :update, :destroy] do
273
- doorkeeper_authorize! :admin
274
- doorkeeper_authorize! :write
275
- end
276
- end
277
- ```
101
+ Extensions that are not included by default and can be installed separately.
278
102
 
279
- In the above example, a client can call `:create` action only if its access token
280
- has both `:admin` and `:write` scopes.
103
+ | | Link |
104
+ | :--- | :--- |
105
+ | OpenID Connect extension | [doorkeeper-gem/doorkeeper-openid\_connect](https://github.com/doorkeeper-gem/doorkeeper-openid_connect) |
106
+ | JWT Token support | [doorkeeper-gem/doorkeeper-jwt](https://github.com/doorkeeper-gem/doorkeeper-jwt) |
107
+ | Assertion grant extension | [doorkeeper-gem/doorkeeper-grants\_assertion](https://github.com/doorkeeper-gem/doorkeeper-grants_assertion) |
108
+ | I18n translations | [doorkeeper-gem/doorkeeper-i18n](https://github.com/doorkeeper-gem/doorkeeper-i18n) |
281
109
 
282
- ### Custom Access Token Generator
110
+ ## Example Applications
283
111
 
284
- By default a 128 bit access token will be generated. If you require a custom
285
- token, such as [JWT](http://jwt.io), specify an object that responds to
286
- `.generate(options = {})` and returns a string to be used as the token.
112
+ These applications show how Doorkeeper works and how to integrate with it. Start with the oAuth2 server and use the clients to connect with the server.
287
113
 
288
- ```ruby
289
- Doorkeeper.configure do
290
- access_token_generator "Doorkeeper::JWT"
291
- end
292
- ```
293
-
294
- JWT token support is available with
295
- [Doorkeeper-JWT](https://github.com/chriswarren/doorkeeper-jwt).
296
-
297
- ### Custom Base Controller
114
+ | Application | Link |
115
+ | :--- | :--- |
116
+ | OAuth2 Server with Doorkeeper | [doorkeeper-gem/doorkeeper-provider-app](https://github.com/doorkeeper-gem/doorkeeper-provider-app) |
117
+ | Sinatra Client connected to Provider App | [doorkeeper-gem/doorkeeper-sinatra-client](https://github.com/doorkeeper-gem/doorkeeper-sinatra-client) |
118
+ | Devise + Omniauth Client | [doorkeeper-gem/doorkeeper-devise-client](https://github.com/doorkeeper-gem/doorkeeper-devise-client) |
298
119
 
299
- By default Doorkeeper's main controller `Doorkeeper::ApplicationController` inherits from `ActionController::Base`.
300
- You may want to use your own controller to inherit from, to keep Doorkeeper controllers in the same context than the rest your app:
301
-
302
- ```ruby
303
- Doorkeeper.configure do
304
- base_controller 'ApplicationController'
305
- end
306
- ```
120
+ You may want to create a client application to
121
+ test the integration. Check out these [client
122
+ examples](https://github.com/doorkeeper-gem/doorkeeper/wiki/Example-Applications)
123
+ in our wiki or follow this [tutorial
124
+ here](https://github.com/doorkeeper-gem/doorkeeper/wiki/Testing-your-provider-with-OAuth2-gem).
307
125
 
308
- ### Authenticated resource owner
126
+ ## Tutorials
309
127
 
310
- If you want to return data based on the current resource owner, in other
311
- words, the access token owner, you may want to define a method in your
312
- controller that returns the resource owner instance:
128
+ See [list of tutorials](https://github.com/doorkeeper-gem/doorkeeper/wiki#how-tos--tutorials) in order to learn how to use the gem or integrate it with other solutions / gems.
313
129
 
314
- ``` ruby
315
- class Api::V1::CredentialsController < Api::V1::ApiController
316
- before_action :doorkeeper_authorize!
317
- respond_to :json
130
+ ## Sponsors
318
131
 
319
- # GET /me.json
320
- def me
321
- respond_with current_resource_owner
322
- end
132
+ [![OpenCollective](https://opencollective.com/doorkeeper-gem/backers/badge.svg)](#backers)
133
+ [![OpenCollective](https://opencollective.com/doorkeeper-gem/sponsors/badge.svg)](#sponsors)
323
134
 
324
- private
135
+ Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/doorkeeper-gem#sponsor)]
325
136
 
326
- # Find the user that owns the access token
327
- def current_resource_owner
328
- User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
329
- end
330
- end
331
- ```
137
+ <a href="https://codecademy.com/about/careers?utm_source=doorkeeper-gem" target="_blank"><img src="https://static-assets.codecademy.com/marketing/codecademy_logo_padded.png"/></a>
332
138
 
333
- In this example, we're returning the credentials (`me.json`) of the access
334
- token owner.
139
+ > Codecademy supports open source as part of its mission to democratize tech. Come help us build the education the world deserves: [https://codecademy.com/about/careers](https://codecademy.com/about/careers?utm_source=doorkeeper-gem)
335
140
 
336
- ### Applications list
141
+ <br>
337
142
 
338
- By default, the applications list (`/oauth/applications`) is publicly available.
339
- To protect the endpoint you should uncomment these lines:
143
+ <a href="https://oauth.io/?utm_source=doorkeeper-gem" target="_blank"><img src="https://oauth.io/img/logo_text.png"/></a>
340
144
 
341
- ```ruby
342
- # config/initializers/doorkeeper.rb
343
- Doorkeeper.configure do
344
- admin_authenticator do |routes|
345
- Admin.find_by_id(session[:admin_id]) || redirect_to(routes.new_admin_session_url)
346
- end
347
- end
348
- ```
145
+ > If you prefer not to deal with the gory details of OAuth 2, need dedicated customer support & consulting, try the cloud-based SaaS version: [https://oauth.io](https://oauth.io/?utm_source=doorkeeper-gem)
349
146
 
350
- The logic is the same as the `resource_owner_authenticator` block. **Note:**
351
- since the application list is just a scaffold, it's recommended to either
352
- customize the controller used by the list or skip the controller all together.
353
- For more information see the page
354
- [in the wiki](https://github.com/doorkeeper-gem/doorkeeper/wiki/Customizing-routes).
147
+ <br>
355
148
 
356
- ## Other customizations
149
+ <a href="https://www.wealthsimple.com/?utm_source=doorkeeper-gem" target="_blank"><img src="https://wealthsimple.s3.amazonaws.com/branding/medium-black.svg"/></a>
357
150
 
358
- - [Associate users to OAuth applications (ownership)](https://github.com/doorkeeper-gem/doorkeeper/wiki/Associate-users-to-OAuth-applications-%28ownership%29)
359
- - [CORS - Cross Origin Resource Sharing](https://github.com/doorkeeper-gem/doorkeeper/wiki/%5BCORS%5D-Cross-Origin-Resource-Sharing)
360
-
361
- ## Upgrading
362
-
363
- If you want to upgrade doorkeeper to a new version, check out the [upgrading
364
- notes](https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions)
365
- and take a look at the
366
- [changelog](https://github.com/doorkeeper-gem/doorkeeper/blob/master/NEWS.md).
367
-
368
- Doorkeeper follows [semantic versioning](http://semver.org/).
151
+ > Wealthsimple is a financial company on a mission to help everyone achieve financial freedom by providing products and advice that are accessible and affordable. Using smart technology, Wealthsimple takes financial services that are often confusing, opaque and expensive and makes them simple, transparent, and low-cost. See what Investing on Autopilot is all about: [https://www.wealthsimple.com](https://www.wealthsimple.com/?utm_source=doorkeeper-gem)
369
152
 
370
153
  ## Development
371
154
 
@@ -373,17 +156,18 @@ To run the local engine server:
373
156
 
374
157
  ```
375
158
  bundle install
376
- bundle exec rails server
159
+ bundle exec rake doorkeeper:server
377
160
  ````
378
161
 
379
162
  By default, it uses the latest Rails version with ActiveRecord. To run the
380
- tests with a specific ORM and Rails version:
163
+ tests with a specific Rails version:
381
164
 
382
165
  ```
383
- rails=4.2.0 orm=active_record bundle exec rake
166
+ BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle exec rake
384
167
  ```
385
168
 
386
- Or you might prefer to run `script/run_all` to integrate against all ORMs.
169
+ You can also experiment with the changes using `bin/console`. It uses in-memory SQLite database and default
170
+ Doorkeeper config, but you can reestablish connection or reconfigure the gem if you need.
387
171
 
388
172
  ## Contributing
389
173
 
@@ -393,42 +177,15 @@ create [example
393
177
  apps](https://github.com/doorkeeper-gem/doorkeeper/wiki/Example-Applications),
394
178
  integrate the gem with your app and let us know!
395
179
 
396
- Also, check out our [contributing guidelines
397
- page](https://github.com/doorkeeper-gem/doorkeeper/wiki/Contributing).
398
-
399
- ## Other resources
400
-
401
- ### Wiki
402
-
403
- You can find everything about doorkeeper in our [wiki
404
- here](https://github.com/doorkeeper-gem/doorkeeper/wiki).
180
+ Also, check out our [contributing guidelines page](CONTRIBUTING.md).
405
181
 
406
- ### Screencast
407
-
408
- Check out this screencast from [railscasts.com](http://railscasts.com/): [#353
409
- OAuth with
410
- Doorkeeper](http://railscasts.com/episodes/353-oauth-with-doorkeeper)
411
-
412
- ### Client applications
413
-
414
- After you set up the provider, you may want to create a client application to
415
- test the integration. Check out these [client
416
- examples](https://github.com/doorkeeper-gem/doorkeeper/wiki/Example-Applications)
417
- in our wiki or follow this [tutorial
418
- here](https://github.com/doorkeeper-gem/doorkeeper/wiki/Testing-your-provider-with-OAuth2-gem).
419
-
420
- ### Contributors
182
+ ## Contributors
421
183
 
422
184
  Thanks to all our [awesome
423
185
  contributors](https://github.com/doorkeeper-gem/doorkeeper/graphs/contributors)!
424
186
 
187
+ <a href="https://github.com/doorkeeper-gem/doorkeeper/graphs/contributors"><img src="https://opencollective.com/doorkeeper-gem/contributors.svg?width=890&button=false" /></a>
425
188
 
426
- ### IETF Standards
427
-
428
- * [The OAuth 2.0 Authorization Framework](http://tools.ietf.org/html/rfc6749)
429
- * [OAuth 2.0 Threat Model and Security Considerations](http://tools.ietf.org/html/rfc6819)
430
- * [OAuth 2.0 Token Revocation](http://tools.ietf.org/html/rfc7009)
431
-
432
- ### License
189
+ ## License
433
190
 
434
191
  MIT License. Copyright 2011 Applicake.
@@ -5,6 +5,6 @@
5
5
  *= require_tree .
6
6
  */
7
7
 
8
- td {
9
- vertical-align: middle !important;
8
+ .doorkeeper-admin .form-group > .field_with_errors {
9
+ width: 16.66667%;
10
10
  }
@@ -1,15 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Doorkeeper
2
4
  class ApplicationController <
3
- Doorkeeper.configuration.base_controller.constantize
4
-
5
+ Doorkeeper.config.resolve_controller(:base)
5
6
  include Helpers::Controller
7
+ include ActionController::MimeResponds if Doorkeeper.config.api_only
6
8
 
7
- if ::Rails.version.to_i < 4
8
- protect_from_forgery
9
- else
9
+ unless Doorkeeper.config.api_only
10
10
  protect_from_forgery with: :exception
11
+ helper "doorkeeper/dashboard"
11
12
  end
12
-
13
- helper 'doorkeeper/dashboard'
14
13
  end
15
14
  end
@@ -1,16 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Doorkeeper
2
- class ApplicationMetalController < ActionController::Metal
3
- MODULES = [
4
- ActionController::Instrumentation,
5
- AbstractController::Rendering,
6
- ActionController::Rendering,
7
- ActionController::Renderers::All,
8
- Helpers::Controller
9
- ].freeze
4
+ class ApplicationMetalController <
5
+ Doorkeeper.config.resolve_controller(:base_metal)
6
+ include Helpers::Controller
10
7
 
11
- MODULES.each do |mod|
12
- include mod
13
- end
8
+ before_action :enforce_content_type,
9
+ if: -> { Doorkeeper.config.enforce_content_type }
14
10
 
15
11
  ActiveSupport.run_load_hooks(:doorkeeper_metal_controller, self)
16
12
  end