doorkeeper-sequel 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c7a81816c6e8bf24a4e578dccaedf96d8efb30d00e7c6993c31f009dca56c69
4
- data.tar.gz: e55d1338ed9360dfa8431cee7acfa6d29f0a3cada3fa6840182a4d1918aaafea
3
+ metadata.gz: 72ee1613a7a5a0a76e7637cdef01a3d550d24d47f88eb73320341bd578b0eb47
4
+ data.tar.gz: 3930d9e295c17fe8f6442954053c9766e42685434c6abf15217ccb2c50257a47
5
5
  SHA512:
6
- metadata.gz: 9e574bc75c50bd88633d84f14b6f0db2b3449e88b45bae879ef91032b98d8e9ea355cfb6ae3ec9ef85477d4c4a4a77a893965a7f96425f7990e4a1faeb0ae483
7
- data.tar.gz: bf2e5d88624242f6394b16ec9b9555d09991f34bd7ee80a1573f516116b136df84f7de606d02eacdfb675c16979c050d82f52c2c38dde924085e99e798cee36e
6
+ metadata.gz: b0f9b92e332699473574bbb2ef64bd5bce474f4cc18acb103327a96bdb230924f1f7ae9ded9a70da94ba1892edef88c701e25138acd6007f90363533e558cf64
7
+ data.tar.gz: 36a767f5a731de802f92629320991dd04a5e30cff322b12fc627e71d6e12a342222119ec34947b407ec644c27783e0abcfb212e70dab325b7251ef26693cdff4
@@ -0,0 +1,6 @@
1
+ root = true
2
+
3
+ [*.{rb,json}]
4
+ indent_style = space
5
+ indent_size = 2
6
+ insert_final_newline = true
data/README.md CHANGED
@@ -16,14 +16,16 @@
16
16
 
17
17
  To start using the Doorkeeper Sequel ORM, add to your Gemfile:
18
18
 
19
- ``` ruby
20
- # For Doorkeeper 4.x
21
- gem 'doorkeeper', '~> 4.3'
19
+ ``` rubygem gem 'doorkeeper', '~> 4.3'
22
20
  gem 'doorkeeper-sequel', '~> 1.5'
23
21
 
24
- # For Doorkeeper 5.x
25
- gem 'doorkeeper', '~> 5.0'
22
+ # For Doorkeeper 5.1
23
+ gem 'doorkeeper', '~> 5.0' # or 5.1
26
24
  gem 'doorkeeper-sequel', '~> 2.0'
25
+
26
+ # For Doorkeeper >= 5.2
27
+ gem 'doorkeeper', '~> 5.2'
28
+ gem 'doorkeeper-sequel', '~> 2.1'
27
29
  ```
28
30
 
29
31
  Or you can use git `master` branch for the latest gem version:
@@ -48,6 +50,7 @@ rake doorkeeper_sequel:generate:application_owner
48
50
  rake doorkeeper_sequel:generate:previous_refresh_token
49
51
  rake doorkeeper_sequel:generate:confidential_applications # for Doorkeeper >= 4.4
50
52
  rake doorkeeper_sequel:generate:pkce # for Doorkeeper >= 5.x
53
+ rake doorkeeper_sequel:generate:polymorphic_resource_owner # for Doorkeeper >= 5.3
51
54
  ```
52
55
 
53
56
  ## Tests
@@ -80,7 +83,7 @@ Thanks.
80
83
 
81
84
  Doorkeeper-sequel gem is released under the [MIT License](http://www.opensource.org/licenses/MIT).
82
85
 
83
- Copyright (c) 2016-2018 Nikita Bulai (bulajnikita@gmail.com).
86
+ Copyright (c) 2016-2020 Nikita Bulai (bulajnikita@gmail.com).
84
87
 
85
88
  ---
86
89
 
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
23
23
  gem.required_ruby_version = ">= 2.0.0"
24
24
 
25
25
  gem.add_runtime_dependency "bcrypt", "~> 3.1"
26
- gem.add_runtime_dependency "doorkeeper", ">= 5.0.0", "< 5.3"
26
+ gem.add_runtime_dependency "doorkeeper", ">= 5.0.0", "< 5.4"
27
27
  gem.add_runtime_dependency "sequel", ">= 4.0.0", "< 6"
28
28
  gem.add_runtime_dependency "sequel_polymorphic", "~> 0.2", "< 1.0"
29
29
  gem.add_runtime_dependency "thor", ">= 0.18", "< 6"
@@ -13,6 +13,6 @@ group :test do
13
13
  gem "rspec-core", git: "https://github.com/rspec/rspec-core.git"
14
14
  gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations.git"
15
15
  gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks.git"
16
- gem "rspec-rails", branch: "4-0-dev", git: "https://github.com/rspec/rspec-rails.git"
16
+ gem "rspec-rails", "4.0.0.beta3"
17
17
  gem "rspec-support", git: "https://github.com/rspec/rspec-support.git"
18
18
  end
@@ -14,6 +14,7 @@ require "doorkeeper-sequel/generators/application_owner_generator"
14
14
  require "doorkeeper-sequel/generators/migration_generator"
15
15
  require "doorkeeper-sequel/generators/previous_refresh_token_generator"
16
16
  require "doorkeeper-sequel/generators/confidential_applications_generator"
17
+ require "doorkeeper-sequel/generators/polymorphic_resource_owner_generator"
17
18
 
18
19
  require "doorkeeper-sequel/mixins/concerns/sequel_compat"
19
20
  require "doorkeeper-sequel/mixins/access_token_mixin"
@@ -7,7 +7,7 @@ module DoorkeeperSequel
7
7
 
8
8
  module VERSION
9
9
  MAJOR = 2
10
- MINOR = 1
10
+ MINOR = 2
11
11
  TINY = 0
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY].compact.join(".")
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DoorkeeperSequel
4
+ class PolymorphicResourceOwnerGenerator < ::Thor::Group
5
+ include ::Thor::Actions
6
+ include MigrationActions
7
+
8
+ source_root File.expand_path("templates", __dir__)
9
+
10
+ desc "Provide support for Polymorphic Resource Owner."
11
+
12
+ def install
13
+ create_migration "enable_polymorphic_resource_owner_migration.rb.erb"
14
+ end
15
+ end
16
+ end
@@ -21,7 +21,8 @@ Sequel.migration do
21
21
  primary_key :id
22
22
  foreign_key :application_id, :oauth_applications, null: false, on_delete: :cascade
23
23
 
24
- column :resource_owner_id, Integer, null: false
24
+ column :resource_owner_id, Integer, null: false, index: true
25
+ column :resource_owner_type, String, null: false, index: true
25
26
 
26
27
  column :token, String, size: 255, null: false, index: { unique: true }
27
28
  column :expires_in, Integer, null: false
@@ -36,6 +37,7 @@ Sequel.migration do
36
37
  foreign_key :application_id, :oauth_applications, null: false, on_delete: :cascade
37
38
 
38
39
  column :resource_owner_id, Integer, index: true
40
+ column :resource_owner_type, String, index: true
39
41
 
40
42
  # If you use a custom token generator you may need to change this column
41
43
  # from string to text, so that it accepts tokens larger than 255
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ change do
5
+ alter_table(:oauth_access_grants) do
6
+ add_column :resource_owner_type, String, default: nil
7
+ add_index [:resource_owner_id, :resource_owner_type]
8
+ end
9
+
10
+ alter_table(:oauth_access_tokens) do
11
+ add_column :resource_owner_type, String, default: nil
12
+ add_index [:resource_owner_id, :resource_owner_type]
13
+ end
14
+ end
15
+ end
@@ -12,18 +12,21 @@ module DoorkeeperSequel
12
12
  include Doorkeeper::Models::Accessible
13
13
  include Doorkeeper::Models::SecretStorable
14
14
  include Doorkeeper::Models::Scopes
15
+ include Doorkeeper::Models::ResourceOwnerable
15
16
 
16
17
  included do
17
18
  plugin :validation_helpers
18
19
  plugin :timestamps
19
20
 
21
+
20
22
  many_to_one :application, class: "Doorkeeper::Application"
23
+ many_to_one :resource_owner, polymorphic: true
21
24
 
22
25
  attr_writer :use_refresh_token
23
26
 
