doorkeeper 5.1.0 → 5.2.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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +1 -1
  3. data/CHANGELOG.md +843 -0
  4. data/CONTRIBUTING.md +11 -9
  5. data/Dangerfile +2 -2
  6. data/Dockerfile +29 -0
  7. data/Gemfile +2 -1
  8. data/NEWS.md +1 -814
  9. data/README.md +11 -3
  10. data/RELEASING.md +6 -5
  11. data/app/controllers/doorkeeper/application_controller.rb +1 -1
  12. data/app/controllers/doorkeeper/application_metal_controller.rb +2 -1
  13. data/app/controllers/doorkeeper/applications_controller.rb +2 -0
  14. data/app/controllers/doorkeeper/authorizations_controller.rb +14 -7
  15. data/app/controllers/doorkeeper/tokens_controller.rb +32 -9
  16. data/app/views/doorkeeper/applications/_form.html.erb +0 -6
  17. data/app/views/doorkeeper/applications/show.html.erb +1 -1
  18. data/config/locales/en.yml +8 -2
  19. data/doorkeeper.gemspec +9 -1
  20. data/gemfiles/rails_5_0.gemfile +1 -0
  21. data/gemfiles/rails_5_1.gemfile +1 -0
  22. data/gemfiles/rails_5_2.gemfile +1 -0
  23. data/gemfiles/rails_6_0.gemfile +2 -1
  24. data/gemfiles/rails_master.gemfile +1 -0
  25. data/lib/doorkeeper/config/option.rb +13 -7
  26. data/lib/doorkeeper/config.rb +88 -6
  27. data/lib/doorkeeper/errors.rb +13 -18
  28. data/lib/doorkeeper/grape/helpers.rb +5 -1
  29. data/lib/doorkeeper/helpers/controller.rb +20 -3
  30. data/lib/doorkeeper/models/access_token_mixin.rb +43 -2
  31. data/lib/doorkeeper/oauth/authorization/code.rb +11 -13
  32. data/lib/doorkeeper/oauth/authorization/token.rb +1 -1
  33. data/lib/doorkeeper/oauth/authorization_code_request.rb +18 -9
  34. data/lib/doorkeeper/oauth/base_request.rb +2 -0
  35. data/lib/doorkeeper/oauth/client_credentials/creator.rb +14 -0
  36. data/lib/doorkeeper/oauth/client_credentials/validation.rb +8 -0
  37. data/lib/doorkeeper/oauth/code_request.rb +5 -11
  38. data/lib/doorkeeper/oauth/code_response.rb +2 -2
  39. data/lib/doorkeeper/oauth/error_response.rb +1 -1
  40. data/lib/doorkeeper/oauth/helpers/uri_checker.rb +18 -4
  41. data/lib/doorkeeper/oauth/invalid_request_response.rb +43 -0
  42. data/lib/doorkeeper/oauth/nonstandard.rb +39 -0
  43. data/lib/doorkeeper/oauth/password_access_token_request.rb +7 -2
  44. data/lib/doorkeeper/oauth/pre_authorization.rb +70 -37
  45. data/lib/doorkeeper/oauth/refresh_token_request.rb +13 -10
  46. data/lib/doorkeeper/oauth/token_introspection.rb +23 -13
  47. data/lib/doorkeeper/oauth/token_request.rb +4 -18
  48. data/lib/doorkeeper/orm/active_record/access_grant.rb +1 -1
  49. data/lib/doorkeeper/orm/active_record/access_token.rb +2 -2
  50. data/lib/doorkeeper/orm/active_record/application.rb +8 -2
  51. data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +61 -0
  52. data/lib/doorkeeper/orm/active_record.rb +19 -3
  53. data/lib/doorkeeper/request/authorization_code.rb +2 -0
  54. data/lib/doorkeeper/request.rb +6 -11
  55. data/lib/doorkeeper/server.rb +2 -6
  56. data/lib/doorkeeper/stale_records_cleaner.rb +6 -2
  57. data/lib/doorkeeper/version.rb +1 -1
  58. data/lib/doorkeeper.rb +4 -0
  59. data/lib/generators/doorkeeper/previous_refresh_token_generator.rb +6 -6
  60. data/lib/generators/doorkeeper/templates/initializer.rb +110 -33
  61. data/lib/generators/doorkeeper/templates/migration.rb.erb +4 -1
  62. data/spec/controllers/applications_controller_spec.rb +93 -0
  63. data/spec/controllers/authorizations_controller_spec.rb +140 -61
  64. data/spec/controllers/protected_resources_controller_spec.rb +3 -3
  65. data/spec/controllers/tokens_controller_spec.rb +205 -37
  66. data/spec/dummy/config/application.rb +3 -1
  67. data/spec/dummy/config/initializers/doorkeeper.rb +54 -9
  68. data/spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb +1 -1
  69. data/spec/lib/config_spec.rb +43 -1
  70. data/spec/lib/oauth/authorization_code_request_spec.rb +11 -1
  71. data/spec/lib/oauth/base_request_spec.rb +33 -16
  72. data/spec/lib/oauth/client_credentials/creator_spec.rb +3 -0
  73. data/spec/lib/oauth/code_request_spec.rb +27 -28
  74. data/spec/lib/oauth/helpers/uri_checker_spec.rb +17 -2
  75. data/spec/lib/oauth/invalid_request_response_spec.rb +75 -0
  76. data/spec/lib/oauth/pre_authorization_spec.rb +76 -66
  77. data/spec/lib/oauth/refresh_token_request_spec.rb +1 -0
  78. data/spec/lib/oauth/token_request_spec.rb +20 -17
  79. data/spec/lib/server_spec.rb +0 -12
  80. data/spec/requests/endpoints/authorization_spec.rb +21 -5
  81. data/spec/requests/endpoints/token_spec.rb +1 -1
  82. data/spec/requests/flows/authorization_code_errors_spec.rb +1 -0
  83. data/spec/requests/flows/authorization_code_spec.rb +93 -27
  84. data/spec/requests/flows/client_credentials_spec.rb +38 -0
  85. data/spec/requests/flows/implicit_grant_errors_spec.rb +22 -10
  86. data/spec/requests/flows/implicit_grant_spec.rb +9 -8
  87. data/spec/requests/flows/password_spec.rb +37 -0
  88. data/spec/requests/flows/refresh_token_spec.rb +1 -1
  89. data/spec/requests/flows/revoke_token_spec.rb +19 -11
  90. data/spec/support/doorkeeper_rspec.rb +1 -1
  91. data/spec/support/helpers/request_spec_helper.rb +14 -2
  92. data/spec/validators/redirect_uri_validator_spec.rb +40 -15
  93. metadata +15 -13
  94. data/.coveralls.yml +0 -1
  95. data/.github/ISSUE_TEMPLATE.md +0 -25
  96. data/.github/PULL_REQUEST_TEMPLATE.md +0 -17
  97. data/.gitignore +0 -20
  98. data/.gitlab-ci.yml +0 -16
  99. data/.hound.yml +0 -3
  100. data/.rspec +0 -1
  101. data/.rubocop.yml +0 -50
  102. data/.travis.yml +0 -35
  103. data/app/validators/redirect_uri_validator.rb +0 -50
