doorkeeper 0.7.0 → 0.7.1

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: 7fcb07abcda6e9eed4a8cfec8203ef88dc243f50
4
- data.tar.gz: fe23329643e7a1e88dfe432aa2c04314de90ac35
3
+ metadata.gz: 4ea51224993fe17eb8bce055c441a2b583a6d9b7
4
+ data.tar.gz: 366ca2f1d49a33433714f470c5c66dd5b0c84c9d
5
5
  SHA512:
6
- metadata.gz: b169d9dbe8e64af11e65c2e505ca00ddc472ef8e33eb63bb1f9ea2651387f49dc14424e0e9e22148b6f5927519c995d26fde39ff45b18660de7ed211c1ac8cbf
7
- data.tar.gz: 082d67eaa6f7b296ac9de89b9deb58612e7451bd95901ff4c989377ccea8f207cae006551e4f57346d3da3b251f2a7362aee3b3d70e8010ceb2ab247382c2d29
6
+ metadata.gz: 76fdba565bfa0a6b3382fb98a4cf5402794ab8b474ffe3324159b8ae7c1feee0f97e330d22e698fadeb7dc9551b6e56d5520cbc3949fa6ffd47b72fd1aaefd7e
7
+ data.tar.gz: 22f95b1680a08285831218530b4d8789c64c2e3170d6963d5f1c15f4118a05724ca9e8c4a7c50acce0c918f022f57b2e5bd77c101c6b3f97da818e668579766a
data/.travis.yml CHANGED
@@ -15,8 +15,3 @@ services:
15
15
  matrix:
16
16
  allow_failures:
17
17
  - env: orm=mongoid2