24
- set_allowed_columns :application_id, :resource_owner_id, :expires_in,
25
- :scopes, :use_refresh_token, :previous_refresh_token,
26
- :token, :refresh_token
27
+ set_allowed_columns :application_id, :resource_owner_id, :resource_owner_type,
28
+ :expires_in, :scopes, :use_refresh_token,
29
+ :previous_refresh_token, :token, :refresh_token
27
30
 
28
31
  def before_validation
29
32
  if new?
@@ -66,6 +69,10 @@ module DoorkeeperSequel
66
69
  revoked_at: nil)
67
70
  .update(revoked_at: clock.now.utc)
68
71
  end
72
+
73
+ def by_previous_refresh_token(previous_refresh_token)
74
+ where(refresh_token: previous_refresh_token).first
75
+ end
69
76
 
70
77
  def matching_token_for(application, resource_owner_or_id, scopes)
71
78
  resource_owner_id = if resource_owner_or_id.respond_to?(:to_key)
@@ -103,25 +110,32 @@ module DoorkeeperSequel
103
110
  )
104
111
  end
105
112
 
106
- def authorized_tokens_for(application_id, resource_owner_id)
107
- where(application_id: application_id,
108
- resource_owner_id: resource_owner_id,
113
+ def authorized_tokens_for(application_id, resource_owner)
114
+ by_resource_owner(resource_owner).where(application_id: application_id,
109
115
  revoked_at: nil).order(Sequel.desc(:created_at))
110
116
  end
111
117
 
112
- def find_or_create_for(application, resource_owner_id, scopes, expires_in, use_refresh_token)
118
+ def find_or_create_for(application, resource_owner, scopes, expires_in, use_refresh_token)
113
119
  if Doorkeeper.configuration.reuse_access_token
114
- access_token = matching_token_for(application, resource_owner_id, scopes)
120
+ access_token = matching_token_for(application, resource_owner, scopes)
115
121
  return access_token if access_token&.reusable?
116
122
  end
117
-
118
- create!(
123
+
124
+
125
+ attributes = {
119
126
  application_id: application.try(:id),
120
- resource_owner_id: resource_owner_id,
121
127
  scopes: scopes.to_s,
122
128
  expires_in: expires_in,
123
129
  use_refresh_token: use_refresh_token
124
- )
130
+ }
131
+
132
+ if Doorkeeper.config.polymorphic_resource_owner?
133
+ attributes[:resource_owner] = resource_owner
134
+ else
135
+ attributes[:resource_owner_id] = resource_owner_id_for(resource_owner)
136
+ end
137
+
138
+ create!(attributes)
125
139
  end
126
140
 
127
141
  def last_authorized_token_for(application_id, resource_owner_id)
@@ -135,6 +149,10 @@ module DoorkeeperSequel
135
149
  def fallback_secret_strategy
136
150
  ::Doorkeeper.configuration.token_secret_fallback_strategy
137
151
  end
152
+
153
+ def polymorphic_resource_owner?
154
+ columns.include?(:resource_owner_type)
155
+ end
138
156
  end
139
157
 
140
158
  def token_type
@@ -153,7 +171,11 @@ module DoorkeeperSequel
153
171
  expires_in: expires_in_seconds,
154
172
  application: { uid: application.try(:uid) },
155
173
  created_at: created_at.to_i,
156
- }
174
+ }.tap do |json|
175
+ if Doorkeeper.configuration.polymorphic_resource_owner?
176
+ json[:resource_owner_type] = resource_owner_type
177
+ end
178
+ end
157
179
  end
158
180
 
159
181
  # It indicates whether the tokens have the same credential
@@ -181,9 +203,23 @@ module DoorkeeperSequel
181
203
  @raw_token
182
204
  end
183
205
  end
206
+
207
+ # Revokes token with `:refresh_token` equal to `:previous_refresh_token`
208
+ # and clears `:previous_refresh_token` attribute.
209
+ #
210
+ def revoke_previous_refresh_token!
211
+ return unless self.class.refresh_token_revoked_on_use?
212
+
213
+ old_refresh_token&.revoke
214
+ update(previous_refresh_token: "")
215
+ end
184
216
 
185
217
  private
186
218
 
219
+ def old_refresh_token
220
+ @old_refresh_token ||= self.class.by_previous_refresh_token(previous_refresh_token)
221
+ end
222
+
187
223
  def generate_refresh_token
188
224
  @raw_refresh_token = UniqueToken.generate
189
225
  secret_strategy.store_secret(self, :refresh_token, @raw_refresh_token)
@@ -53,7 +53,25 @@ module DoorkeeperSequel
53
53
  def confidential?
54
54
  confidential.present? && !!confidential
55
55
  end
56
+
57
+ def renew_secret
58
+ @raw_secret = Doorkeeper::OAuth::Helpers::UniqueToken.generate
59
+ secret_strategy.store_secret(self, :secret, @raw_secret)
60
+ end
56
61
 
62
+
63
+ def plaintext_secret
64
+ if secret_strategy.allows_restoring_secrets?
65
+ secret_strategy.restore_secret(self, :secret)
66
+ else
67
+ @raw_secret
68
+ end
69
+ end
70
+
71
+ def authorized_for_resource_owner?(resource_owner)
72
+ Doorkeeper.configuration.authorize_resource_owner_for_client.call(self, resource_owner)
73
+ end
74
+
57
75
  protected
58
76
 
59
77
  def validate_scopes_match_configured
@@ -26,5 +26,10 @@ namespace :doorkeeper_sequel do
26
26
  task :confidential_applications do
27
27
  DoorkeeperSequel::ConfidentialApplicationsGenerator.start
28
28
  end
29
+
30
+ desc "Add resource owner type to Access tokens and grants"
31
+ task :polymorphic_resource_owner do
32
+ DoorkeeperSequel::PolymorphicResourceOwnerGenerator.start
33
+ end
29
34
  end
30
35
  end
@@ -13,6 +13,7 @@ module Doorkeeper
13
13
  ::Sequel::Model.require_valid_table = false
14
14
  ::Sequel::Model.strict_param_setting = false
15
15
  ::Sequel::Model.plugin :json_serializer
16
+ ::Sequel::Model.plugin :polymorphic
16
17
 
17
18
  begin
18
19
  require "doorkeeper/orm/sequel/access_grant"
@@ -20,6 +20,10 @@ module Doorkeeper
20
20
  def refresh_token_revoked_on_use?
21
21
  columns.include?(:previous_refresh_token)
22
22
  end
23
+
24
+ def polymorphic_resource_owner?
25
+ columns.include?(:resource_owner_type)
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -28,7 +28,8 @@ DB.create_table :oauth_access_grants do
28
28
  primary_key :id
29
29
  column :application_id, Integer
30
30
 
31
- column :resource_owner_id, Integer, null: false
31
+ column :resource_owner_id, Integer, null: false, index: true
32
+ column :resource_owner_type, String, index: true
32
33
 
33
34
  column :token, String, size: 255, null: false, index: { unique: true }
34
35
  column :expires_in, Integer, null: false
@@ -46,6 +47,7 @@ DB.create_table :oauth_access_tokens do
46
47
  column :application_id, Integer
47
48
 
48
49
  column :resource_owner_id, Integer, index: true
50
+ column :resource_owner_type, String, index: true
49
51
 
50
52
  # If you use a custom token generator you may need to change this column
51
53
  # from string to text, so that it accepts tokens larger than 255
@@ -25,9 +25,7 @@ require "support/orm/#{DOORKEEPER_ORM}"
25
25
  ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), "../")
26
26
 
27
27
  Dir["#{File.dirname(__FILE__)}/support/{dependencies,helpers,shared}/*.rb"].each { |f| require f }
28
-
29
- # Remove after dropping support of Rails 4.2
30
- require "#{File.dirname(__FILE__)}/support/http_method_shim.rb"
28
+ Dir["#{ENGINE_RAILS_ROOT}/doorkeeper/lib/doorkeeper/config/*.rb"].each { |f| require f }
31
29
 
32
30
  RSpec.configure do |config|
33
31
  config.infer_spec_type_from_file_location!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doorkeeper-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Bulai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2020-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 5.0.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '5.3'
36
+ version: '5.4'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 5.0.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '5.3'
46
+ version: '5.4'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sequel
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -221,6 +221,7 @@ executables: []
221
221
  extensions: []
