doorkeeper 2.1.4 → 3.1.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.
- checksums.yaml +4 -4
- data/.hound.yml +4 -0
- data/.travis.yml +5 -24
- data/CONTRIBUTING.md +23 -13
- data/Gemfile +3 -7
- data/{CHANGELOG.md → NEWS.md} +137 -42
- data/README.md +60 -46
- data/RELEASING.md +5 -3
- data/app/assets/stylesheets/doorkeeper/admin/application.css +1 -5
- data/app/controllers/doorkeeper/applications_controller.rb +2 -2
- data/app/helpers/doorkeeper/dashboard_helper.rb +1 -1
- data/app/validators/redirect_uri_validator.rb +1 -1
- data/app/views/doorkeeper/applications/_form.html.erb +13 -2
- data/app/views/doorkeeper/applications/show.html.erb +3 -2
- data/app/views/doorkeeper/authorizations/new.html.erb +1 -1
- data/app/views/layouts/doorkeeper/admin.html.erb +5 -2
- data/config/locales/en.yml +4 -32
- data/doorkeeper.gemspec +4 -8
- data/lib/doorkeeper/config.rb +20 -29
- data/lib/doorkeeper/engine.rb +7 -1
- data/lib/doorkeeper/errors.rb +12 -0
- data/lib/doorkeeper/grape/helpers.rb +1 -1
- data/lib/doorkeeper/helpers/controller.rb +6 -0
- data/lib/doorkeeper/models/access_grant_mixin.rb +3 -2
- data/lib/doorkeeper/models/access_token_mixin.rb +12 -4
- data/lib/doorkeeper/models/application_mixin.rb +11 -18
- data/lib/doorkeeper/models/concerns/revocable.rb +2 -2
- data/lib/doorkeeper/oauth/authorization/token.rb +15 -6
- data/lib/doorkeeper/oauth/authorization_code_request.rb +10 -5
- data/lib/doorkeeper/oauth/client.rb +9 -8
- data/lib/doorkeeper/oauth/client_credentials/creator.rb +3 -4
- data/lib/doorkeeper/oauth/error.rb +5 -1
- data/lib/doorkeeper/oauth/helpers/scope_checker.rb +1 -1
- data/lib/doorkeeper/oauth/refresh_token_request.rb +17 -7
- data/lib/doorkeeper/orm/active_record/access_grant.rb +2 -2
- data/lib/doorkeeper/orm/active_record/access_token.rb +2 -2
- data/lib/doorkeeper/orm/active_record/application.rb +2 -2
- data/lib/doorkeeper/orm/active_record.rb +22 -0
- data/lib/doorkeeper/rails/helpers.rb +19 -29
- data/lib/doorkeeper/request/authorization_code.rb +10 -15
- data/lib/doorkeeper/request/client_credentials.rb +9 -15
- data/lib/doorkeeper/request/code.rb +7 -13
- data/lib/doorkeeper/request/password.rb +10 -15
- data/lib/doorkeeper/request/refresh_token.rb +11 -13
- data/lib/doorkeeper/request/strategy.rb +17 -0
- data/lib/doorkeeper/request/token.rb +7 -13
- data/lib/doorkeeper/request.rb +18 -8
- data/lib/doorkeeper/server.rb +2 -2
- data/lib/doorkeeper/version.rb +1 -1
- data/lib/doorkeeper.rb +0 -4
- data/lib/generators/doorkeeper/templates/README +0 -20
- data/lib/generators/doorkeeper/templates/initializer.rb +5 -3
- data/lib/generators/doorkeeper/templates/migration.rb +8 -0
- data/spec/controllers/applications_controller_spec.rb +0 -1
- data/spec/controllers/protected_resources_controller_spec.rb +115 -14
- data/spec/controllers/token_info_controller_spec.rb +0 -4
- data/spec/controllers/tokens_controller_spec.rb +34 -3
- data/spec/dummy/app/models/user.rb +2 -24
- data/spec/dummy/config/application.rb +2 -1
- data/spec/dummy/config/initializers/doorkeeper.rb +0 -2
- data/spec/helpers/doorkeeper/dashboard_helper_spec.rb +24 -0
- data/spec/lib/config_spec.rb +20 -4
- data/spec/lib/models/revocable_spec.rb +2 -2
- data/spec/lib/oauth/authorization_code_request_spec.rb +1 -1
- data/spec/lib/oauth/client/credentials_spec.rb +2 -2
- data/spec/lib/oauth/client_credentials/creator_spec.rb +25 -1
- data/spec/lib/oauth/error_response_spec.rb +7 -7
- data/spec/lib/oauth/error_spec.rb +9 -5
- data/spec/lib/oauth/helpers/scope_checker_spec.rb +3 -3
- data/spec/lib/oauth/password_access_token_request_spec.rb +1 -1
- data/spec/lib/oauth/pre_authorization_spec.rb +9 -10
- data/spec/lib/oauth/refresh_token_request_spec.rb +26 -6
- data/spec/lib/oauth/scopes_spec.rb +1 -1
- data/spec/lib/oauth/token_request_spec.rb +6 -3
- data/spec/lib/request/strategy_spec.rb +53 -0
- data/spec/lib/server_spec.rb +4 -2
- data/spec/models/doorkeeper/access_grant_spec.rb +5 -5
- data/spec/models/doorkeeper/access_token_spec.rb +102 -5
- data/spec/models/doorkeeper/application_spec.rb +13 -16
- data/spec/requests/applications/applications_request_spec.rb +1 -1
- data/spec/requests/endpoints/authorization_spec.rb +2 -1
- data/spec/requests/endpoints/token_spec.rb +9 -9
- data/spec/requests/flows/authorization_code_errors_spec.rb +4 -4
- data/spec/requests/flows/authorization_code_spec.rb +36 -2
- data/spec/requests/flows/implicit_grant_spec.rb +14 -5
- data/spec/requests/flows/password_spec.rb +14 -20
- data/spec/requests/flows/refresh_token_spec.rb +15 -7
- data/spec/requests/flows/revoke_token_spec.rb +9 -31
- data/spec/requests/protected_resources/metal_spec.rb +3 -3
- data/spec/requests/protected_resources/private_api_spec.rb +11 -0
- data/spec/routing/custom_controller_routes_spec.rb +1 -2
- data/spec/routing/default_routes_spec.rb +1 -2
- data/spec/routing/scoped_routes_spec.rb +0 -1
- data/spec/spec_helper_integration.rb +10 -7
- data/spec/support/helpers/access_token_request_helper.rb +1 -1
- data/spec/support/helpers/authorization_request_helper.rb +1 -1
- data/spec/support/helpers/config_helper.rb +1 -1
- data/spec/support/helpers/model_helper.rb +1 -1
- data/spec/support/helpers/request_spec_helper.rb +1 -1
- data/spec/support/helpers/url_helper.rb +1 -1
- data/spec/support/shared/models_shared_examples.rb +1 -1
- data/spec/validators/redirect_uri_validator_spec.rb +5 -0
- metadata +127 -98
- data/gemfiles/Gemfile.common.rb +0 -14
- data/gemfiles/Gemfile.mongo_mapper.rb +0 -5
- data/gemfiles/Gemfile.mongoid2.rb +0 -5
- data/gemfiles/Gemfile.mongoid3.rb +0 -4
- data/gemfiles/Gemfile.mongoid4.rb +0 -5
- data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/indexes_generator.rb +0 -12
- data/lib/doorkeeper/generators/doorkeeper/mongo_mapper/templates/indexes.rb +0 -3
- data/lib/doorkeeper/orm/mongo_mapper/access_grant.rb +0 -24
- data/lib/doorkeeper/orm/mongo_mapper/access_token.rb +0 -43
- data/lib/doorkeeper/orm/mongo_mapper/application.rb +0 -29
- data/lib/doorkeeper/orm/mongo_mapper.rb +0 -11
- data/lib/doorkeeper/orm/mongoid2/access_grant.rb +0 -22
- data/lib/doorkeeper/orm/mongoid2/access_token.rb +0 -37
- data/lib/doorkeeper/orm/mongoid2/application.rb +0 -25
- data/lib/doorkeeper/orm/mongoid2/concerns/scopes.rb +0 -30
- data/lib/doorkeeper/orm/mongoid2.rb +0 -11
- data/lib/doorkeeper/orm/mongoid3/access_grant.rb +0 -22
- data/lib/doorkeeper/orm/mongoid3/access_token.rb +0 -37
- data/lib/doorkeeper/orm/mongoid3/application.rb +0 -25
- data/lib/doorkeeper/orm/mongoid3/concerns/scopes.rb +0 -30
- data/lib/doorkeeper/orm/mongoid3.rb +0 -11
- data/lib/doorkeeper/orm/mongoid4/access_grant.rb +0 -22
- data/lib/doorkeeper/orm/mongoid4/access_token.rb +0 -37
- data/lib/doorkeeper/orm/mongoid4/application.rb +0 -25
- data/lib/doorkeeper/orm/mongoid4/concerns/scopes.rb +0 -17
- data/lib/doorkeeper/orm/mongoid4.rb +0 -11
- data/spec/dummy/config/mongo.yml +0 -11
- data/spec/dummy/config/mongoid2.yml +0 -9
- data/spec/dummy/config/mongoid3.yml +0 -18
- data/spec/dummy/config/mongoid4.yml +0 -19
- data/spec/support/orm/mongo_mapper.rb +0 -10
- data/spec/support/orm/mongoid.rb +0 -10
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Elias Philipp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -25,34 +25,20 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '3.2'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: sqlite3
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: 1.3.5
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 1.3.5
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: rspec-rails
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
45
31
|
requirements:
|
46
32
|
- - "~>"
|
47
33
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
34
|
+
version: 3.4.0
|
49
35
|
type: :development
|
50
36
|
prerelease: false
|
51
37
|
version_requirements: !ruby/object:Gem::Requirement
|
52
38
|
requirements:
|
53
39
|
- - "~>"
|
54
40
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
41
|
+
version: 3.4.0
|
56
42
|
- !ruby/object:Gem::Dependency
|
57
43
|
name: capybara
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,49 +109,7 @@ dependencies:
|
|
123
109
|
- - "~>"
|
124
110
|
- !ruby/object:Gem::Version
|
125
111
|
version: 1.3.0
|
126
|
-
|
127
|
-
name: rspec-activemodel-mocks
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - "~>"
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: 1.0.0
|
133
|
-
type: :development
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: 1.0.0
|
140
|
-
- !ruby/object:Gem::Dependency
|
141
|
-
name: bcrypt-ruby
|
142
|
-
requirement: !ruby/object:Gem::Requirement
|
143
|
-
requirements:
|
144
|
-
- - "~>"
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
version: 3.0.1
|
147
|
-
type: :development
|
148
|
-
prerelease: false
|
149
|
-
version_requirements: !ruby/object:Gem::Requirement
|
150
|
-
requirements:
|
151
|
-
- - "~>"
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: 3.0.1
|
154
|
-
- !ruby/object:Gem::Dependency
|
155
|
-
name: pry
|
156
|
-
requirement: !ruby/object:Gem::Requirement
|
157
|
-
requirements:
|
158
|
-
- - "~>"
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
version: 0.10.0
|
161
|
-
type: :development
|
162
|
-
prerelease: false
|
163
|
-
version_requirements: !ruby/object:Gem::Requirement
|
164
|
-
requirements:
|
165
|
-
- - "~>"
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
version: 0.10.0
|
168
|
-
description: Doorkeeper is an OAuth 2 provider for Rails.
|
112
|
+
description: Doorkeeper is an OAuth 2 provider for Rails and Grape.
|
169
113
|
email:
|
170
114
|
- tutecosta@gmail.com
|
171
115
|
executables: []
|
@@ -176,10 +120,10 @@ files:
|
|
176
120
|
- ".hound.yml"
|
177
121
|
- ".rspec"
|
178
122
|
- ".travis.yml"
|
179
|
-
- CHANGELOG.md
|
180
123
|
- CONTRIBUTING.md
|
181
124
|
- Gemfile
|
182
125
|
- MIT-LICENSE
|
126
|
+
- NEWS.md
|
183
127
|
- README.md
|
184
128
|
- RELEASING.md
|
185
129
|
- Rakefile
|
@@ -209,17 +153,10 @@ files:
|
|
209
153
|
- app/views/layouts/doorkeeper/application.html.erb
|
210
154
|
- config/locales/en.yml
|
211
155
|
- doorkeeper.gemspec
|
212
|
-
- gemfiles/Gemfile.common.rb
|
213
|
-
- gemfiles/Gemfile.mongo_mapper.rb
|
214
|
-
- gemfiles/Gemfile.mongoid2.rb
|
215
|
-
- gemfiles/Gemfile.mongoid3.rb
|
216
|
-
- gemfiles/Gemfile.mongoid4.rb
|
217
156
|
- lib/doorkeeper.rb
|
218
157
|
- lib/doorkeeper/config.rb
|
219
158
|
- lib/doorkeeper/engine.rb
|
220
159
|
- lib/doorkeeper/errors.rb
|
221
|
-
- lib/doorkeeper/generators/doorkeeper/mongo_mapper/indexes_generator.rb
|
222
|
-
- lib/doorkeeper/generators/doorkeeper/mongo_mapper/templates/indexes.rb
|
223
160
|
- lib/doorkeeper/grape/authorization_decorator.rb
|
224
161
|
- lib/doorkeeper/grape/helpers.rb
|
225
162
|
- lib/doorkeeper/helpers/controller.rb
|
@@ -263,25 +200,6 @@ files:
|
|
263
200
|
- lib/doorkeeper/orm/active_record/access_grant.rb
|
264
201
|
- lib/doorkeeper/orm/active_record/access_token.rb
|
265
202
|
- lib/doorkeeper/orm/active_record/application.rb
|
266
|
-
- lib/doorkeeper/orm/mongo_mapper.rb
|
267
|
-
- lib/doorkeeper/orm/mongo_mapper/access_grant.rb
|
268
|
-
- lib/doorkeeper/orm/mongo_mapper/access_token.rb
|
269
|
-
- lib/doorkeeper/orm/mongo_mapper/application.rb
|
270
|
-
- lib/doorkeeper/orm/mongoid2.rb
|
271
|
-
- lib/doorkeeper/orm/mongoid2/access_grant.rb
|
272
|
-
- lib/doorkeeper/orm/mongoid2/access_token.rb
|
273
|
-
- lib/doorkeeper/orm/mongoid2/application.rb
|
274
|
-
- lib/doorkeeper/orm/mongoid2/concerns/scopes.rb
|
275
|
-
- lib/doorkeeper/orm/mongoid3.rb
|
276
|
-
- lib/doorkeeper/orm/mongoid3/access_grant.rb
|
277
|
-
- lib/doorkeeper/orm/mongoid3/access_token.rb
|
278
|
-
- lib/doorkeeper/orm/mongoid3/application.rb
|
279
|
-
- lib/doorkeeper/orm/mongoid3/concerns/scopes.rb
|
280
|
-
- lib/doorkeeper/orm/mongoid4.rb
|
281
|
-
- lib/doorkeeper/orm/mongoid4/access_grant.rb
|
282
|
-
- lib/doorkeeper/orm/mongoid4/access_token.rb
|
283
|
-
- lib/doorkeeper/orm/mongoid4/application.rb
|
284
|
-
- lib/doorkeeper/orm/mongoid4/concerns/scopes.rb
|
285
203
|
- lib/doorkeeper/rails/helpers.rb
|
286
204
|
- lib/doorkeeper/rails/routes.rb
|
287
205
|
- lib/doorkeeper/rails/routes/mapper.rb
|
@@ -292,6 +210,7 @@ files:
|
|
292
210
|
- lib/doorkeeper/request/code.rb
|
293
211
|
- lib/doorkeeper/request/password.rb
|
294
212
|
- lib/doorkeeper/request/refresh_token.rb
|
213
|
+
- lib/doorkeeper/request/strategy.rb
|
295
214
|
- lib/doorkeeper/request/token.rb
|
296
215
|
- lib/doorkeeper/server.rb
|
297
216
|
- lib/doorkeeper/validations.rb
|
@@ -336,10 +255,6 @@ files:
|
|
336
255
|
- spec/dummy/config/initializers/session_store.rb
|
337
256
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
338
257
|
- spec/dummy/config/locales/doorkeeper.en.yml
|
339
|
-
- spec/dummy/config/mongo.yml
|
340
|
-
- spec/dummy/config/mongoid2.yml
|
341
|
-
- spec/dummy/config/mongoid3.yml
|
342
|
-
- spec/dummy/config/mongoid4.yml
|
343
258
|
- spec/dummy/config/routes.rb
|
344
259
|
- spec/dummy/db/migrate/20111122132257_create_users.rb
|
345
260
|
- spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
|
@@ -358,6 +273,7 @@ files:
|
|
358
273
|
- spec/generators/migration_generator_spec.rb
|
359
274
|
- spec/generators/templates/routes.rb
|
360
275
|
- spec/generators/views_generator_spec.rb
|
276
|
+
- spec/helpers/doorkeeper/dashboard_helper_spec.rb
|
361
277
|
- spec/lib/config_spec.rb
|
362
278
|
- spec/lib/doorkeeper_spec.rb
|
363
279
|
- spec/lib/models/expirable_spec.rb
|
@@ -388,6 +304,7 @@ files:
|
|
388
304
|
- spec/lib/oauth/token_request_spec.rb
|
389
305
|
- spec/lib/oauth/token_response_spec.rb
|
390
306
|
- spec/lib/oauth/token_spec.rb
|
307
|
+
- spec/lib/request/strategy_spec.rb
|
391
308
|
- spec/lib/server_spec.rb
|
392
309
|
- spec/models/doorkeeper/access_grant_spec.rb
|
393
310
|
- spec/models/doorkeeper/access_token_spec.rb
|
@@ -420,8 +337,6 @@ files:
|
|
420
337
|
- spec/support/helpers/request_spec_helper.rb
|
421
338
|
- spec/support/helpers/url_helper.rb
|
422
339
|
- spec/support/orm/active_record.rb
|
423
|
-
- spec/support/orm/mongo_mapper.rb
|
424
|
-
- spec/support/orm/mongoid.rb
|
425
340
|
- spec/support/shared/controllers_shared_context.rb
|
426
341
|
- spec/support/shared/models_shared_examples.rb
|
427
342
|
- spec/validators/redirect_uri_validator_spec.rb
|
@@ -446,9 +361,123 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
446
361
|
version: '0'
|
447
362
|
requirements: []
|
448
363
|
rubyforge_project:
|
449
|
-
rubygems_version: 2.
|
364
|
+
rubygems_version: 2.5.1
|
450
365
|
signing_key:
|
451
366
|
specification_version: 4
|
452
|
-
summary:
|
453
|
-
test_files:
|
454
|
-
|
367
|
+
summary: OAuth 2 provider for Rails and Grape
|
368
|
+
test_files:
|
369
|
+
- spec/controllers/applications_controller_spec.rb
|
370
|
+
- spec/controllers/authorizations_controller_spec.rb
|
371
|
+
- spec/controllers/protected_resources_controller_spec.rb
|
372
|
+
- spec/controllers/token_info_controller_spec.rb
|
373
|
+
- spec/controllers/tokens_controller_spec.rb
|
374
|
+
- spec/dummy/Rakefile
|
375
|
+
- spec/dummy/app/controllers/application_controller.rb
|
376
|
+
- spec/dummy/app/controllers/custom_authorizations_controller.rb
|
377
|
+
- spec/dummy/app/controllers/full_protected_resources_controller.rb
|
378
|
+
- spec/dummy/app/controllers/home_controller.rb
|
379
|
+
- spec/dummy/app/controllers/metal_controller.rb
|
380
|
+
- spec/dummy/app/controllers/semi_protected_resources_controller.rb
|
381
|
+
- spec/dummy/app/helpers/application_helper.rb
|
382
|
+
- spec/dummy/app/models/user.rb
|
383
|
+
- spec/dummy/app/views/home/index.html.erb
|
384
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
385
|
+
- spec/dummy/config.ru
|
386
|
+
- spec/dummy/config/application.rb
|
387
|
+
- spec/dummy/config/boot.rb
|
388
|
+
- spec/dummy/config/database.yml
|
389
|
+
- spec/dummy/config/environment.rb
|
390
|
+
- spec/dummy/config/environments/development.rb
|
391
|
+
- spec/dummy/config/environments/production.rb
|
392
|
+
- spec/dummy/config/environments/test.rb
|
393
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
394
|
+
- spec/dummy/config/initializers/doorkeeper.rb
|
395
|
+
- spec/dummy/config/initializers/secret_token.rb
|
396
|
+
- spec/dummy/config/initializers/session_store.rb
|
397
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
398
|
+
- spec/dummy/config/locales/doorkeeper.en.yml
|
399
|
+
- spec/dummy/config/routes.rb
|
400
|
+
- spec/dummy/db/migrate/20111122132257_create_users.rb
|
401
|
+
- spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
|
402
|
+
- spec/dummy/db/migrate/20130902165751_create_doorkeeper_tables.rb
|
403
|
+
- spec/dummy/db/migrate/20130902175349_add_owner_to_application.rb
|
404
|
+
- spec/dummy/db/migrate/20141209001746_add_scopes_to_oauth_applications.rb
|
405
|
+
- spec/dummy/db/schema.rb
|
406
|
+
- spec/dummy/public/404.html
|
407
|
+
- spec/dummy/public/422.html
|
408
|
+
- spec/dummy/public/500.html
|
409
|
+
- spec/dummy/public/favicon.ico
|
410
|
+
- spec/dummy/script/rails
|
411
|
+
- spec/factories.rb
|
412
|
+
- spec/generators/application_owner_generator_spec.rb
|
413
|
+
- spec/generators/install_generator_spec.rb
|
414
|
+
- spec/generators/migration_generator_spec.rb
|
415
|
+
- spec/generators/templates/routes.rb
|
416
|
+
- spec/generators/views_generator_spec.rb
|
417
|
+
- spec/helpers/doorkeeper/dashboard_helper_spec.rb
|
418
|
+
- spec/lib/config_spec.rb
|
419
|
+
- spec/lib/doorkeeper_spec.rb
|
420
|
+
- spec/lib/models/expirable_spec.rb
|
421
|
+
- spec/lib/models/revocable_spec.rb
|
422
|
+
- spec/lib/models/scopes_spec.rb
|
423
|
+
- spec/lib/oauth/authorization/uri_builder_spec.rb
|
424
|
+
- spec/lib/oauth/authorization_code_request_spec.rb
|
425
|
+
- spec/lib/oauth/client/credentials_spec.rb
|
426
|
+
- spec/lib/oauth/client/methods_spec.rb
|
427
|
+
- spec/lib/oauth/client_credentials/creator_spec.rb
|
428
|
+
- spec/lib/oauth/client_credentials/issuer_spec.rb
|
429
|
+
- spec/lib/oauth/client_credentials/validation_spec.rb
|
430
|
+
- spec/lib/oauth/client_credentials_integration_spec.rb
|
431
|
+
- spec/lib/oauth/client_credentials_request_spec.rb
|
432
|
+
- spec/lib/oauth/client_spec.rb
|
433
|
+
- spec/lib/oauth/code_request_spec.rb
|
434
|
+
- spec/lib/oauth/error_response_spec.rb
|
435
|
+
- spec/lib/oauth/error_spec.rb
|
436
|
+
- spec/lib/oauth/forbidden_token_response_spec.rb
|
437
|
+
- spec/lib/oauth/helpers/scope_checker_spec.rb
|
438
|
+
- spec/lib/oauth/helpers/unique_token_spec.rb
|
439
|
+
- spec/lib/oauth/helpers/uri_checker_spec.rb
|
440
|
+
- spec/lib/oauth/invalid_token_response_spec.rb
|
441
|
+
- spec/lib/oauth/password_access_token_request_spec.rb
|
442
|
+
- spec/lib/oauth/pre_authorization_spec.rb
|
443
|
+
- spec/lib/oauth/refresh_token_request_spec.rb
|
444
|
+
- spec/lib/oauth/scopes_spec.rb
|
445
|
+
- spec/lib/oauth/token_request_spec.rb
|
446
|
+
- spec/lib/oauth/token_response_spec.rb
|
447
|
+
- spec/lib/oauth/token_spec.rb
|
448
|
+
- spec/lib/request/strategy_spec.rb
|
449
|
+
- spec/lib/server_spec.rb
|
450
|
+
- spec/models/doorkeeper/access_grant_spec.rb
|
451
|
+
- spec/models/doorkeeper/access_token_spec.rb
|
452
|
+
- spec/models/doorkeeper/application_spec.rb
|
453
|
+
- spec/requests/applications/applications_request_spec.rb
|
454
|
+
- spec/requests/applications/authorized_applications_spec.rb
|
455
|
+
- spec/requests/endpoints/authorization_spec.rb
|
456
|
+
- spec/requests/endpoints/token_spec.rb
|
457
|
+
- spec/requests/flows/authorization_code_errors_spec.rb
|
458
|
+
- spec/requests/flows/authorization_code_spec.rb
|
459
|
+
- spec/requests/flows/client_credentials_spec.rb
|
460
|
+
- spec/requests/flows/implicit_grant_errors_spec.rb
|
461
|
+
- spec/requests/flows/implicit_grant_spec.rb
|
462
|
+
- spec/requests/flows/password_spec.rb
|
463
|
+
- spec/requests/flows/refresh_token_spec.rb
|
464
|
+
- spec/requests/flows/revoke_token_spec.rb
|
465
|
+
- spec/requests/flows/skip_authorization_spec.rb
|
466
|
+
- spec/requests/protected_resources/metal_spec.rb
|
467
|
+
- spec/requests/protected_resources/private_api_spec.rb
|
468
|
+
- spec/routing/custom_controller_routes_spec.rb
|
469
|
+
- spec/routing/default_routes_spec.rb
|
470
|
+
- spec/routing/scoped_routes_spec.rb
|
471
|
+
- spec/spec_helper.rb
|
472
|
+
- spec/spec_helper_integration.rb
|
473
|
+
- spec/support/dependencies/factory_girl.rb
|
474
|
+
- spec/support/helpers/access_token_request_helper.rb
|
475
|
+
- spec/support/helpers/authorization_request_helper.rb
|
476
|
+
- spec/support/helpers/config_helper.rb
|
477
|
+
- spec/support/helpers/model_helper.rb
|
478
|
+
- spec/support/helpers/request_spec_helper.rb
|
479
|
+
- spec/support/helpers/url_helper.rb
|
480
|
+
- spec/support/orm/active_record.rb
|
481
|
+
- spec/support/shared/controllers_shared_context.rb
|
482
|
+
- spec/support/shared/models_shared_examples.rb
|
483
|
+
- spec/validators/redirect_uri_validator_spec.rb
|
data/gemfiles/Gemfile.common.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
ENV['rails'] ||= '4.2.0'
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gem 'rails', "~> #{ENV['rails']}"
|
6
|
-
|
7
|
-
if ENV['rails'][0] == '4'
|
8
|
-
gem 'database_cleaner', '~> 1.3.0'
|
9
|
-
end
|
10
|
-
if ENV['rails'] =~ /4.0|3.2/
|
11
|
-
gem 'rubysl-test-unit'
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: '../'
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
module MongoMapper
|
3
|
-
class IndexesGenerator < ::Rails::Generators::Base
|
4
|
-
source_root File.expand_path('templates', __FILE__)
|
5
|
-
desc "'Creates an indexes file for use with MongoMapper's rake db:index'"
|
6
|
-
|
7
|
-
def install
|
8
|
-
template 'indexes.rb', 'db/indexes.rb'
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
class AccessGrant
|
3
|
-
include MongoMapper::Document
|
4
|
-
|
5
|
-
include AccessGrantMixin
|
6
|
-
|
7
|
-
safe
|
8
|
-
timestamps!
|
9
|
-
|
10
|
-
set_collection_name 'oauth_access_grants'
|
11
|
-
|
12
|
-
key :resource_owner_id, ObjectId
|
13
|
-
key :application_id, ObjectId
|
14
|
-
key :token, String
|
15
|
-
key :scopes, String
|
16
|
-
key :expires_in, Integer
|
17
|
-
key :redirect_uri, String
|
18
|
-
key :revoked_at, DateTime
|
19
|
-
|
20
|
-
def self.create_indexes
|
21
|
-
ensure_index :token, unique: true
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
class AccessToken
|
3
|
-
include MongoMapper::Document
|
4
|
-
|
5
|
-
include AccessTokenMixin
|
6
|
-
|
7
|
-
safe
|
8
|
-
timestamps!
|
9
|
-
|
10
|
-
set_collection_name 'oauth_access_tokens'
|
11
|
-
|
12
|
-
key :resource_owner_id, ObjectId
|
13
|
-
key :application_id, ObjectId
|
14
|
-
key :token, String
|
15
|
-
key :refresh_token, String
|
16
|
-
key :expires_in, Integer
|
17
|
-
key :revoked_at, DateTime
|
18
|
-
key :scopes, String
|
19
|
-
|
20
|
-
def self.last
|
21
|
-
self.sort(:created_at).last
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.delete_all_for(application_id, resource_owner)
|
25
|
-
delete_all(application_id: application_id,
|
26
|
-
resource_owner_id: resource_owner.id)
|
27
|
-
end
|
28
|
-
private_class_method :delete_all_for
|
29
|
-
|
30
|
-
def self.create_indexes
|
31
|
-
ensure_index :token, unique: true
|
32
|
-
ensure_index [[:refresh_token, 1]], unique: true, sparse: true
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.order_method
|
36
|
-
:sort
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.created_at_desc
|
40
|
-
:created_at.desc
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
class Application
|
3
|
-
include MongoMapper::Document
|
4
|
-
|
5
|
-
include ApplicationMixin
|
6
|
-
|
7
|
-
safe
|
8
|
-
timestamps!
|
9
|
-
|
10
|
-
set_collection_name 'oauth_applications'
|
11
|
-
|
12
|
-
many :authorized_tokens, class_name: 'Doorkeeper::AccessToken'
|
13
|
-
|
14
|
-
key :name, String
|
15
|
-
key :uid, String
|
16
|
-
key :secret, String
|
17
|
-
key :redirect_uri, String
|
18
|
-
key :scopes, String
|
19
|
-
|
20
|
-
def self.authorized_for(resource_owner)
|
21
|
-
ids = AccessToken.where(resource_owner_id: resource_owner.id, revoked_at: nil).map(&:application_id)
|
22
|
-
find(ids)
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.create_indexes
|
26
|
-
ensure_index :uid, unique: true
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
module Orm
|
3
|
-
module MongoMapper
|
4
|
-
def self.initialize_models!
|
5
|
-
require 'doorkeeper/orm/mongo_mapper/access_grant'
|
6
|
-
require 'doorkeeper/orm/mongo_mapper/access_token'
|
7
|
-
require 'doorkeeper/orm/mongo_mapper/application'
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'doorkeeper/orm/mongoid2/concerns/scopes'
|
2
|
-
|
3
|
-
module Doorkeeper
|
4
|
-
class AccessGrant
|
5
|
-
include Mongoid::Document
|
6
|
-
include Mongoid::Timestamps
|
7
|
-
|
8
|
-
include AccessGrantMixin
|
9
|
-
include Models::Mongoid2::Scopes
|
10
|
-
|
11
|
-
self.store_in :oauth_access_grants
|
12
|
-
|
13
|
-
field :resource_owner_id, type: Integer
|
14
|
-
field :application_id, type: BSON::ObjectId
|
15
|
-
field :token, type: String
|
16
|
-
field :expires_in, type: Integer
|
17
|
-
field :redirect_uri, type: String
|
18
|
-
field :revoked_at, type: DateTime
|
19
|
-
|
20
|
-
index :token, unique: true
|
21
|
-
end
|
22
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'doorkeeper/orm/mongoid2/concerns/scopes'
|
2
|
-
|
3
|
-
module Doorkeeper
|
4
|
-
class AccessToken
|
5
|
-
include Mongoid::Document
|
6
|
-
include Mongoid::Timestamps
|
7
|
-
|
8
|
-
include AccessTokenMixin
|
9
|
-
include Models::Mongoid2::Scopes
|
10
|
-
|
11
|
-
self.store_in :oauth_access_tokens
|
12
|
-
|
13
|
-
field :resource_owner_id, type: Integer
|
14
|
-
field :application_id, type: BSON::ObjectId
|
15
|
-
field :token, type: String
|
16
|
-
field :refresh_token, type: String
|
17
|
-
field :expires_in, type: Integer
|
18
|
-
field :revoked_at, type: DateTime
|
19
|
-
|
20
|
-
index :token, unique: true
|
21
|
-
index :refresh_token, unique: true, sparse: true
|
22
|
-
|
23
|
-
def self.delete_all_for(application_id, resource_owner)
|
24
|
-
where(application_id: application_id,
|
25
|
-
resource_owner_id: resource_owner.id).delete_all
|
26
|
-
end
|
27
|
-
private_class_method :delete_all_for
|
28
|
-
|
29
|
-
def self.order_method
|
30
|
-
:order_by
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.created_at_desc
|
34
|
-
[:created_at, :desc]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
class Application
|
3
|
-
include Mongoid::Document
|
4
|
-
include Mongoid::Timestamps
|
5
|
-
include Models::Mongoid2::Scopes
|
6
|
-
|
7
|
-
include ApplicationMixin
|
8
|
-
|
9
|
-
self.store_in :oauth_applications
|
10
|
-
|
11
|
-
field :name, type: String
|
12
|
-
field :uid, type: String
|
13
|
-
field :secret, type: String
|
14
|
-
field :redirect_uri, type: String
|
15
|
-
|
16
|
-
index :uid, unique: true
|
17
|
-
|
18
|
-
has_many :authorized_tokens, class_name: 'Doorkeeper::AccessToken'
|
19
|
-
|
20
|
-
def self.authorized_for(resource_owner)
|
21
|
-
ids = AccessToken.where(resource_owner_id: resource_owner.id, revoked_at: nil).map(&:application_id)
|
22
|
-
find(ids)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
module Models
|
3
|
-
module Mongoid2
|
4
|
-
module Scopes
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
# It's strange that if not define these after included will raise error
|
8
|
-
# in Mongoid 2 and 3, but 4 works well see:
|
9
|
-
# https://travis-ci.org/jasl/doorkeeper/builds/31586902
|
10
|
-
included do
|
11
|
-
def scopes
|
12
|
-
OAuth::Scopes.from_string(self[:scopes])
|
13
|
-
end
|
14
|
-
|
15
|
-
def scopes_string
|
16
|
-
self[:scopes]
|
17
|
-
end
|
18
|
-
|
19
|
-
def includes_scope?(*required_scopes)
|
20
|
-
required_scopes.blank? || required_scopes.any? { |s| scopes.exists?(s.to_s) }
|
21
|
-
end
|
22
|
-
|
23
|
-
def scopes=(value)
|
24
|
-
write_attribute :scopes, value if value.present?
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'doorkeeper/orm/mongoid3/concerns/scopes'
|
2
|
-
|
3
|
-
module Doorkeeper
|
4
|
-
class AccessGrant
|
5
|
-
include Mongoid::Document
|
6
|
-
include Mongoid::Timestamps
|
7
|
-
|
8
|
-
include AccessGrantMixin
|
9
|
-
include Models::Mongoid3::Scopes
|
10
|
-
|
11
|
-
self.store_in collection: :oauth_access_grants
|
12
|
-
|
13
|
-
field :resource_owner_id, type: Moped::BSON::ObjectId
|
14
|
-
field :application_id, type: Moped::BSON::ObjectId
|
15
|
-
field :token, type: String
|
16
|
-
field :expires_in, type: Integer
|
17
|
-
field :redirect_uri, type: String
|
18
|
-
field :revoked_at, type: DateTime
|
19
|
-
|
20
|
-
index({ token: 1 }, { unique: true })
|
21
|
-
end
|
22
|
-
end
|