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 +4 -4
- data/.travis.yml +0 -5
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/app/controllers/doorkeeper/applications_controller.rb +3 -3
- data/doorkeeper.gemspec +1 -0
- data/lib/doorkeeper/models/access_grant.rb +4 -0
- data/lib/doorkeeper/models/access_token.rb +3 -0
- data/lib/doorkeeper/models/application.rb +4 -0
- data/lib/doorkeeper/version.rb +1 -1
- data/spec/controllers/applications_controller_spec.rb +33 -1
- data/spec/dummy/app/models/user.rb +4 -0
- data/spec/dummy/config/application.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ea51224993fe17eb8bce055c441a2b583a6d9b7
|
4
|
+
data.tar.gz: 366ca2f1d49a33433714f470c5c66dd5b0c84c9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76fdba565bfa0a6b3382fb98a4cf5402794ab8b474ffe3324159b8ae7c1feee0f97e330d22e698fadeb7dc9551b6e56d5520cbc3949fa6ffd47b72fd1aaefd7e
|
7
|
+
data.tar.gz: 22f95b1680a08285831218530b4d8789c64c2e3170d6963d5f1c15f4118a05724ca9e8c4a7c50acce0c918f022f57b2e5bd77c101c6b3f97da818e668579766a
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -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
|
data/lib/doorkeeper/version.rb
CHANGED
@@ -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
|
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
|
@@ -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.
|
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-
|
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: []
|