222
222
  extra_rdoc_files: []
223
223
  files:
224
+ - ".editorconfig"
224
225
  - ".gitignore"
225
226
  - ".gitmodules"
226
227
  - ".rspec"
@@ -244,12 +245,14 @@ files:
244
245
  - lib/doorkeeper-sequel/generators/confidential_applications_generator.rb
245
246
  - lib/doorkeeper-sequel/generators/migration_generator.rb
246
247
  - lib/doorkeeper-sequel/generators/pkce_generator.rb
248
+ - lib/doorkeeper-sequel/generators/polymorphic_resource_owner_generator.rb
247
249
  - lib/doorkeeper-sequel/generators/previous_refresh_token_generator.rb
248
250
  - lib/doorkeeper-sequel/generators/templates/add_confidential_to_application_migration.rb
249
251
  - lib/doorkeeper-sequel/generators/templates/add_owner_to_application.rb
250
252
  - lib/doorkeeper-sequel/generators/templates/add_previous_refresh_token_to_access_tokens.rb
251
253
  - lib/doorkeeper-sequel/generators/templates/create_doorkeeper_tables.rb
252
254
  - lib/doorkeeper-sequel/generators/templates/enable_pkce_migration.rb
255
+ - lib/doorkeeper-sequel/generators/templates/enable_polymorphic_resource_owner_migration.rb
253
256
  - lib/doorkeeper-sequel/mixins/access_grant_mixin.rb
254
257
  - lib/doorkeeper-sequel/mixins/access_token_mixin.rb
255
258
  - lib/doorkeeper-sequel/mixins/application_mixin.rb
@@ -428,141 +431,141 @@ signing_key:
428
431
  specification_version: 4
429
432
  summary: Doorkeeper Sequel ORM
430
433
  test_files:
431
- - spec/version/version_spec.rb
432
- - spec/spec_helper.rb
433
- - spec/lib/stale_records_cleaner_spec.rb
434
+ - spec/routing/default_routes_spec.rb
435
+ - spec/routing/custom_controller_routes_spec.rb
436
+ - spec/routing/scoped_routes_spec.rb
437
+ - spec/lib/server_spec.rb
438
+ - spec/lib/oauth/code_response_spec.rb
434
439
  - spec/lib/oauth/token_spec.rb
440
+ - spec/lib/oauth/code_request_spec.rb
435
441
  - spec/lib/oauth/refresh_token_request_spec.rb
436
442
  - spec/lib/oauth/pre_authorization_spec.rb
437
- - spec/lib/oauth/token_response_spec.rb
438
- - spec/lib/oauth/client/credentials_spec.rb
439
- - spec/lib/oauth/token_request_spec.rb
440
- - spec/lib/oauth/scopes_spec.rb
441
- - spec/lib/oauth/client_credentials_request_spec.rb
442
- - spec/lib/oauth/code_request_spec.rb
443
- - spec/lib/oauth/client_spec.rb
444
- - spec/lib/oauth/error_spec.rb
445
- - spec/lib/oauth/forbidden_token_response_spec.rb
446
- - spec/lib/oauth/client_credentials/issuer_spec.rb
447
- - spec/lib/oauth/client_credentials/creator_spec.rb
448
- - spec/lib/oauth/client_credentials/validation_spec.rb
449
- - spec/lib/oauth/password_access_token_request_spec.rb
450
- - spec/lib/oauth/code_response_spec.rb
451
- - spec/lib/oauth/client_credentials_integration_spec.rb
452
443
  - spec/lib/oauth/base_response_spec.rb
444
+ - spec/lib/oauth/base_request_spec.rb
445
+ - spec/lib/oauth/authorization_code_request_spec.rb
446
+ - spec/lib/oauth/error_response_spec.rb
447
+ - spec/lib/oauth/token_request_spec.rb
448
+ - spec/lib/oauth/helpers/unique_token_spec.rb
453
449
  - spec/lib/oauth/helpers/uri_checker_spec.rb
454
450
  - spec/lib/oauth/helpers/scope_checker_spec.rb