data/NEWS.md CHANGED
@@ -1,814 +1 @@
1
- # News
2
-
3
- See https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions for
4
- upgrade guides.
5
-
6
- User-visible changes worth mentioning.
7
-
8
- ## master
9
-
10
- - [#PR] Add your PR description here.
11
-
12
- ## 5.1.0
13
-
14
- - [#1243]: Add nil check operator in token checking at token introspection.
15
- - [#1241] Explaining foreign key options for resource owner in a single place
16
- - [#1237] Allow to set blank redirect URI if Doorkeeper configured to use redirect URI-less grant flows.
17
- - [#1234] Fix `StaleRecordsCleaner` to properly work with big amount of records.
18
- - [#1228] Allow to explicitly set non-expiring tokens in `custom_access_token_expires_in` configuration
19
- option using `Float::INIFINITY` return value.
20
- - [#1224] Do not try to store token if not found by fallback hashing strategy.
21
- - [#1223] Update Hound/Rubocop rules, correct Doorkeeper codebase to follow style-guides.
22
- - [#1220] Drop Rails 4.2 & Ruby < 2.4 support.
23
-
24
- ## 5.1.0.rc2
25
-
26
- - [#1208] Unify hashing implementation into secret storing strategies
27
-
28
- **[IMPORTANT]**: If you have been using the master branch of doorkeeper with bcrypt in your Gemfile.lock,
29
- your application secrets have been hashed using BCrypt. To restore this behavior, use the initializer option
30
- `use_application_hashing using: 'Doorkeeper::SecretStoring::BCrypt`.
31
-
32
- - [#1216] Add nil check to `expires_at` method.
33
- - [#1215] Fix deprecates for Rails 6.
34
- - [#1214] Scopes field accepts array.
35
- - [#1209] Fix tokens validation for Token Introspection request.
36
- - [#1202] Use correct HTTP status codes for error responses.
37
-
38
- **[IMPORTANT]**: this change might break your application if you were relying on the previous
39
- 401 status codes, this is now a 400 by default, or a 401 for `invalid_client` and `invalid_token` errors.
40
-
41
- - [#1201] Fix custom TTL block `client` parameter to always be an `Doorkeeper::Application` instance.
42
-
43
- **[IMPORTANT]**: those who defined `custom_access_token_expires_in` configuration option need to check
44
- their block implementation: if you are using `oauth_client.application` to get `Doorkeeper::Application`
45
- instance, then you need to replace it with just `oauth_client`.
46
-
47
- - [#1200] Increase default Doorkeeper access token value complexity (`urlsafe_base64` instead of just `hex`)
48
- matching RFC6749/RFC6750.
49
-
50
- **[IMPORTANT]**: this change have possible side-effects in case you have custom database constraints for
51
- access token value, application secrets, refresh tokens or you patched Doorkeeper models and introduced
52
- token value validations, or you are using database with case-insensitive WHERE clause like MySQL
53
- (you can face some collisions). Before this change access token value matched `[a-f0-9]` regex, and now
54
- it matches `[a-zA-Z0-9\-_]`. In case you have such restrictions and your don't use custom token generator
55
- please change configuration option `default_generator_method ` to `:hex`.
56
-
57
- - [#1195] Allow to customize Token Introspection response (fixes #1194).
58
- - [#1189] Option to set `token_reuse_limit`.
59
- - [#1191] Try to load bcrypt for hashing of application secrets, but add fallback.
60
-
61
- ## 5.1.0.rc1
62
-
63
- - [#1188] Use `params` instead of `request.POST` in tokens controller (fixes #1183).
64
- - [#1182] Fix loopback IP redirect URIs to conform with RFC8252, p. 7.3 (fixes #1170).
65
- - [#1179] Authorization Code Grant Flow without client id returns invalid_client error.
66
- - [#1177] Allow to limit `scopes` for certain `grant_types`
67
- - [#1176] Fix test factory support for `factory_bot_rails`
68
- - [#1175] Internal refactor: use `scopes_string` inside `scopes`.
69
- - [#1168] Allow optional hashing of tokens and secrets.
70
- - [#1164] Fix error when `root_path` is not defined.
71
- - [#1162] Fix `enforce_content_type` for requests without body.
72
-
73
- ## 5.0.2
74
-
75
- - [#1158] Fix initializer template: change `handle_auth_errors` option
76
- - [#1157] Remove redundant index from migration template.
77
-
78
- ## 5.0.1
79
-
80
- - [#1154] Refactor `StaleRecordsCleaner` to be ORM agnostic.
81
- - [#1152] Fix migration template: change resource owner data type from integer to Rails generic `references`
82
- - [#1151] Fix Refresh Token strategy: add proper validation of client credentials both for Public & Private clients.
83
- - [#1149] Fix for `URIChecker#valid_for_authorization?` false negative when query is blank, but `?` present.
84
- - [#1140] Allow rendering custom errors from exceptions (issue #844). Originally opened as [#944].
85
- - [#1138] Revert regression bug (check for token expiration in Authorizations controller so authorization
86
- triggers every time)
87
-
88
- ## 5.0.0
89
-
90
- - [#1127] Change the token_type initials of the Banner Token to uppercase to comply with the RFC6750 specification.
91
-
92
- ## 5.0.0.rc2
93
-
94
- - [#1122] Fix AuthorizationsController#new error response to be in JSON format
95
- - [#1119] Fix token revocation for OAuth apps using "implicit" grant flow
96
- - [#1116] `AccessGrant`s will now be revoked along with `AccessToken`s when
97
- hitting the `AuthorizedApplicationController#destroy` route.
98
- - [#1114] Make token info endpoint's attributes consistent with token creation
99
- - [#1108] Simple formating of callback URLs when listing oauth applications
100
- - [#1106] Restrict access to AdminController with 'Forbidden 403' if admin_authenticator is not
101
- configured by developers.
102
-
103
- ## 5.0.0.rc1
104
-
105
- - [#1103] Allow customizing use_refresh_token
106
- - [#1089] Removed enable_pkce_without_secret configuration option
107
- - [#1102] Expiration time based on scopes
108
- - [#1099] All the configuration variables in `Doorkeeper.configuration` now
109
- always return a non-nil value (`true` or `false`)
110
- - [#1099] ORM / Query optimization: Do not revoke the refresh token if it is not enabled
111
- in `doorkeeper.rb`
112
- - [#996] Expiration Time Base On Grant Type
113
- - [#997] Allow PKCE authorization_code flow as specified in RFC7636
114
- - [#907] Fix lookup for matching tokens in certain edge-cases
115
- - [#992] Add API option to use Doorkeeper without management views for API only
116
- Rails applications (`api_only`)
117
- - [#1045] Validate redirect_uri as the native URI when making authorization code requests
118
- - [#1048] Remove deprecated `Doorkeeper#configured?`, `Doorkeeper#database_installed?`, and
119
- `Doorkeeper#installed?` method
120
- - [#1031] Allow public clients to authenticate without `client_secret`. Define an app as
121
- either public or private/confidential
122
-
123
- **[IMPORTANT]**: all the applications (clients) now are considered as private by default.
124
- You need to manually change `confidential` column to `false` if you are using public clients,
125
- in other case your mobile (or other) applications will not be able to authorize.
126
- See [#1142](https://github.com/doorkeeper-gem/doorkeeper/issues/1142) for more details.
127
-
128
- - [#1010] Add configuration to enforce configured scopes (`default_scopes` and
129
- `optional_scopes`) for applications
130
- - [#1060] Ensure that the native redirect_uri parameter matches with redirect_uri of the client
131
- - [#1064] Add :before_successful_authorization and :after_successful_authorization hooks
132
- - [#1069] Upgrade Bootstrap to 4 for Admin
133
- - [#1068] Add rake task to cleanup databases that can become large over time
134
- - [#1072] AuthorizationsController: Memoize strategy.authorize_response result to enable
135
- subclasses to use the response object.
136
- - [#1075] Call `before_successful_authorization` and `after_successful_authorization` hooks
137
- on `create` action as well as `new`
138
- - [#1082] Fix #916: remember routes mapping and use it required places (fix error with
139
- customized Token Info route).
140
- - [#1086, #1088] Fix bug with receiving default scopes in the token even if they are
141
- not present in the application scopes (use scopes intersection).
142
- - [#1076] Add config to enforce content type to application/x-www-form-urlencoded
143
- - Fix bug with `force_ssl_in_redirect_uri` when it breaks existing applications with an
144
- SSL redirect_uri.
145
-
146
- ## 4.4.3
147
-
148
- - [#1143] Adds a config option `opt_out_native_route_change` to opt out of the breaking api
149
- changed introduced in https://github.com/doorkeeper-gem/doorkeeper/pull/1003
150
-
151
-
152
- ## 4.4.2
153
-
154
- - [#1130] Backport fix for native redirect_uri from 5.x.
155
-
156
- ## 4.4.1
157
-
158
- - [#1127] Backport token type to comply with the RFC6750 specification.
159
- - [#1125] Backport Quote surround I18n yes/no keys
160
-
161
- ## 4.4.0
162
-
163
- - [#1120] Backport security fix from 5.x for token revocation when using public clients
164
-
165
- **[IMPORTANT]**: all the applications (clients) now are considered as private by default.
166
- You need to manually change `confidential` column to `false` if you are using public clients,
167
- in other case your mobile (or other) applications will not be able to authorize.
168
- See [#1142](https://github.com/doorkeeper-gem/doorkeeper/issues/1142) for more details.
169
-
170
- ## 4.3.2
171
-
172
- - [#1053] Support authorizing with query params in the request `redirect_uri` if explicitly present in app's `Application#redirect_uri`
173
-
174
- ## 4.3.1
175
-
176
- - Remove `BaseRecord` and introduce additional concern for ordering methods to fix
177
- braking changes for Doorkeeper models.
178
- - [#1032] Refactor BaseRequest callbacks into configurable lambdas
179
- - [#1040] Clear mixins from ActiveRecord DSL and save only overridable API. It
180
- allows to use this mixins in Doorkeeper ORM extensions with minimum code boilerplate.
181
-
182
- ## 4.3.0
183
-
184
- - [#976] Fix to invalidate the second redirect URI when the first URI is the native URI
185
- - [#1035] Allow `Application#redirect_uri=` to handle array of URIs.
186
- - [#1036] Allow to forbid Application redirect URI's with specific rules.
187
- - [#1029] Deprecate `order_method` and introduce `ordered_by`. Sort applications
188
- by `created_at` in index action.
189
- - [#1033] Allow Doorkeeper configuration option #force_ssl_in_redirect_uri to be a callable object.
190
- - Fix Grape integration & add specs for it
191
- - [#913] Deferred ORM (ActiveRecord) models loading
192
- - [#943] Fix Access Token token generation when certain errors occur in custom token generators
193
- - [#1026] Implement RFC7662 - OAuth 2.0 Token Introspection
194
- - [#985] Generate valid migration files for Rails >= 5
195
- - [#972] Replace Struct subclassing with block-form initialization
196
- - [#1003] Use URL query param to pass through native redirect auth code so automated apps can find it.
197
-
198
- **[IMPORTANT]**: Previously authorization code response route was `/oauth/authorize/<code>`,
199
- now it is `oauth/authorize/native?code=<code>` (in order to help applications to automatically find the code value).
200
-
201
- - [#868] `Scopes#&` and `Scopes#+` now take an array or any other enumerable
202
- object.
203
- - [#1019] Remove translation not in use: `invalid_resource_owner`.
204
- - Use Ruby 2 hash style syntax (min required Ruby version = 2.1)
205
- - [#948] Make Scopes.<=> work with any "other" value.
206
- - [#974] Redirect URI is checked without query params within AuthorizationCodeRequest.
207
- - [#1004] More explicit help text for `native_redirect_uri`.
208
- - [#1023] Update Ruby versions and test against 2.5.0 on Travis CI.
209
- - [#1024] Migrate from FactoryGirl to FactoryBot.
210
- - [#1025] Improve documentation for adding foreign keys
211
- - [#1028] Make it possible to have composite strategy names.
212
-
213
- ## 4.2.6
214
-
215
- - [#970] Escape certain attributes in authorization forms.
216
-
217
- ## 4.2.5
218
-
219
- - [#936] Deprecate `Doorkeeper#configured?`, `Doorkeeper#database_installed?`, and
220
- `Doorkeeper#installed?`
221
- - [#909] Add `InvalidTokenResponse#reason` reader method to allow read the kind
222
- of invalid token error.
223
- - [#928] Test against more recent Ruby versions
224
- - Small refactorings within the codebase
225
- - [#921] Switch to Appraisal, and test against Rails master
226
- - [#892] Add minimum Ruby version requirement
227
-
228
- ## 4.2.0
229
-
230
- - Security fix: Address CVE-2016-6582, implement token revocation according to
231
- spec (tokens might not be revoked if client follows the spec).
232
- - [#873] Add hooks to Doorkeeper::ApplicationMetalController
233
- - [#871] Allow downstream users to better utilize doorkeeper spec factories by
234
- eliminating name conflict on `:user` factory.
235
-
236
- ## 4.1.0
237
-
238
- - [#845] Allow customising the `Doorkeeper::ApplicationController` base
239
- controller
240
-
241
- ## 4.0.0
242
-
243
- - [#834] Fix AssetNotPrecompiled error with Sprockets 4
244
- - [#843] Revert "Fix validation error messages"
245
- - [#847] Specify Null option to timestamps
246
-
247
- ## 4.0.0.rc4
248
-
249
- - [#777] Add support for public client in password grant flow
250
- - [#823] Make configuration and specs ORM independent
251
- - [#745] Add created_at timestamp to token generation options
252
- - [#838] Drop `Application#scopes` generator and warning, introduced for
253
- upgrading doorkeeper from v2 to v3.
254
- - [#801] Fix Rails 5 warning messages
255
- - Test against Rails 5 RC1
256
-
257
- ## 4.0.0.rc3
258
-
259
- - [#769] Revoke refresh token on access token use. To make use of the new config
260
- add `previous_refresh_token` column to `oauth_access_tokens`:
261
-
262
- ```
263
- rails generate doorkeeper:previous_refresh_token
264
- ```
265
- - [#811] Toughen parameters filter with exact match
266
- - [#813] Applications admin bugfix
267
- - [#799] Fix Ruby Warnings
268
- - Drop `attr_accessible` from models
269
-
270
- ### Backward incompatible changes
271
-
272
- - [#730] Force all timezones to use UTC to prevent comparison issues.
273
- - [#802] Remove `config.i18n.fallbacks` from engine
274
-
275
- ## 4.0.0.rc2
276
-
277
- - Fix optional belongs_to for Rails 5
278
- - Fix Ruby warnings
279
-
280
- ## 4.0.0.rc1
281
-
282
- ### Backward incompatible changes
283
-
284
- - Drops support for Rails 4.1 and earlier
285
- - Drops support for Ruby 2.0
286
- - [#778] Bug fix: use the remaining time that a token is still valid when
287
- building the redirect URI for the implicit grant flow
288
-
289
- ### Other changes
290
-
291
- - [#771] Validation error messages fixes
292
- - Adds foreign key constraints in generated migrations between tokens and
293
- grants, and applications
294
- - Support Rails 5
295
-
296
- ## 3.1.0
297
-
298
- - [#736] Existing valid tokens are now reused in client_credentials flow
299
- - [#749] Allow user to raise authorization error with custom messages.
300
- Under `resource_owner_authenticator` block a user can
301
- `raise Doorkeeper::Errors::DoorkeeperError.new('custom_message')`
302
- - [#762] Check doesn’t abort the actual migration, so it runs
303
- - [#722] `doorkeeper_forbidden_render_options` now supports returning a 404 by
304
- specifying `respond_not_found_when_forbidden: true` in the
305
- `doorkeeper_forbidden_render_options` method.
306
- - [#734] Simplify and remove duplication in request strategy classes
307
-
308
- ## 3.0.1
309
-
310
- - [#712] Wrap exchange of grant token for access token and access token refresh
311
- in transactions
312
- - [#704] Allow applications scopes to be mass assigned
313
- - [#707] Fixed order of Mixin inclusion and table_name configuration in models
314
- - [#712] Wrap access token and refresh grants in transactions
315
- - Adds JRuby support
316
- - Specs, views and documentation adjustments
317
-
318
- ## 3.0.0
319
-
320
- ### Other changes
321
-
322
- - [#693] Updates `en.yml`.
323
-
324
- ## 3.0.0 (rc2)
325
-
326
- ### Backward incompatible changes
327
-
328
- - [#678] Change application-specific scopes to take precedence over server-wide
329
- scopes. This removes the previous behavior where the intersection between
330
- application and server scopes was used.
331
-
332
- ### Other changes
333
-
334
- - [#671] Fixes `NoMethodError - undefined method 'getlocal'` when calling
335
- the /oauth/token path. Switch from using a DateTime object to update
336
- AR to using a Time object. (Issue #668)
337
- - [#677] Support editing application-specific scopes via the standard forms
338
- - [#682] Pass error hash to Grape `error!`
339
- - [#683] Generate application secret/UID if fields are blank strings
340
-
341
- ## 3.0.0 (rc1)
342
-
343
- ### Backward incompatible changes
344
-
345
- - [#648] Extracts mongodb ORMs to
346
- https://github.com/doorkeeper-gem/doorkeeper-mongodb. If you use ActiveRecord
347
- you don’t need to do any change, otherwise you will need to install the new
348
- plugin.
349
- - [#665] `doorkeeper_unauthorized_render_options(error:)` and
350
- `doorkeeper_forbidden_render_options(error:)` now accept `error` keyword
351
- argument.
352
-
353
- ### Removed deprecations
354
-
355
- - Removes `doorkeeper_for` deprecation notice.
356
- - Remove `applications.scopes` upgrade notice.
357
-
358
-
359
- ## 2.2.2
360
-
361
- - [#541] Fixed `undefined method attr_accessible` problem on Rails 4
362
- (happens only when ProtectedAttributes gem is used) in #599
363
-
364
- ## 2.2.1
365
-
366
- - [#636] `custom_access_token_expires_in` bugfixes
367
- - [#641] syntax error fix (Issue #612)
368
- - [#633] Send extra details to Custom Token Generator
369
- - [#628] Refactor: improve orm adapters to ease extension
370
- - [#637] Upgrade to rspec to 3.2
371
-
372
- ## 2.2.0 - 2015-04-19
373
-
374
- - [#611] Allow custom access token generators to be used
375
- - [#632] Properly fallback to `default_scopes` when no scope is specified
376
- - [#622] Clarify that there is a logical OR between scopes for authorizing
377
- - [#635] Upgrade to rspec 3
378
- - [#627] i18n fallbacks to english
379
- - Moved CHANGELOG to NEWS.md
380
-
381
-
382
- ## 2.1.4 - 2015-03-27
383
-
384
- - [#595] HTTP spec: Add `scope` for refresh token scope param
385
- - [#596] Limit scopes in app scopes for client credentials
386
- - [#567] Add Grape helpers for easier integration with Grape framework
387
- - [#606] Add custom access token expiration support for Client Credentials flow
388
-
389
-
390
- ## 2.1.3 - 2015-03-01
391
-
392
- - [#588] Fixes scopes_match? bug that skipped authorization form in some cases
393
-
394
-
395
- ## 2.1.2 - 2015-02-25
396
-
397
- - [#574] Remove unused update authorization route.
398
- - [#576] Filter out sensitive parameters from logs.
399
- - [#582] The Authorization HTTP header fields are now case insensitive.
400
- - [#583] Database connection bugfix in certain scenarios.
401
- - Testing improvements
402
-
403
-
404
- ## 2.1.1 - 2015-02-06
405
-
406
- - Remove `wildcard_redirect_url` option
407
- - [#481] Customize token flow OAuth expirations with a config lambda
408
- - [#568] TokensController: Memoize strategy.authorize_response result to enable
409
- subclasses to use the response object.
410
- - [#571] Fix database initialization issues in some configurations.
411
- - Documentation improvements
412
-
413
-
414
- ## 2.1.0 - 2015-01-13
415
-
416
- - [#540] Include `created_at` in response.
417
- - [#538] Check application-level scopes in client_credentials and password flow.
418
- - [5596227] Check application scopes in AccessToken when present. Fixes a bug in
419
- doorkeeper 2.0.0 and 2.0.1 referring to application specific scopes.
420
- - [#534] Internationalizes doorkeeper views.
421
- - [#545] Ensure there is a connection to the database before checking for
422
- missing columns
423
- - [#546] Use `Doorkeeper::` prefix when referencing `Application` to avoid
424
- possible application model name conflict.
425
- - [#538] Test with Rails ~> 4.2.
426
-
427
- ### Potentially backward incompatible changes
428
-
429
- - Enable by default `authorization_code` and `client_credentials` grant flows.
430
- Disables implicit and password grant flows by default.
431
- - [#510, #544, 722113f] Revoked refresh token response bugfix.
432
-
433
-
434
- ## 2.0.1 - 2014-12-17
435
-
436
- - [#525, #526, #527] Fix `ActiveRecord::NoDatabaseError` on gem load.
437
-
438
-
439
- ## 2.0.0 - 2014-12-16
440
-
441
- ### Backward incompatible changes
442
-
443
- - [#448] Removes `doorkeeper_for` helper. Now we use
444
- `before_action :doorkeeper_authorize!`.
445
- - [#469] Allow client applications to restrict the set of allowable scopes.
446
- Fixes #317. `oauth_applications` relation needs a new `scopes` string column,
447
- non nullable, which defaults to an empty string. To add the column run:
448
-
449
- ```
450
- rails generate doorkeeper:application_scopes
451
- ```
452
-
453
- If you’d rather do it by hand, your ActiveRecord migration should contain:
454
-
455
- ```ruby
456
- add_column :oauth_applications, :scopes, :string, null: false, default: ‘’
457
- ```
458
-
459
- ### Removed deprecations
460
-
461
- - Removes `test_redirect_uri` option. It is now called `native_redirect_uri`.
462
- - [#446] Removes `mount Doorkeeper::Engine`. Now we use `use_doorkeeper`.
463
-
464
- ### Others
465
-
466
- - [#484] Performance improvement - avoid performing order_by when not required.
467
- - [#450] When password is invalid in Password Credentials Grant, Doorkeeper
468
- returned 'invalid_resource_owner' instead of 'invalid_grant', as the spec
469
- declares. Fixes #444.
470
- - [#452] Allows `revoked_at` to be set in the future, for future expiry.
471
- Rationale: https://github.com/doorkeeper-gem/doorkeeper/pull/452#issuecomment-51431459
472
- - [#480] For Implicit grant flow, access tokens can now be reused. Fixes #421.
473
- - [#491] Reworks of @jasl's #454 and #478. ORM refactor that allows doorkeeper
474
- to be extended more easily with unsupported ORMs. It also marks the boundaries
475
- between shared model code and ORM specifics inside of the gem.
476
- - [#496] Tests with Rails 4.2.
477
- - [#489] Adds `force_ssl_in_redirect_uri` to force the usage of the HTTPS
478
- protocol in non-native redirect uris.
479
- - [#516] SECURITY: Adds `protect_from_forgery` to `Doorkeeper::ApplicationController`
480
- - [#518] Fix random failures in mongodb.
481
-
482
- ---
483
-
484
- ## 1.4.2 - 2015-03-02
485
-
486
- - [#576] Filter out sensitive parameters from logs
487
-
488
- ## 1.4.1 - 2014-12-17
489
-
490
- - [#516] SECURITY: Adds `protect_from_forgery` to `Doorkeeper::ApplicationController`
491
-
492
- ## 1.4.0 - 2014-07-31
493
-
494
- - internals
495
- - [#427] Adds specs expectations.
496
- - [#428] Error response refactor.
497
- - [#417] Moves token validation into Access Token class.
498
- - [#439] Removes redundant module includes.
499
- - [#443] TokensController and TokenInfoController inherit from ActionController::Metal
500
- - bug
501
- - [#418] fixes #243, requests with insufficient scope now respond 403 instead
502
- of 401. (API change)
503
- - [#438] fixes #398, native redirect for implicit token grant bug.
504
- - [#440] namespace fixes
505
- - enhancements
506
- - [#432] Keeps query parameters
507
-
508
- ## 1.3.1 - 2014-07-06
509
-
510
- - enhancements
511
- - [#405] Adds facade to more easily get the token from a request in a route
512
- constraint.
513
- - [#415] Extend Doorkeeper TokenResponse with an `after_successful_response`
514
- callback that allows handling of `response` object.
515
- - internals
516
- - [#409] Deprecates `test_redirect_uri` in favor of `native_redirect_uri`.
517
- See discussion in: [#351].
518
- - [#411] Clean rspec deprecations. General test improvements.
519
- - [#412] rspec line width can go longer than 80 (hound CI config).
520
- - bug
521
- - [#413] fixes #340, routing scope is now taken into account in redirect.
522
- - [#401] and [#425] application is not required any longer for access_token.
523
-
524
- ## 1.3.0 - 2014-05-23
525
-
526
- - enhancements
527
- - [#387] Adds reuse_access_token configuration option.
528
-
529
- ## 1.2.0 - 2014-05-02
530
-
531
- - enhancements
532
- - [#376] Allow users to enable basic header authorization for access tokens.
533
- - [#374] Token revocation implementation [RFC 7009]
534
- - [#295] Only enable specific grant flows.
535
- - internals
536
- - [#381] Locale source fix.
537
- - [#380] Renames `errors_for` to `doorkeeper_errors_for`.
538
- - [#390] Style adjustments in accordance with Ruby Style Guide form
539
- Thoughtbot.
540
-
541
- ## 1.1.0 - 2014-03-29
542
-
543
- - enhancements
544
- - [#336] mongoid4 support.
545
- - [#372] Allow users to set ActiveRecord table_name_prefix/suffix options
546
- - internals
547
- - [#343] separate OAuth's admin and user end-point to different layouts, upgrade theme to Bootstrap 3.1.
548
- - [#348] Move render_options in filter after `@error` has been set
549
-
550
- ## 1.0.0 - 2014-01-13
551
-
552
- - bug (spec)
553
- - [#228] token response `expires_in` value is now in seconds, relative to
554
- request time
555
- - [#296] client is optional for password grant type.
556
- - [#319] If client credentials are present on password grant type they are validated
557
- - [#326] If client credentials are present in refresh token they are validated
558
- - [#326] If authenticated client does not match original client that
559
- obtained a refresh token it responds `invalid_grant` instead of
560
- `invalid_client`. Previous usage was invalid according to Section 5.2 of
561
- the spec.
562
- - [#329] access tokens' `scopes` string wa being compared against
563
- `default_scopes` symbols, always unauthorizing.
564
- - [#318] Include "WWW-Authenticate" header with Unauthorized responses
565
- - enhancements
566
- - [#293] Adds ActionController::Instrumentation in TokensController
567
- - [#298] Support for multiple redirect_uris added.
568
- - [#313] `AccessToken.revoke_all_for` actually revokes all non-revoked
569
- tokens for an application/owner instead of deleting them.
570
- - [#333] Rails 4.1 support
571
- - internals
572
- - Removes jQuery dependency [fixes #300] [PR #312 is related]
573
- - [#294] Client uid and secret will be generated only if not present.
574
- - [#316] Test warnings addressed.
575
- - [#338] Rspec 3 syntax.
576
-
577
- ---
578
-
579
- ## 0.7.4 - 2013-12-01
580
-
581
- - bug
582
- - Symbols instead of strings for user input.
583
-
584
- ## 0.7.3 - 2013-10-04
585
-
586
- - enhancements
587
- - [#204] Allow to overwrite scope in routes
588
- - internals
589
- - Returns only present keys in Token Response (may imply a backwards
590
- incompatible change). https://github.com/doorkeeper-gem/doorkeeper/issues/220
591
- - bug
592
- - [#290] Support for Rails 4 when 'protected_attributes' gem is present.
593
-
594
- ## 0.7.2 - 2013-09-11
595
-
596
- - enhancements
597
- - [#272] Allow issuing multiple access_tokens for one user/application for multiple devices
598
- - [#170] Increase length of allowed redirect URIs
599
- - [#239] Do not try to load unavailable Request class for the current phase.
600
- - [#273] Relax jquery-rails gem dependency
601
-
602
- ## 0.7.1 - 2013-08-30
603
-
604
- - bug
605
- - [#269] Rails 3.2 raised `ActiveModel::MassAssignmentSecurity::Error`.
606
-
607
- ## 0.7.0 - 2013-08-21
608
-
609
- - enhancements
610
- - [#229] Rails 4!
611
- - internals
612
- - [#203] Changing table name to be specific in column_names_with_table
613
- - [#215] README update
614
- - [#227] Use Rails.config.paths["config/routes"] instead of assuming "config/routes.rb" exists
615
- - [#262] Add jquery as gem dependency
616
- - [#263] Add a configuration for ActiveRecord.establish_connection
617
- - Deprecation and Ruby warnings (PRs merged outside of GitHub).
618
-
619
- ## 0.6.7 - 2013-01-13
620
-
621
- - internals
622
- - [#188] Add IDs to the show views for integration testing [@egtann](https://github.com/egtann)
623
-
624
- ## 0.6.6 - 2013-01-04
625
-
626
- - enhancements
627
- - [#187] Raise error if configuration is not set
628
-
629
- ## 0.6.5 - 2012-12-26
630
-
631
- - enhancements
632
- - [#184] Vendor the Bootstrap CSS [@tylerhunt](https://github.com/tylerhunt)
633
-
634
- ## 0.6.4 - 2012-12-15
635
-
636
- - bug
637
- - [#180] Add localization to authorized_applications destroy notice [@aalvarado](https://github.com/aalvarado)
638
-
639
- ## 0.6.3 - 2012-12-07
640
-
641
- - bugfixes
642
- - [#163] Error response content-type header should be application/json [@ggayan](https://github.com/ggayan)
643
- - [#175] Make token.expires_in_seconds return nil when expires_in is nil [@miyagawa](https://github.com/miyagawa)
644
- - enhancements
645
- - [#166, #172, #174] Behavior to automatically authorize based on a configured proc
646
- - internals
647
- - [#168] Using expectation syntax for controller specs [@rdsoze](https://github.com/rdsoze)
648
-
649
- ## 0.6.2 - 2012-11-10
650
-
651
- - bugfixes
652
- - [#162] Remove ownership columns from base migration template [@rdsoze](https://github.com/rdsoze)
653
-
654
- ## 0.6.1 - 2012-11-07
655
-
656
- - bugfixes
657
- - [#160] Removed |routes| argument from initializer authenticator blocks
658
- - documentation
659
- - [#160] Fixed description of context of authenticator blocks
660
-
661
- ## 0.6.0 - 2012-11-05
662
-
663
- - enhancements
664
- - Mongoid `orm` configuration accepts only :mongoid2 or :mongoid3
665
- - Authorization endpoint does not redirect in #new action anymore. It wasn't specified by OAuth spec
666
- - TokensController now inherits from ActionController::Metal. There might be performance upgrades
667
- - Add link to authorization in Applications scaffold
668
- - [#116] MongoMapper support [@carols10cents](https://github.com/carols10cents)
669
- - [#122] Mongoid3 support [@petergoldstein](https://github.com/petergoldstein)
670
- - [#150] Introduce test redirect uri for applications
671
- - bugfixes
672
- - [#157] Response token status should be `:ok`, not `:success` [@theycallmeswift](https://github.com/theycallmeswift)
673
- - [#159] Remove ActionView::Base.field_error_proc override (fixes #145)
674
- - internals
675
- - Update development dependencies
676
- - Several refactorings
677
- - Rails/ORM are easily swichable with env vars (rails and orm)
678
- - Travis now tests against Mongoid v2
679
-
680
- ## 0.5.0 - 2012-10-20
681
-
682
- Official support for rubinius was removed.
683
-
684
- - enhancements
685
- - Configure the way access token is retrieved from request (default to bearer header)
686
- - Authorization Code expiration time is now configurable
687
- - Add support for mongoid
688
- - [#78, #128, #137, #138] Application Ownership
689
- - [#92] Allow users to skip controllers
690
- - [#99] Remove deprecated warnings for data-* attributes [@towerhe](https://github.com/towerhe)
691
- - [#101] Return existing access_token for PasswordAccessTokenRequest [@benoist](https://github.com/benoist)
692
- - [#104] Changed access token scopes example code to default_scopes and optional_scopes [@amkirwan](https://github.com/amkirwan)
693
- - [#107] Fix typos in initializer
694
- - [#123] i18n for validator, flash messages [@petergoldstein](https://github.com/petergoldstein)
695
- - [#140] ActiveRecord is the default value for the ORM [@petergoldstein](https://github.com/petergoldstein)
696
- - internals
697
- - [#112, #120] Replacing update_attribute with update_column to eliminate deprecation warnings [@rmoriz](https://github.com/rmoriz), [@petergoldstein](https://github.com/petergoldstein)
698
- - [#121] Updating all development dependencies to recent versions. [@petergoldstein](https://github.com/petergoldstein)
699
- - [#144] Adding MongoDB dependency to .travis.yml [@petergoldstein](https://github.com/petergoldstein)
700
- - [#143] Displays errors for unconfigured error messages [@timgaleckas](https://github.com/timgaleckas)
701
- - bugfixes
702
- - [#102] Not returning 401 when access token generation fails [@cslew](https://github.com/cslew)
703
- - [#125] Doorkeeper is using ActiveRecord version of as_json in ORM agnostic code [@petergoldstein](https://github.com/petergoldstein)
704
- - [#142] Prevent double submission of password based authentication [@bdurand](https://github.com/bdurand)
705
- - documentation
706
- - [#141] Add rack-cors middleware to readme [@gottfrois](https://github.com/gottfrois)
707
-
708
- ## 0.4.2 - 2012-06-05
709
-
710
- - bugfixes:
711
- - [#94] Uninitialized Constant in Password Flow
712
-
713
- ## 0.4.1 - 2012-06-02
714
-
715
- - enhancements:
716
- - Backport: Move doorkeeper_for extension to Filter helper
717
-
718
- ## 0.4.0 - 2012-05-26
719
-
720
- - deprecation
721
- - Deprecate authorization_scopes
722
- - database changes
723
- - AccessToken#resource_owner_id is not nullable
724
- - enhancements
725
- - [#83] Add Resource Owner Password Credentials flow [@jaimeiniesta](https://github.com/jaimeiniesta)
726
- - [#76] Allow token expiration to be disabled [@mattgreen](https://github.com/mattgreen)
727
- - [#89] Configure the way client credentials are retrieved from request
728
- - [#b6470a] Add Client Credentials flow
729
- - internals
730
- - [#2ece8d, #f93778] Introduce Client and ErrorResponse classes
731
-
732
- ## 0.3.4 - 2012-05-24
733
-
734
- - Fix attr_accessible for rails 3.2.x
735
-
736
- ## 0.3.3 - 2012-05-07
737
-
738
- - [#86] shrink gem package size
739
-
740
- ## 0.3.2 - 2012-04-29
741
-
742
- - enhancements
743
- - [#54] Ignore Authorization: headers that are not Bearer [@miyagawa](https://github.com/miyagawa)
744
- - [#58, #64] Add destroy action to applications endpoint [@jaimeiniesta](https://github.com/jaimeiniesta), [@davidfrey](https://github.com/davidfrey)
745
- - [#63] TokensController responds with `401 unauthorized` [@jaimeiniesta](https://github.com/jaimeiniesta)
746
- - [#67, #72] Fix for mass-assignment [@cicloid](https://github.com/cicloid)
747
- - internals
748
- - [#49] Add Gemnasium status image to README [@laserlemon](https://github.com/laserlemon)
749
- - [#50] Fix typos [@tomekw](https://github.com/tomekw)
750
- - [#51] Updated the factory_girl_rails dependency, fix expires_in response which returned a float number instead of integer [@antekpiechnik](https://github.com/antekpiechnik)
751
- - [#62] Typos, .gitignore [@jaimeiniesta](https://github.com/jaimeiniesta)
752
- - [#65] Change _path redirections to _url redirections [@jaimeiniesta](https://github.com/jaimeiniesta)
753
- - [#75] Fix unknown method #authenticate_admin! [@mattgreen](https://github.com/mattgreen)
754
- - Remove application link in authorized app view
755
-
756
- ## 0.3.1 - 2012-02-17
757
-
758
- - enhancements
759
- - [#48] Add if, else options to doorkeeper_for
760
- - Add views generator
761
- - internals
762
- - Namespace models
763
-
764
- ## 0.3.0 - 2012-02-11
765
-
766
- - enhancements
767
- - [#17, #31] Add support for client credentials in basic auth header [@GoldsteinTechPartners](https://github.com/GoldsteinTechPartners)
768
- - [#28] Add indices to migration [@GoldsteinTechPartners](https://github.com/GoldsteinTechPartners)
769
- - [#29] Allow doorkeeper to run with rails 3.2 [@john-griffin](https://github.com/john-griffin)
770
- - [#30] Improve client's redirect uri validation [@GoldsteinTechPartners](https://github.com/GoldsteinTechPartners)
771
- - [#32] Add token (implicit grant) flow [@GoldsteinTechPartners](https://github.com/GoldsteinTechPartners)
772
- - [#34] Add support for custom unathorized responses [@GoldsteinTechPartners](https://github.com/GoldsteinTechPartners)
773
- - [#36] Remove repetitions from the Authorised Applications view [@carvil](https://github.com/carvil)
774
- - When user revoke an application, all tokens for that application are revoked
775
- - Error messages now can be translated
776
- - Install generator copies the error messages localization file
777
- - internals
778
- - Fix deprecation warnings in ActiveSupport::Base64
779
- - Remove deprecation in doorkeeper_for that handles hash arguments
780
- - Depends on railties instead of whole rails framework
781
- - CI now integrates with rails 3.1 and 3.2
782
-
783
- ## 0.2.0 - 2011-12-17
784
-
785
- - enhancements
786
- - [#4] Add authorized applications endpoint
787
- - [#5, #11] Add access token scopes
788
- - [#10] Add access token expiration by default
789
- - [#9, #12] Add refresh token flow
790
- - internals
791
- - [#7] Improve configuration options with :default
792
- - Improve configuration options with :builder
793
- - Refactor config class
794
- - Improve coverage of authorization request integration
795
- - bug fixes
796
- - [#6, #20] Fix access token response headers
797
- - Fix issue with state parameter
798
- - deprecation
799
- - deprecate :only and :except options in doorkeeper_for
800
-
801
- ## 0.1.1 - 2011-11-30
802
-
803
- - enhancements
804
- - [#3] Authorization code must be short lived and single use
805
- - [#2] Improve views provided by doorkeeper
806
- - [#1] Skips authorization form if the client has been authorized by the resource owner
807
- - Improve readme
808
- - bugfixes
809
- - Fix issue when creating the access token (wrong client id)
810
-
811
- ## 0.1.0 - 2011-11-25
812
-
813
- - Authorization Code flow
814
- - OAuth applications endpoint
1
+ Document moved [here](CHANGELOG.md)