18
- exclude:
19
- - rvm: 1.9.2
20
- env: orm=mongoid3
21
- - rvm: 1.9.2
22
- env: rails=4.0.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1
4
+
5
+ - bug
6
+ - [#269] Rails 3.2 raised `ActiveModel::MassAssignmentSecurity::Error`.
7
+
3
8
  ## 0.7.0
4
9
 
5
10
  - enhancements
data/README.md CHANGED
@@ -25,7 +25,7 @@ The gem is under constant development. It is based in the [version 22 of the OAu
25
25
  Put this in your Gemfile:
26
26
 
27
27
  ``` ruby
28
- gem 'doorkeeper', '~> 0.7.0'
28
+ gem 'doorkeeper', '~> 0.7.1'
29
29
  ```
30
30
 
31
31
  Run the installation generator with:
@@ -4,7 +4,7 @@ module Doorkeeper
4
4
 
5
5
  before_filter :authenticate_admin!
6
6
  before_filter :set_application, :only => [:show, :edit, :update, :destroy]
7
-
7
+
8
8
  def index
9
9
  @applications = Application.all
10
10
  end
@@ -44,11 +44,11 @@ module Doorkeeper
44
44
  end
45
45
 
46
46
  private
47
-
47
+
48
48
  def set_application
49
49
  @application = Application.find(params[:id])
50
50
  end
51
-
51
+
52
52
  def application_params
53
53
  if params.respond_to?(:permit)
54
54
  params.require(:application).permit(:name, :redirect_uri)
data/doorkeeper.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "https://github.com/applicake/doorkeeper"
11
11
  s.summary = "Doorkeeper is an OAuth 2 provider for Rails."
12
12
  s.description = "Doorkeeper is an OAuth 2 provider for Rails."
13
+ s.license = 'MIT'
13
14
 
14
15
  s.files = `git ls-files`.split("\n")
15
16
  s.test_files = `git ls-files -- test/*`.split("\n")
@@ -8,6 +8,10 @@ module Doorkeeper
8
8
 
9
9
  belongs_to :application, :class_name => "Doorkeeper::Application", :inverse_of => :access_grants
10
10
 
11
+ if ::Rails.version.to_i < 4
12
+ attr_accessible :resource_owner_id, :application_id, :expires_in, :redirect_uri, :scopes
13
+ end
14
+
11
15
  validates :resource_owner_id, :application_id, :token, :expires_in, :redirect_uri, :presence => true
12
16
  validates :token, :uniqueness => true
13
17
 
@@ -13,6 +13,9 @@ module Doorkeeper
13
13
  validates :refresh_token, :uniqueness => true, :if => :use_refresh_token?
14
14
 
15
15
  attr_accessor :use_refresh_token
16
+ if ::Rails.version.to_i < 4
17
+ attr_accessible :application_id, :resource_owner_id, :expires_in, :scopes, :use_refresh_token
18
+ end
16
19
 
17
20
  before_validation :generate_token, :on => :create
18
21
  before_validation :generate_refresh_token, :on => :create, :if => :use_refresh_token?
@@ -11,6 +11,10 @@ module Doorkeeper
11
11
 
12
12
  before_validation :generate_uid, :generate_secret, :on => :create
13
13
 
14
+ if ::Rails.version.to_i < 4
15
+ attr_accessible :name, :redirect_uri
16
+ end
17
+
14
18
  def self.model_name
15
19
  ActiveModel::Name.new(self, Doorkeeper, 'Application')
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module Doorkeeper
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -3,7 +3,7 @@ require 'spec_helper_integration'
3
3
  module Doorkeeper
4
4
  describe ApplicationsController do
5
5
  context "when admin is not authenticated" do
6
- before(:each) do
6
+ before do
7
7
  Doorkeeper.configuration.stub(:authenticate_admin => proc do
8
8
  redirect_to main_app.root_url
9
9
  end)
@@ -13,6 +13,38 @@ module Doorkeeper
13
13
  get :index
14
14
  expect(response).to redirect_to(controller.main_app.root_url)
15
15
  end
16
+
17
+ it "doesn't create application" do
18
+ expect do
19
+ post :create, application: {
20
+ name: 'Example',
21
+ redirect_uri: 'http://example.com' }
22
+ end.to_not change { Doorkeeper::Application.count }
23
+ end
24
+ end
25
+
26
+ context "when admin is authenticated" do
27
+ before do
28
+ Doorkeeper.configuration.stub(authenticate_admin: ->(arg) { true })
29
+ end
30
+
31
+ it "creates application" do
32
+ expect do
33
+ post :create, application: {
34
+ name: 'Example',
35
+ redirect_uri: 'http://example.com' }
36
+ end.to change { Doorkeeper::Application.count }.by(1)
37
+ expect(response).to be_redirect
38
+ end
39
+
40
+ it "updates application" do
41
+ application = FactoryGirl.create(:application)
42
+ put :update, id: application.id, application: {
43
+ name: 'Example',
44
+ redirect_uri: 'http://example.com' }
45
+ application.reload.name.should eq 'Example'
46
+ end
16
47
  end
48
+
17
49
  end
18
50
  end
@@ -21,6 +21,10 @@ when :mongo_mapper
21
21
  end
22
22
 
23
23
  class User
24
+ if ::Rails.version.to_i < 4
25
+ attr_accessible :name, :password
26
+ end
27
+
24
28
  def self.authenticate!(name, password)
25
29
  User.where(:name => name, :password => password).first
26
30
  end
@@ -30,6 +30,10 @@ module Dummy
30
30
  # Activate observers that should always be running.
31
31
  # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
32
32
 
33
+ if defined?(ActiveRecord) && Rails.version.to_i < 4
34
+ config.active_record.whitelist_attributes = true
35
+ end
36
+
33
37
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
34
38
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
35
39
  # config.time_zone = 'Central Time (US & Canada)'
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: 0.7.0
4
+ version: 0.7.1
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: 2013-08-22 00:00:00.000000000 Z
12
+ date: 2013-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -388,7 +388,8 @@ files:
388
388
  - spec/validators/redirect_uri_validator_spec.rb
389
389
  - vendor/assets/stylesheets/doorkeeper/bootstrap.min.css
390
390
  homepage: https://github.com/applicake/doorkeeper
391
- licenses: []
391
+ licenses:
392
+ - MIT
392
393
  metadata: {}
393
394
  post_install_message:
394
395
  rdoc_options: []