455
- - spec/lib/oauth/helpers/unique_token_spec.rb
451
+ - spec/lib/oauth/invalid_request_response_spec.rb
456
452
  - spec/lib/oauth/authorization/uri_builder_spec.rb
457
- - spec/lib/oauth/authorization_code_request_spec.rb
453
+ - spec/lib/oauth/client_credentials/validation_spec.rb
454
+ - spec/lib/oauth/client_credentials/issuer_spec.rb
455
+ - spec/lib/oauth/client_credentials/creator_spec.rb
456
+ - spec/lib/oauth/error_spec.rb
457
+ - spec/lib/oauth/scopes_spec.rb
458
+ - spec/lib/oauth/client_credentials_integration_spec.rb
459
+ - spec/lib/oauth/client_credentials_request_spec.rb
460
+ - spec/lib/oauth/password_access_token_request_spec.rb
458
461
  - spec/lib/oauth/invalid_token_response_spec.rb
459
- - spec/lib/oauth/base_request_spec.rb
460
- - spec/lib/oauth/error_response_spec.rb
461
- - spec/lib/oauth/invalid_request_response_spec.rb
462
- - spec/lib/server_spec.rb
463
- - spec/lib/models/scopes_spec.rb
464
- - spec/lib/models/expirable_spec.rb
465
- - spec/lib/models/revocable_spec.rb
466
- - spec/lib/models/reusable_spec.rb
467
- - spec/lib/models/secret_storable_spec.rb
468
- - spec/lib/request/strategy_spec.rb
469
- - spec/lib/secret_storing/plain_spec.rb
462
+ - spec/lib/oauth/forbidden_token_response_spec.rb
463
+ - spec/lib/oauth/client/credentials_spec.rb
464
+ - spec/lib/oauth/token_response_spec.rb
465
+ - spec/lib/oauth/client_spec.rb
470
466
  - spec/lib/secret_storing/base_spec.rb
471
- - spec/lib/secret_storing/sha256_hash_spec.rb
472
467
  - spec/lib/secret_storing/bcrypt_spec.rb
473
- - spec/lib/doorkeeper_spec.rb
468
+ - spec/lib/secret_storing/plain_spec.rb
469
+ - spec/lib/secret_storing/sha256_hash_spec.rb
474
470
  - spec/lib/config_spec.rb
475
- - spec/validators/redirect_uri_validator_spec.rb
476
- - spec/support/orm/active_record.rb
477
- - spec/support/orm/sequel.rb
478
- - spec/support/shared/models_shared_examples.rb
479
- - spec/support/shared/controllers_shared_context.rb
480
- - spec/support/shared/hashing_shared_context.rb
481
- - spec/support/http_method_shim.rb
482
- - spec/support/doorkeeper_rspec.rb
483
- - spec/support/dependencies/factory_bot.rb
484
- - spec/support/helpers/authorization_request_helper.rb
485
- - spec/support/helpers/model_helper.rb
486
- - spec/support/helpers/url_helper.rb
487
- - spec/support/helpers/config_helper.rb
488
- - spec/support/helpers/access_token_request_helper.rb
489
- - spec/support/helpers/request_spec_helper.rb
490
- - spec/models/doorkeeper/access_token_spec.rb
491
- - spec/models/doorkeeper/access_grant_spec.rb
492
- - spec/models/doorkeeper/application_spec.rb
493
- - spec/routing/scoped_routes_spec.rb
494
- - spec/routing/default_routes_spec.rb
495
- - spec/routing/custom_controller_routes_spec.rb
496
- - spec/generators/templates/routes.rb
471
+ - spec/lib/stale_records_cleaner_spec.rb
472
+ - spec/lib/models/secret_storable_spec.rb
473
+ - spec/lib/models/revocable_spec.rb
474
+ - spec/lib/models/expirable_spec.rb
475
+ - spec/lib/models/scopes_spec.rb
476
+ - spec/lib/models/reusable_spec.rb
477
+ - spec/lib/doorkeeper_spec.rb
478
+ - spec/lib/request/strategy_spec.rb
479
+ - spec/version/version_spec.rb
497
480
  - spec/spec_helper_integration.rb
