doorkeeper 2.2.1 → 2.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deaa5b8594c905718666747b34f68ce23d2ee707
4
- data.tar.gz: c6a694f036f968c415ab2ecf9345a91e99273abb
3
+ metadata.gz: 1d6335a06e80f4b3c0deaf0df17f7179c454024e
4
+ data.tar.gz: f0fcb5b41952e00cb778207346bbd3fa60ae837a
5
5
  SHA512:
6
- metadata.gz: 550da7f4937a9ae9786072d0c23c7fd07347336da752232f03a28200c9edb0793e58763c29efc74b9ea52fd4e2278b926f323c1cd5e5356c8090e8dd24123859
7
- data.tar.gz: 13fa74a7326c592fe6f2a2a60ab81318ca923fcc3f6e7a79111ca1ffd718dc27ff76cd2483e38676d28f37443d495573746aca18ce5ae00cf78e064355b16fa2
6
+ metadata.gz: 10eb65f7b258c5408c176f5fc7c4f348ddb66a27f5254ab7aeab0f166766f4fcbf5a804b411093add7d62d38f7861493d205893937932a2beed4b573a8263922
7
+ data.tar.gz: 0e2a01becb02cee6f520e1c180d234e8bc1262d67330239cb5034ebe6ff89442daa44cc45201895eb4d92689f7e3e0823874d8723247593eca179d3c45b67131
data/NEWS.md CHANGED
@@ -4,6 +4,18 @@ User-visible changes worth mentioning.
4
4
 
5
5
  ---
6
6
 
7
+ ## 2.2.2
8
+
9
+ - [#654] Fixed `check_requirements` not to abort when ActiveRecord
10
+ `oauth_applications` table does not have the `scopes` column.
11
+ (Issue #653)
12
+ - [#599] Included MassAssignmentSecurity in mixins if
13
+ ::ProtectedAttributes is defined.
14
+ - [#650] Only fallback i18n when it is not set.
15
+ - [#541] Fixed `undefined method attr_accessible` problem on Rails 4
16
+ (happens only when ProtectedAttributes gem is used) in #599
17
+ - [#689] Allow scopes to me resetted to empty in Mongoid
18
+
7
19
  ## 2.2.1
8
20
 
9
21
  - [#636] `custom_access_token_expires_in` bugfixes
data/README.md CHANGED
@@ -129,7 +129,6 @@ This will mount following routes:
129
129
  GET /oauth/authorize/:code
130
130
  GET /oauth/authorize
131
131
  POST /oauth/authorize
132
- PUT /oauth/authorize
133
132
  DELETE /oauth/authorize
134
133
  POST /oauth/token
135
134
  POST /oauth/revoke
@@ -5,7 +5,9 @@ module Doorkeeper
5
5
  end
6
6
 
7
7
  initializer "doorkeeper.locales" do |app|
8
- app.config.i18n.fallbacks = [:en]
8
+ if app.config.i18n.fallbacks.blank?
9
+ app.config.i18n.fallbacks = [:en]
10
+ end
9
11
  end
10
12
 
11
13
  initializer "doorkeeper.routes" do
@@ -7,11 +7,12 @@ module Doorkeeper
7
7
  include Models::Revocable
8
8
  include Models::Accessible
9
9
  include Models::Scopes
10
+ include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
10
11
 
11
12
  included do
12
13
  belongs_to :application, class_name: 'Doorkeeper::Application', inverse_of: :access_grants
13
14
 
14
- if ::Rails.version.to_i < 4 || defined?(::ProtectedAttributes)
15
+ if respond_to?(:attr_accessible)
15
16
  attr_accessible :resource_owner_id, :application_id, :expires_in, :redirect_uri, :scopes
16
17
  end
17
18
 
@@ -7,6 +7,7 @@ module Doorkeeper
7
7
  include Models::Revocable
8
8
  include Models::Accessible
9
9
  include Models::Scopes
10
+ include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
10
11
 
11
12
  included do
12
13
  belongs_to :application,
@@ -18,7 +19,7 @@ module Doorkeeper
18
19
 
19
20
  attr_writer :use_refresh_token
20
21
 
21
- if ::Rails.version.to_i < 4 || defined?(::ProtectedAttributes)
22
+ if respond_to?(:attr_accessible)
22
23
  attr_accessible :application_id, :resource_owner_id, :expires_in,
23
24
  :scopes, :use_refresh_token
24
25
  end
@@ -4,6 +4,7 @@ module Doorkeeper
4
4
 
5
5
  include OAuth::Helpers
6
6
  include Models::Scopes
7
+ include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
7
8
 
8
9
  included do
9
10
  has_many :access_grants, dependent: :destroy, class_name: 'Doorkeeper::AccessGrant'
@@ -15,7 +16,7 @@ module Doorkeeper
15
16
 
16
17
  before_validation :generate_uid, :generate_secret, on: :create
17
18
 
18
- if ::Rails.version.to_i < 4 || defined?(::ProtectedAttributes)
19
+ if respond_to?(:attr_accessible)
19
20
  attr_accessible :name, :redirect_uri
20
21
  end
21
22
  end
@@ -25,11 +25,12 @@ module Doorkeeper
25
25
  Doorkeeper::Application.table_name
26
26
  )
27
27
  unless Doorkeeper::Application.new.attributes.include?("scopes")
28
- fail <<-MSG.squish
28
+ migration_path = '../../../generators/doorkeeper/templates/add_scopes_to_oauth_applications.rb'
29
+ puts <<-MSG.squish
29
30
  [doorkeeper] Missing column: `oauth_applications.scopes`.
30
- Run `rails generate doorkeeper:application_scopes
31
- && rake db:migrate` to add it.
31
+ Create the following migration and run `rake db:migrate`.
32
32
  MSG
33
+ puts File.read(File.expand_path(migration_path, __FILE__))
33
34
  end
34
35
  end
35
36
  end
@@ -21,7 +21,7 @@ module Doorkeeper
21
21
  end
22
22
 
23
23
  def scopes=(value)
24
- write_attribute :scopes, value if value.present?
24
+ write_attribute :scopes, value
25
25
  end
26
26
  end
27
27
  end
@@ -21,7 +21,7 @@ module Doorkeeper
21
21
  end
22
22
 
23
23
  def scopes=(value)
24
- write_attribute :scopes, value if value.present?
24
+ write_attribute :scopes, value
25
25
  end
26
26
  end
27
27
  end
@@ -9,7 +9,7 @@ module Doorkeeper
9
9
  end
10
10
 
11
11
  def scopes=(value)
12
- write_attribute :scopes, value if value.present?
12
+ write_attribute :scopes, value
13
13
  end
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Doorkeeper
2
- VERSION = '2.2.1'
2
+ VERSION = '2.2.2'
3
3
  end
@@ -21,7 +21,9 @@ when "mongo_mapper"
21
21
  end
22
22
 
23
23
  class User
24
- if ::Rails.version.to_i < 4 || defined?(::ProtectedAttributes)
24
+ include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
25
+
26
+ if respond_to?(:attr_accessible)
25
27
  attr_accessible :name, :password
26
28
  end
27
29
 
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: 2.2.1
4
+ version: 2.2.2
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-05-05 00:00:00.000000000 Z
12
+ date: 2015-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -571,3 +571,4 @@ test_files:
571
571
  - spec/support/shared/controllers_shared_context.rb
572
572
  - spec/support/shared/models_shared_examples.rb
573
573
  - spec/validators/redirect_uri_validator_spec.rb
574
+ has_rdoc: