doorkeeper 5.1.1 → 5.2.0.rc1

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

Potentially problematic release.


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

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