498
- - spec/factories.rb
481
+ - spec/stubs/spec_helper_integration.rb
482
+ - spec/stubs/models/user.rb
483
+ - spec/stubs/support/sequel.rb
484
+ - spec/stubs/config/initializers/db.rb
485
+ - spec/stubs/config/application.rb
486
+ - spec/stubs/generators/tmp/dummy/db/migrate/20170810125729_add_previous_refresh_token_to_access_tokens.rb
487
+ - spec/helpers/doorkeeper/dashboard_helper_spec.rb
499
488
  - spec/controllers/tokens_controller_spec.rb
500
- - spec/controllers/applications_controller_spec.rb
501
- - spec/controllers/application_metal_controller_spec.rb
502
489
  - spec/controllers/protected_resources_controller_spec.rb
490
+ - spec/controllers/applications_controller_spec.rb
503
491
  - spec/controllers/token_info_controller_spec.rb
504
492
  - spec/controllers/authorizations_controller_spec.rb
505
- - spec/stubs/config/application.rb
506
- - spec/stubs/config/initializers/db.rb
507
- - spec/stubs/support/sequel.rb
508
- - spec/stubs/models/user.rb
509
- - spec/stubs/generators/tmp/dummy/db/migrate/20170810125729_add_previous_refresh_token_to_access_tokens.rb
510
- - spec/stubs/spec_helper_integration.rb
511
- - spec/helpers/doorkeeper/dashboard_helper_spec.rb
512
- - spec/dummy/config/application.rb
513
- - spec/dummy/config/environments/production.rb
514
- - spec/dummy/config/environments/development.rb
515
- - spec/dummy/config/environments/test.rb
493
+ - spec/controllers/application_metal_controller_spec.rb
494
+ - spec/models/doorkeeper/application_spec.rb
495
+ - spec/models/doorkeeper/access_grant_spec.rb
496
+ - spec/models/doorkeeper/access_token_spec.rb
497
+ - spec/dummy/config.ru
516
498
  - spec/dummy/config/environment.rb
517
- - spec/dummy/config/database.yml
518
499
  - spec/dummy/config/boot.rb
519
- - spec/dummy/config/locales/doorkeeper.en.yml
520
- - spec/dummy/config/routes.rb
521
- - spec/dummy/config/initializers/db.rb
522
- - spec/dummy/config/initializers/doorkeeper.rb
523
- - spec/dummy/config/initializers/session_store.rb
500
+ - spec/dummy/config/database.yml
501
+ - spec/dummy/config/initializers/secret_token.rb
524
502
  - spec/dummy/config/initializers/backtrace_silencers.rb
503
+ - spec/dummy/config/initializers/session_store.rb
525
504
  - spec/dummy/config/initializers/wrap_parameters.rb
526
- - spec/dummy/config/initializers/secret_token.rb
527
- - spec/dummy/config.ru
505
+ - spec/dummy/config/initializers/doorkeeper.rb
506
+ - spec/dummy/config/initializers/db.rb
507
+ - spec/dummy/config/environments/development.rb
508
+ - spec/dummy/config/environments/test.rb
509
+ - spec/dummy/config/environments/production.rb
510
+ - spec/dummy/config/application.rb
511
+ - spec/dummy/config/locales/doorkeeper.en.yml
512
+ - spec/dummy/config/routes.rb
513
+ - spec/dummy/Rakefile
528
514
  - spec/dummy/script/rails
529
- - spec/dummy/app/assets/config/manifest.js
530
- - spec/dummy/app/models/user.rb
531
- - spec/dummy/app/controllers/home_controller.rb
532
- - spec/dummy/app/controllers/full_protected_resources_controller.rb
515
+ - spec/dummy/public/422.html
516
+ - spec/dummy/public/favicon.ico
517
+ - spec/dummy/public/404.html
518
+ - spec/dummy/public/500.html
519
+ - spec/dummy/app/views/home/index.html.erb
520
+ - spec/dummy/app/views/layouts/application.html.erb
521
+ - spec/dummy/app/helpers/application_helper.rb
533
522
  - spec/dummy/app/controllers/metal_controller.rb
523
+ - spec/dummy/app/controllers/full_protected_resources_controller.rb
534
524
  - spec/dummy/app/controllers/application_controller.rb
