doorkeeper-sequel 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +4 -3
- data/Rakefile +1 -0
- data/config/locales/en.yml +1 -0
- data/doorkeeper-sequel.gemspec +1 -2
- data/lib/doorkeeper-sequel.rb +12 -7
- data/lib/doorkeeper-sequel/gem_version.rb +1 -1
- data/lib/doorkeeper-sequel/generators/confidential_applications_generator.rb +14 -0
- data/lib/doorkeeper-sequel/generators/templates/add_confidential_to_application_migration.rb +7 -0
- data/lib/doorkeeper-sequel/generators/templates/create_doorkeeper_tables.rb +1 -0
- data/lib/doorkeeper-sequel/mixins/access_grant_mixin.rb +46 -0
- data/lib/doorkeeper-sequel/mixins/access_token_mixin.rb +164 -0
- data/lib/doorkeeper-sequel/mixins/application_mixin.rb +93 -0
- data/lib/doorkeeper-sequel/mixins/concerns/ownership.rb +15 -0
- data/lib/doorkeeper-sequel/mixins/concerns/sequel_compat.rb +63 -0
- data/lib/doorkeeper-sequel/validators/redirect_uri_validator.rb +65 -0
- data/lib/doorkeeper/orm/sequel.rb +2 -3
- data/lib/doorkeeper/orm/sequel/access_grant.rb +1 -3
- data/lib/doorkeeper/orm/sequel/access_token.rb +1 -8
- data/lib/doorkeeper/orm/sequel/application.rb +5 -3
- data/spec/stubs/config/initializers/db.rb +1 -0
- data/spec/stubs/models/user.rb +1 -1
- metadata +62 -36
- data/lib/doorkeeper/orm/sequel/models/access_grant_mixin.rb +0 -50
- data/lib/doorkeeper/orm/sequel/models/access_token_mixin.rb +0 -168
- data/lib/doorkeeper/orm/sequel/models/application_mixin.rb +0 -70
- data/lib/doorkeeper/orm/sequel/models/concerns/ownership.rb +0 -19
- data/lib/doorkeeper/orm/sequel/models/concerns/sequel_compat.rb +0 -59
- data/lib/doorkeeper/orm/sequel/validators/redirect_uri_validator.rb +0 -57
@@ -0,0 +1,15 @@
|
|
1
|
+
module DoorkeeperSequel
|
2
|
+
module Ownership
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
plugin :polymorphic
|
7
|
+
|
8
|
+
many_to_one :owner, polymorphic: true
|
9
|
+
|
10
|
+
def validate_owner?
|
11
|
+
Doorkeeper.configuration.confirm_application_owner?
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module DoorkeeperSequel
|
2
|
+
module SequelCompat
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
# ActiveRecord methods used by Doorkeeper outside the ORM.
|
6
|
+
# Should be extracted at the architectural level.
|
7
|
+
included do
|
8
|
+
plugin :active_model
|
9
|
+
|
10
|
+
# Sequel 4.47 and higher deprecated #set_allowed_columns
|
11
|
+
if (::Sequel::MAJOR >= 4 && ::Sequel::MINOR >= 47) || ::Sequel::MAJOR >= 5
|
12
|
+
plugin :whitelist_security
|
13
|
+
end
|
14
|
+
|
15
|
+
self.raise_on_save_failure = false
|
16
|
+
|
17
|
+
def update_attribute(column, value)
|
18
|
+
self[column] = value
|
19
|
+
save(columns: [column.to_sym], validate: false)
|
20
|
+
end
|
21
|
+
|
22
|
+
def update_attributes(*args)
|
23
|
+
update(*args)
|
24
|
+
end
|
25
|
+
|
26
|
+
def save!(*)
|
27
|
+
save(raise_on_failure: true)
|
28
|
+
end
|
29
|
+
|
30
|
+
def transaction(opts = {}, &block)
|
31
|
+
db.transaction(opts, &block)
|
32
|
+
end
|
33
|
+
|
34
|
+
def invalid?
|
35
|
+
!valid?
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
module ClassMethods
|
40
|
+
def create!(values = {}, &block)
|
41
|
+
new(values, &block).save(raise_on_failure: true)
|
42
|
+
end
|
43
|
+
|
44
|
+
def table_exists?
|
45
|
+
db.table_exists?(table_name)
|
46
|
+
end
|
47
|
+
|
48
|
+
def ordered_by(attribute, direction = :asc)
|
49
|
+
order(::Sequel.public_send(direction, attribute))
|
50
|
+
end
|
51
|
+
|
52
|
+
# find(1) or find("1") - will work like find(id: 1)
|
53
|
+
# find(name: 'John') - will work like find(name: 'John')
|
54
|
+
def find(*args, &block)
|
55
|
+
if args.first.is_a?(Hash)
|
56
|
+
super(*args, &block)
|
57
|
+
else
|
58
|
+
super(id: args)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module DoorkeeperSequel
|
2
|
+
module RedirectUriValidator
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
def validates_redirect_uri(attribute)
|
7
|
+
value = self[attribute]
|
8
|
+
|
9
|
+
if value.blank?
|
10
|
+
add_error(attribute, :blank)
|
11
|
+
else
|
12
|
+
value.split.each do |val|
|
13
|
+
uri = ::URI.parse(val)
|
14
|
+
next if native_redirect_uri?(uri)
|
15
|
+
validate_uri(uri, attribute)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
rescue URI::InvalidURIError
|
19
|
+
add_error(attribute, :invalid_uri)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def native_redirect_uri?(uri)
|
25
|
+
native_redirect_uri.present? && uri.to_s == native_redirect_uri.to_s
|
26
|
+
end
|
27
|
+
|
28
|
+
def forbidden_uri?(uri)
|
29
|
+
Doorkeeper.configuration.respond_to?(:forbid_redirect_uri) &&
|
30
|
+
Doorkeeper.configuration.forbid_redirect_uri.call(uri)
|
31
|
+
end
|
32
|
+
|
33
|
+
def validate_uri(uri, attribute)
|
34
|
+
{
|
35
|
+
fragment_present: uri.fragment.present?,
|
36
|
+
relative_uri: uri.scheme.nil? || uri.host.nil?,
|
37
|
+
secured_uri: invalid_ssl_uri?(uri),
|
38
|
+
forbidden_uri: forbidden_uri?(uri)
|
39
|
+
}.each do |error, condition|
|
40
|
+
add_error(attribute, error) if condition
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def invalid_ssl_uri?(uri)
|
45
|
+
forces_ssl = Doorkeeper.configuration.force_ssl_in_redirect_uri
|
46
|
+
non_https = uri.try(:scheme) == 'http'
|
47
|
+
|
48
|
+
if forces_ssl.respond_to?(:call)
|
49
|
+
forces_ssl.call(uri) && non_https
|
50
|
+
else
|
51
|
+
forces_ssl && non_https
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def native_redirect_uri
|
56
|
+
Doorkeeper.configuration.native_redirect_uri
|
57
|
+
end
|
58
|
+
|
59
|
+
def add_error(attribute, error)
|
60
|
+
scope = 'sequel.errors.models.doorkeeper/application.attributes.redirect_uri'
|
61
|
+
errors.add(attribute, I18n.t(error, scope: scope))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -9,7 +9,6 @@ module Doorkeeper
|
|
9
9
|
::Sequel::Model.require_valid_table = false
|
10
10
|
|
11
11
|
begin
|
12
|
-
require 'doorkeeper/orm/sequel/models/concerns/sequel_compat'
|
13
12
|
require 'doorkeeper/orm/sequel/access_grant'
|
14
13
|
require 'doorkeeper/orm/sequel/access_token'
|
15
14
|
require 'doorkeeper/orm/sequel/application'
|
@@ -19,9 +18,9 @@ module Doorkeeper
|
|
19
18
|
end
|
20
19
|
|
21
20
|
def self.initialize_application_owner!
|
22
|
-
require 'doorkeeper
|
21
|
+
require 'doorkeeper-sequel/mixins/concerns/ownership'
|
23
22
|
|
24
|
-
Doorkeeper::Application.send :include,
|
23
|
+
Doorkeeper::Application.send :include, DoorkeeperSequel::Ownership
|
25
24
|
end
|
26
25
|
end
|
27
26
|
end
|
@@ -1,15 +1,8 @@
|
|
1
|
-
require_relative 'models/access_token_mixin'
|
2
|
-
|
3
1
|
module Doorkeeper
|
4
2
|
class AccessToken < Sequel::Model(:oauth_access_tokens)
|
5
|
-
include
|
3
|
+
include DoorkeeperSequel::AccessTokenMixin
|
6
4
|
|
7
5
|
class << self
|
8
|
-
def delete_all_for(application_id, resource_owner)
|
9
|
-
where(application_id: application_id,
|
10
|
-
resource_owner_id: resource_owner.id).delete
|
11
|
-
end
|
12
|
-
|
13
6
|
def active_for(resource_owner)
|
14
7
|
where(resource_owner_id: resource_owner.id, revoked_at: nil)
|
15
8
|
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
require_relative 'models/application_mixin'
|
2
|
-
|
3
1
|
module Doorkeeper
|
4
2
|
class Application < Sequel::Model(:oauth_applications)
|
5
|
-
include
|
3
|
+
include DoorkeeperSequel::ApplicationMixin
|
6
4
|
|
7
5
|
one_to_many :authorized_tokens, class: 'Doorkeeper::AccessToken', conditions: { revoked_at: nil }
|
8
6
|
many_to_many :authorized_applications, join_table: :oauth_access_tokens,
|
9
7
|
class: self, left_key: :id, right_key: :application_id
|
10
8
|
|
9
|
+
def redirect_uri=(uris)
|
10
|
+
super(uris.is_a?(Array) ? uris.join("\n") : uris)
|
11
|
+
end
|
12
|
+
|
11
13
|
def self.authorized_for(resource_owner)
|
12
14
|
resource_access_tokens = AccessToken.active_for(resource_owner)
|
13
15
|
where(id: resource_access_tokens.select_map(:application_id)).all
|
@@ -14,6 +14,7 @@ DB.create_table :oauth_applications do
|
|
14
14
|
|
15
15
|
column :scopes, String, size: 255, null: false, default: ''
|
16
16
|
column :redirect_uri, String
|
17
|
+
column :confidential, TrueClass, null: false, default: true
|
17
18
|
|
18
19
|
column :created_at, DateTime
|
19
20
|
column :updated_at, DateTime
|
data/spec/stubs/models/user.rb
CHANGED
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.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: 2018-
|
11
|
+
date: 2018-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: doorkeeper
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '4.0'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: 4.
|
19
|
+
version: 4.2.6
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '4.0'
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
|
-
version: 4.
|
29
|
+
version: 4.2.6
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: sequel
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -213,24 +213,26 @@ files:
|
|
213
213
|
- lib/doorkeeper-sequel/gem_version.rb
|
214
214
|
- lib/doorkeeper-sequel/generators/application_owner_generator.rb
|
215
215
|
- lib/doorkeeper-sequel/generators/concerns/migration_actions.rb
|
216
|
+
- lib/doorkeeper-sequel/generators/confidential_applications_generator.rb
|
216
217
|
- lib/doorkeeper-sequel/generators/migration_generator.rb
|
217
218
|
- lib/doorkeeper-sequel/generators/previous_refresh_token_generator.rb
|
219
|
+
- lib/doorkeeper-sequel/generators/templates/add_confidential_to_application_migration.rb
|
218
220
|
- lib/doorkeeper-sequel/generators/templates/add_owner_to_application.rb
|
219
221
|
- lib/doorkeeper-sequel/generators/templates/add_previous_refresh_token_to_access_tokens.rb
|
220
222
|
- lib/doorkeeper-sequel/generators/templates/create_doorkeeper_tables.rb
|
223
|
+
- lib/doorkeeper-sequel/mixins/access_grant_mixin.rb
|
224
|
+
- lib/doorkeeper-sequel/mixins/access_token_mixin.rb
|
225
|
+
- lib/doorkeeper-sequel/mixins/application_mixin.rb
|
226
|
+
- lib/doorkeeper-sequel/mixins/concerns/ownership.rb
|
227
|
+
- lib/doorkeeper-sequel/mixins/concerns/sequel_compat.rb
|
221
228
|
- lib/doorkeeper-sequel/railtie.rb
|
222
229
|
- lib/doorkeeper-sequel/tasks/doorkeeper-sequel.rake
|
230
|
+
- lib/doorkeeper-sequel/validators/redirect_uri_validator.rb
|
223
231
|
- lib/doorkeeper-sequel/version.rb
|
224
232
|
- lib/doorkeeper/orm/sequel.rb
|
225
233
|
- lib/doorkeeper/orm/sequel/access_grant.rb
|
226
234
|
- lib/doorkeeper/orm/sequel/access_token.rb
|
227
235
|
- lib/doorkeeper/orm/sequel/application.rb
|
228
|
-
- lib/doorkeeper/orm/sequel/models/access_grant_mixin.rb
|
229
|
-
- lib/doorkeeper/orm/sequel/models/access_token_mixin.rb
|
230
|
-
- lib/doorkeeper/orm/sequel/models/application_mixin.rb
|
231
|
-
- lib/doorkeeper/orm/sequel/models/concerns/ownership.rb
|
232
|
-
- lib/doorkeeper/orm/sequel/models/concerns/sequel_compat.rb
|
233
|
-
- lib/doorkeeper/orm/sequel/validators/redirect_uri_validator.rb
|
234
236
|
- spec/controllers/application_metal_controller.rb
|
235
237
|
- spec/controllers/applications_controller_spec.rb
|
236
238
|
- spec/controllers/authorizations_controller_spec.rb
|
@@ -269,6 +271,7 @@ files:
|
|
269
271
|
- spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
|
270
272
|
- spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
|
271
273
|
- spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb
|
274
|
+
- spec/dummy/db/migrate/20180210183654_add_confidential_to_application.rb
|
272
275
|
- spec/dummy/db/schema.rb
|
273
276
|
- spec/dummy/log/test.log
|
274
277
|
- spec/dummy/public/404.html
|
@@ -277,36 +280,47 @@ files:
|
|
277
280
|
- spec/dummy/public/favicon.ico
|
278
281
|
- spec/dummy/script/rails
|
279
282
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/0p/0pa3wNbGHqFC6gxrMvdOJiP6gPwFv9VJ_npjEfRWxAE.cache
|
280
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
283
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/0x/0x7itSE_jjN9NM8w3jE4isMgaQPBrVx0prZCwBURBV0.cache
|
281
284
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/3P/3PoguHEOEeItUjmwC74MWLLP-_Ijow7798bF5U6K2dw.cache
|
282
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
285
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/4Q/4QEkO7sOQsz2KI7mJWxhmltotR8iDKMhV-8Gui8l1Yo.cache
|
286
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/4_/4_AVHXD_fQP3S2gUiYF1Azv90b6luuMnAM0hxD901y0.cache
|
283
287
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/6b/6b0anrSo7Fvoc05t4Ca0zZmfS_cpERy1DsG3ea6lBOg.cache
|
288
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/6k/6kyl2zElqd6QNgJLE7Ej-F9Xofwmq0OiAIJTHGtoCt8.cache
|
289
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/9D/9DkYxrjE-y5KTPxxIo5Zs3AOaylSDDJPPWbghYbc6tA.cache
|
284
290
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/BA/BAC3ZaGoeZ9Od-kKg-UQYelvRgsCa0H72-52nLdcTNw.cache
|
285
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/BF/BFKLz7OpWyKHF9HbCB2KMj9YiSaAaqq-Pr_gUN9ynXQ.cache
|
286
291
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Bw/Bw6Nimjvy5Yv1AYbZb1t-v0eMNhv-bhwBzR-b5mY7FU.cache
|
287
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Dj/DjHdUUmp3ok2NdsJIJgLAP3WPBsUrrlml2jlFMQ2V4M.cache
|
288
292
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Fq/FqQWjMAz8yjZQlMC_dUsztaOxGruI2IXyGAAUF9SvQ0.cache
|
293
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Hc/HcIx4yYPg3w0vv-Cj49orJw9fudDS4Qpe3WXtuej7MI.cache
|
294
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Ht/HtCMc1ZaTgZy2o1DFs1PbbISOEzOsyW0aFFkquK8ywY.cache
|
289
295
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/J_/J_D9clwKidN28hnVB1O3zEfKDwg90Usdb5ToKiPq_aw.cache
|
296
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Jg/JgpBOeANnJqUX61iOsyq9gnH5CdODzg18IvAQYJC_PE.cache
|
290
297
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Ji/JitNKkP1dYdu9ObSdIkkEAsiFxEmRO5oy1UIyhT_hYs.cache
|
291
298
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Jq/JqTLVvnY2AgGkHftWPwqt_HkbwhYRsmgHxk37VqKJAY.cache
|
299
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/K-/K-zIshtjhzfsKunHgtf4oRnTZuW_C9lUh_vP8EuydZY.cache
|
300
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/LF/LF3zCtek7hbLgoNRiXnEYsN9BkXVGw5dqB2W-pALTcU.cache
|
292
301
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/QX/QXcp8DweOJ6BfMedGMfeHvVXv2hjDIleln1LSJk7vOE.cache
|
293
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
302
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Rw/RwtI_j7fJhgLfhnUQlGxoS-oFn2XExsMONzyxeaNhQ0.cache
|
303
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/T3/T3h82qJsdqVlH178VSlblhU1evf9RZq83rqKMwjdRKI.cache
|
294
304
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Ta/TaYxNn81MhqC3DnMC6_y_Q7xap5Ntn4ggFo94EUaiak.cache
|
305
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Wn/WnJTlULZ65547f83Wc-LjLXHGBPvOi_0ItAaE_6SlzY.cache
|
295
306
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Wq/WqbLVKOcTMZtttygYt_ncr1mGIDrzevSTaPGNmzV1D8.cache
|
296
307
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/YF/YF60qiQ28QMoYDrLmrbHWZr7X7bl5MxVPR5QrrVCFak.cache
|
297
308
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Yf/YfJJZvm_NONHd4eCasDibCcRapZ_WYIO5MUxSUUbYFk.cache
|
309
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Yi/YigT9tpj4dQzAx0EBR0E5d3g7wtv9X1Qw7eprYkoeNE.cache
|
298
310
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Z0/Z0e47cT2a-21U-w-3gkbgqC3o5jWnEzOB8vW06aJH1E.cache
|
299
311
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/dL/dL7SLUWUIeVdyA1UuH-rvif0nzesOar3LdEtqzdb4bE.cache
|
312
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/f1/f11L16ip-n_en5vxM7LnyFPv_A9VDsPUKXzg-hDG0dE.cache
|
300
313
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/f8/f8WT8jqR1qNIdQaRDpXbyLN7E5AWkbYFBwdh9Ozk7gk.cache
|
314
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/fX/fXlPiyPj8HG3QoJDYpup0DTLBnq8hw6Np2VeMHWKuaQ.cache
|
315
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/g5/g5VAxZ-YK0jKJukhexFCoUQqI2yLS1eOYNbU__THPvo.cache
|
316
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/hU/hUU3IwUkZwk7JZj3LvnwlHPmwPh0Dz9B2Fv0aj17VJw.cache
|
301
317
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/hk/hk2YB6skvc72qL4IzzQKU8Emyfe5vARjoD1bvQTw4zE.cache
|
302
318
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/ii/iiJRBZIsxKiwyzU_Z7UtQeUTXMRJRPTreTKRvAWO7_8.cache
|
303
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
304
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
319
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/lx/lxLzW5UwcFlFj1MV5uZ_icpe7sCVc6_WUMMLMqUqbzQ.cache
|
320
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/qS/qSc-air8Wm-UxxbdyXgOBiwA1g2VgejS3oE4CTPnUJs.cache
|
305
321
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/qo/qo6SpT75QykYB63Aqq5bgzpXyNU1Y4dGFvCCJgoWQpE.cache
|
306
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/uk/uk0Wuikya-uKSt8N38Pz-XGq4Iaq0VJ5jNG4H8axOlI.cache
|
307
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/vE/vEXvloR-Mc9vEJ2YldGHD7XjwHTkdR4gOHuwoDAw9Fs.cache
|
308
322
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/vO/vOXN0mER62j4JiPpMTSVS7MMqs0067cZx14vD5B8qiQ.cache
|
309
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
323
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/wC/wCg1fNgvPgN-FNalk0y-pOrMrUUVpjjG_3jLzh3J29I.cache
|
310
324
|
- spec/factories.rb
|
311
325
|
- spec/generators/templates/routes.rb
|
312
326
|
- spec/generators/tmp/dummy/app/views/doorkeeper/applications/_delete_form.html.erb
|
@@ -470,36 +484,47 @@ test_files:
|
|
470
484
|
- spec/dummy/public/favicon.ico
|
471
485
|
- spec/dummy/public/404.html
|
472
486
|
- spec/dummy/public/500.html
|
473
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
487
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Jg/JgpBOeANnJqUX61iOsyq9gnH5CdODzg18IvAQYJC_PE.cache
|
488
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/4Q/4QEkO7sOQsz2KI7mJWxhmltotR8iDKMhV-8Gui8l1Yo.cache
|
474
489
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/BA/BAC3ZaGoeZ9Od-kKg-UQYelvRgsCa0H72-52nLdcTNw.cache
|
475
490
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/hk/hk2YB6skvc72qL4IzzQKU8Emyfe5vARjoD1bvQTw4zE.cache
|
476
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
477
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
491
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/hU/hUU3IwUkZwk7JZj3LvnwlHPmwPh0Dz9B2Fv0aj17VJw.cache
|
492
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/K-/K-zIshtjhzfsKunHgtf4oRnTZuW_C9lUh_vP8EuydZY.cache
|
493
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/T3/T3h82qJsdqVlH178VSlblhU1evf9RZq83rqKMwjdRKI.cache
|
494
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Rw/RwtI_j7fJhgLfhnUQlGxoS-oFn2XExsMONzyxeaNhQ0.cache
|
478
495
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Ta/TaYxNn81MhqC3DnMC6_y_Q7xap5Ntn4ggFo94EUaiak.cache
|
479
496
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Yf/YfJJZvm_NONHd4eCasDibCcRapZ_WYIO5MUxSUUbYFk.cache
|
480
497
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/3P/3PoguHEOEeItUjmwC74MWLLP-_Ijow7798bF5U6K2dw.cache
|
481
498
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Jq/JqTLVvnY2AgGkHftWPwqt_HkbwhYRsmgHxk37VqKJAY.cache
|
482
499
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Wq/WqbLVKOcTMZtttygYt_ncr1mGIDrzevSTaPGNmzV1D8.cache
|
483
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
484
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
500
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/wC/wCg1fNgvPgN-FNalk0y-pOrMrUUVpjjG_3jLzh3J29I.cache
|
501
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/lx/lxLzW5UwcFlFj1MV5uZ_icpe7sCVc6_WUMMLMqUqbzQ.cache
|
485
502
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/YF/YF60qiQ28QMoYDrLmrbHWZr7X7bl5MxVPR5QrrVCFak.cache
|
486
503
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/vO/vOXN0mER62j4JiPpMTSVS7MMqs0067cZx14vD5B8qiQ.cache
|
504
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/fX/fXlPiyPj8HG3QoJDYpup0DTLBnq8hw6Np2VeMHWKuaQ.cache
|
505
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/LF/LF3zCtek7hbLgoNRiXnEYsN9BkXVGw5dqB2W-pALTcU.cache
|
487
506
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/f8/f8WT8jqR1qNIdQaRDpXbyLN7E5AWkbYFBwdh9Ozk7gk.cache
|
507
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Yi/YigT9tpj4dQzAx0EBR0E5d3g7wtv9X1Qw7eprYkoeNE.cache
|
508
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/6k/6kyl2zElqd6QNgJLE7Ej-F9Xofwmq0OiAIJTHGtoCt8.cache
|
488
509
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/6b/6b0anrSo7Fvoc05t4Ca0zZmfS_cpERy1DsG3ea6lBOg.cache
|
489
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
510
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/qS/qSc-air8Wm-UxxbdyXgOBiwA1g2VgejS3oE4CTPnUJs.cache
|
511
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Ht/HtCMc1ZaTgZy2o1DFs1PbbISOEzOsyW0aFFkquK8ywY.cache
|
512
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Hc/HcIx4yYPg3w0vv-Cj49orJw9fudDS4Qpe3WXtuej7MI.cache
|
490
513
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Z0/Z0e47cT2a-21U-w-3gkbgqC3o5jWnEzOB8vW06aJH1E.cache
|
491
514
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/ii/iiJRBZIsxKiwyzU_Z7UtQeUTXMRJRPTreTKRvAWO7_8.cache
|
492
515
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/0p/0pa3wNbGHqFC6gxrMvdOJiP6gPwFv9VJ_npjEfRWxAE.cache
|
493
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Dj/DjHdUUmp3ok2NdsJIJgLAP3WPBsUrrlml2jlFMQ2V4M.cache
|
494
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/uk/uk0Wuikya-uKSt8N38Pz-XGq4Iaq0VJ5jNG4H8axOlI.cache
|
495
516
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/QX/QXcp8DweOJ6BfMedGMfeHvVXv2hjDIleln1LSJk7vOE.cache
|
496
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/
|
517
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Wn/WnJTlULZ65547f83Wc-LjLXHGBPvOi_0ItAaE_6SlzY.cache
|
497
518
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Bw/Bw6Nimjvy5Yv1AYbZb1t-v0eMNhv-bhwBzR-b5mY7FU.cache
|
498
519
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Fq/FqQWjMAz8yjZQlMC_dUsztaOxGruI2IXyGAAUF9SvQ0.cache
|
520
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/0x/0x7itSE_jjN9NM8w3jE4isMgaQPBrVx0prZCwBURBV0.cache
|
521
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/9D/9DkYxrjE-y5KTPxxIo5Zs3AOaylSDDJPPWbghYbc6tA.cache
|
522
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/g5/g5VAxZ-YK0jKJukhexFCoUQqI2yLS1eOYNbU__THPvo.cache
|
499
523
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/J_/J_D9clwKidN28hnVB1O3zEfKDwg90Usdb5ToKiPq_aw.cache
|
500
524
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/dL/dL7SLUWUIeVdyA1UuH-rvif0nzesOar3LdEtqzdb4bE.cache
|
525
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/f1/f11L16ip-n_en5vxM7LnyFPv_A9VDsPUKXzg-hDG0dE.cache
|
526
|
+
- spec/dummy/tmp/cache/assets/sprockets/v3.0/4_/4_AVHXD_fQP3S2gUiYF1Azv90b6luuMnAM0hxD901y0.cache
|
501
527
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Ji/JitNKkP1dYdu9ObSdIkkEAsiFxEmRO5oy1UIyhT_hYs.cache
|
502
|
-
- spec/dummy/tmp/cache/assets/sprockets/v3.0/vE/vEXvloR-Mc9vEJ2YldGHD7XjwHTkdR4gOHuwoDAw9Fs.cache
|
503
528
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/qo/qo6SpT75QykYB63Aqq5bgzpXyNU1Y4dGFvCCJgoWQpE.cache
|
504
529
|
- spec/dummy/app/views/home/index.html.erb
|
505
530
|
- spec/dummy/app/views/layouts/application.html.erb
|
@@ -517,6 +542,7 @@ test_files:
|
|
517
542
|
- spec/dummy/db/schema.rb
|
518
543
|
- spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
|
519
544
|
- spec/dummy/db/migrate/20111122132257_create_users.rb
|
545
|
+
- spec/dummy/db/migrate/20180210183654_add_confidential_to_application.rb
|
520
546
|
- spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
|
521
547
|
- spec/dummy/db/migrate/20160320211015_add_previous_refresh_token_to_access_tokens.rb
|
522
548
|
- spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
|
@@ -1,50 +0,0 @@
|
|
1
|
-
module Doorkeeper
|
2
|
-
module Orm
|
3
|
-
module Sequel
|
4
|
-
module AccessGrantMixin
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
include SequelCompat
|
8
|
-
include OAuth::Helpers
|
9
|
-
include Models::Expirable
|
10
|
-
include Models::Revocable
|
11
|
-
include Models::Accessible
|
12
|
-
include Models::Scopes
|
13
|
-
|
14
|
-
included do
|
15
|
-
plugin :validation_helpers
|
16
|
-
plugin :timestamps
|
17
|
-
|
18
|
-
many_to_one :application, class: 'Doorkeeper::Application'
|
19
|
-
|
20
|
-
set_allowed_columns :resource_owner_id, :application_id,
|
21
|
-
:expires_in, :redirect_uri, :scopes
|
22
|
-
|
23
|
-
def before_validation
|
24
|
-
generate_token if new?
|
25
|
-
super
|
26
|
-
end
|
27
|
-
|
28
|
-
def validate
|
29
|
-
super
|
30
|
-
validates_presence [:resource_owner_id, :application_id,
|
31
|
-
:token, :expires_in, :redirect_uri]
|
32
|
-
validates_unique [:token]
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module ClassMethods
|
37
|
-
def by_token(token)
|
38
|
-
first(token: token.to_s)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def generate_token
|
45
|
-
self.token = UniqueToken.generate
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|