doorkeeper 4.0.0.rc1 → 4.0.0.rc2
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/.travis.yml +5 -4
- data/NEWS.md +4 -0
- data/lib/doorkeeper/models/access_grant_mixin.rb +9 -1
- data/lib/doorkeeper/models/access_token_mixin.rb +1 -1
- data/lib/doorkeeper/models/concerns/ownership.rb +6 -1
- data/lib/doorkeeper/version.rb +1 -1
- data/spec/dummy/config/application.rb +2 -36
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/test.rb +4 -12
- data/spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb +6 -0
- data/spec/models/doorkeeper/access_token_spec.rb +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf9f87edf2bb97b62628659cd77adbf6b8efb103
|
4
|
+
data.tar.gz: d5481740fd13dc62cc157deb6cb2c75890612e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daac8f9ffc3dc10f4a3a7f5836641958b5a079569e09e7a623f1119169e93cef1db5f534d9dfbfa1bf355728f9e119158d10de215a0cc45f9eaa19e435df9d91
|
7
|
+
data.tar.gz: 66b9b8c90fe75e89d6831f034bfb580ca6d1a2f20157de569bdb67168e15f1e5f9c0b1b26b6b37cc6d11e550deb3b7da621d62a3411a6292f5973d333d328dfa
|
data/.travis.yml
CHANGED
@@ -4,16 +4,17 @@ sudo: false
|
|
4
4
|
|
5
5
|
rvm:
|
6
6
|
- 2.1
|
7
|
-
- 2.2.
|
7
|
+
- 2.2.4
|
8
|
+
- 2.3.0
|
8
9
|
- jruby-head
|
9
10
|
|
10
11
|
env:
|
11
12
|
- rails=4.2.0
|
12
|
-
- rails=5.0.0.
|
13
|
+
- rails=5.0.0.beta3
|
13
14
|
|
14
15
|
matrix:
|
15
16
|
exclude:
|
16
|
-
- env: rails=5.0.0.
|
17
|
+
- env: rails=5.0.0.beta3
|
17
18
|
rvm: 2.1
|
18
|
-
- env: rails=5.0.0.
|
19
|
+
- env: rails=5.0.0.beta3
|
19
20
|
rvm: jruby-head
|
data/NEWS.md
CHANGED
@@ -10,7 +10,15 @@ module Doorkeeper
|
|
10
10
|
include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
|
11
11
|
|
12
12
|
included do
|
13
|
-
|
13
|
+
belongs_to_options = {
|
14
|
+
class_name: 'Doorkeeper::Application',
|
15
|
+
inverse_of: :access_grants
|
16
|
+
}
|
17
|
+
if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
|
18
|
+
belongs_to_options.merge!(optional: true)
|
19
|
+
end
|
20
|
+
|
21
|
+
belongs_to :application, belongs_to_options
|
14
22
|
|
15
23
|
if respond_to?(:attr_accessible)
|
16
24
|
attr_accessible :resource_owner_id, :application_id, :expires_in, :redirect_uri, :scopes
|
@@ -15,7 +15,7 @@ module Doorkeeper
|
|
15
15
|
inverse_of: :access_tokens
|
16
16
|
}
|
17
17
|
if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
|
18
|
-
belongs_to_options.merge(optional: true)
|
18
|
+
belongs_to_options.merge!(optional: true)
|
19
19
|
end
|
20
20
|
|
21
21
|
belongs_to :application, belongs_to_options
|
@@ -4,7 +4,12 @@ module Doorkeeper
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
-
|
7
|
+
belongs_to_options = { polymorphic: true }
|
8
|
+
if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
|
9
|
+
belongs_to_options.merge!(optional: true)
|
10
|
+
end
|
11
|
+
|
12
|
+
belongs_to :owner, belongs_to_options
|
8
13
|
validates :owner, presence: true, if: :validate_owner?
|
9
14
|
end
|
10
15
|
|
data/lib/doorkeeper/version.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'sprockets/railtie'
|
3
|
+
require 'rails/all'
|
5
4
|
|
6
|
-
Bundler.require
|
5
|
+
Bundler.require(*Rails.groups)
|
7
6
|
|
8
7
|
require 'yaml'
|
9
8
|
|
@@ -20,38 +19,5 @@ module Dummy
|
|
20
19
|
# Settings in config/environments/* take precedence over those specified here.
|
21
20
|
# Application configuration should go into files in config/initializers
|
22
21
|
# -- all .rb files in that directory are automatically loaded.
|
23
|
-
|
24
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
25
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
26
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
27
|
-
|
28
|
-
# Activate observers that should always be running.
|
29
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
30
|
-
|
31
|
-
if defined?(ActiveRecord) && Rails.version.to_i < 4
|
32
|
-
config.active_record.whitelist_attributes = true
|
33
|
-
end
|
34
|
-
|
35
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
36
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
37
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
38
|
-
|
39
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
40
|
-
config.i18n.load_path += Dir[Rails.root.join('../../', 'config/locales', '*.{rb,yml}').to_s]
|
41
|
-
# config.i18n.default_locale = :en
|
42
|
-
|
43
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
44
|
-
config.encoding = 'utf-8'
|
45
|
-
|
46
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
47
|
-
config.filter_parameters += [:password]
|
48
|
-
|
49
|
-
# Enable the asset pipeline
|
50
|
-
config.assets.enabled = true
|
51
|
-
|
52
|
-
# Version of your assets, change this if you want to expire all your assets
|
53
|
-
config.assets.version = '1.0'
|
54
|
-
|
55
|
-
I18n.enforce_available_locales = false
|
56
22
|
end
|
57
23
|
end
|
@@ -10,18 +10,10 @@ Dummy::Application.configure do
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
11
11
|
config.static_cache_control = 'public, max-age=3600'
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
if Rails.version.to_i >= 4
|
19
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
20
|
-
# just for the purpose of running a single test. If you are using a tool that
|
21
|
-
# preloads Rails for running tests, you may have to set it to true.
|
22
|
-
config.eager_load = false
|
23
|
-
config.i18n.enforce_available_locales = true
|
24
|
-
end
|
13
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
14
|
+
# just for the purpose of running a single test. If you are using a tool that
|
15
|
+
# preloads Rails for running tests, you may have to set it to true.
|
16
|
+
config.eager_load = false
|
25
17
|
|
26
18
|
# Show full error reports and disable caching
|
27
19
|
config.consider_all_requests_local = true
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# Require `belongs_to` associations by default. This is a new Rails 5.0
|
2
|
+
# default, so it is introduced as a configuration option to ensure that apps
|
3
|
+
# made on earlier versions of Rails are not affected when upgrading.
|
4
|
+
if Rails.version.to_i >= 5
|
5
|
+
Rails.application.config.active_record.belongs_to_required_by_default = true
|
6
|
+
end
|
@@ -143,6 +143,12 @@ module Doorkeeper
|
|
143
143
|
subject.resource_owner_id = nil
|
144
144
|
expect(subject).to be_valid
|
145
145
|
end
|
146
|
+
|
147
|
+
it 'is valid without resource_owner_id' do
|
148
|
+
# For resource owner credentials flow
|
149
|
+
subject.application_id = nil
|
150
|
+
expect(subject).to be_valid
|
151
|
+
end
|
146
152
|
end
|
147
153
|
|
148
154
|
describe '#same_credential?' do
|
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.0.0.
|
4
|
+
version: 4.0.0.rc2
|
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: 2016-
|
12
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- spec/dummy/config/environments/development.rb
|
250
250
|
- spec/dummy/config/environments/production.rb
|
251
251
|
- spec/dummy/config/environments/test.rb
|
252
|
+
- spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb
|
252
253
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
253
254
|
- spec/dummy/config/initializers/doorkeeper.rb
|
254
255
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -390,6 +391,7 @@ test_files:
|
|
390
391
|
- spec/dummy/config/environments/development.rb
|
391
392
|
- spec/dummy/config/environments/production.rb
|
392
393
|
- spec/dummy/config/environments/test.rb
|
394
|
+
- spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb
|
393
395
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
394
396
|
- spec/dummy/config/initializers/doorkeeper.rb
|
395
397
|
- spec/dummy/config/initializers/secret_token.rb
|