525
+ - spec/dummy/app/controllers/home_controller.rb
535
526
  - spec/dummy/app/controllers/semi_protected_resources_controller.rb
536
527
  - spec/dummy/app/controllers/custom_authorizations_controller.rb
537
- - spec/dummy/app/views/layouts/application.html.erb
538
- - spec/dummy/app/views/home/index.html.erb
539
- - spec/dummy/app/helpers/application_helper.rb
540
- - spec/dummy/Rakefile
541
- - spec/dummy/db/migrate/20170822064514_enable_pkce.rb
542
- - spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
528
+ - spec/dummy/app/assets/config/manifest.js
529
+ - spec/dummy/app/models/user.rb
530
+ - spec/dummy/db/schema.rb
543
531
  - spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
532
+ - spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb
544
533
  - spec/dummy/db/migrate/20180210183654_add_confidential_to_applications.rb
545
- - spec/dummy/db/migrate/20111122132257_create_users.rb
546
534
  - spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
547
- - spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb
548
- - spec/dummy/db/schema.rb
549
- - spec/dummy/public/404.html
550
- - spec/dummy/public/500.html
551
- - spec/dummy/public/422.html
552
- - spec/dummy/public/favicon.ico
553
- - spec/grape/grape_integration_spec.rb
554
- - spec/requests/protected_resources/private_api_spec.rb
535
+ - spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
536
+ - spec/dummy/db/migrate/20170822064514_enable_pkce.rb
537
+ - spec/dummy/db/migrate/20111122132257_create_users.rb
538
+ - spec/support/orm/active_record.rb
539
+ - spec/support/orm/sequel.rb
540
+ - spec/support/http_method_shim.rb
541
+ - spec/support/dependencies/factory_bot.rb
542
+ - spec/support/doorkeeper_rspec.rb
543
+ - spec/support/helpers/config_helper.rb
544
+ - spec/support/helpers/authorization_request_helper.rb
545
+ - spec/support/helpers/model_helper.rb
546
+ - spec/support/helpers/access_token_request_helper.rb
547
+ - spec/support/helpers/request_spec_helper.rb
548
+ - spec/support/helpers/url_helper.rb
549
+ - spec/support/shared/models_shared_examples.rb
550
+ - spec/support/shared/hashing_shared_context.rb
551
+ - spec/support/shared/controllers_shared_context.rb
552
+ - spec/validators/redirect_uri_validator_spec.rb
553
+ - spec/generators/templates/routes.rb
554
+ - spec/factories.rb
555
+ - spec/spec_helper.rb
556
+ - spec/requests/flows/password_spec.rb
557
+ - spec/requests/flows/authorization_code_errors_spec.rb
558
+ - spec/requests/flows/authorization_code_spec.rb
559
+ - spec/requests/flows/skip_authorization_spec.rb
560
+ - spec/requests/flows/implicit_grant_errors_spec.rb
561
+ - spec/requests/flows/client_credentials_spec.rb
562
+ - spec/requests/flows/refresh_token_spec.rb
563
+ - spec/requests/flows/revoke_token_spec.rb
564
+ - spec/requests/flows/implicit_grant_spec.rb
555
565
  - spec/requests/protected_resources/metal_spec.rb
556
- - spec/requests/applications/applications_request_spec.rb
566
+ - spec/requests/protected_resources/private_api_spec.rb
557
567
  - spec/requests/applications/authorized_applications_spec.rb
568
+ - spec/requests/applications/applications_request_spec.rb
558
569
  - spec/requests/endpoints/token_spec.rb
559
570
  - spec/requests/endpoints/authorization_spec.rb
560
- - spec/requests/flows/client_credentials_spec.rb
561
- - spec/requests/flows/revoke_token_spec.rb
562
- - spec/requests/flows/refresh_token_spec.rb
563
- - spec/requests/flows/implicit_grant_spec.rb
564
- - spec/requests/flows/authorization_code_spec.rb
565
- - spec/requests/flows/skip_authorization_spec.rb
566
- - spec/requests/flows/implicit_grant_errors_spec.rb
567
- - spec/requests/flows/authorization_code_errors_spec.rb
568
- - spec/requests/flows/password_spec.rb
571
+ - spec/grape/grape_integration_spec.rb