garage-doorkeeper 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/CHANGELOG.md +3 -0
- data/Rakefile +32 -1
- data/garage-doorkeeper.gemspec +1 -1
- data/lib/garage/doorkeeper/version.rb +1 -1
- data/lib/garage/strategy/doorkeeper.rb +2 -3
- data/spec/dummy/config/database.yml +3 -3
- data/spec/dummy/db/migrate/20150520073214_add_scopes_to_oauth_applications.rb +5 -0
- data/spec/dummy/db/schema.rb +48 -47
- data/spec/requests/authorization_spec.rb +2 -2
- metadata +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19f54ae10f7f220604e51d3e228a995b7b4ac265
|
4
|
+
data.tar.gz: ed25e285cde80c307d61edf2a9d6e559adfeb6a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 851ee4aca564017d463d5f28c5e3798e18ef17862bd12cb5798565292f056db877b0aa11877291202621350d5606b36ffc26fd82902c698017e15e8e1088fba0
|
7
|
+
data.tar.gz: 35406645e5c791fd9a506c2c1322e04283211affe430140107a9a0012a7b3e85191b094b5b7fc299a4f291e680a4424c1c2d590334902d6f7b3e4108e4ee273f
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -1,2 +1,33 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
2
14
|
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'Garage'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
Bundler::GemHelper.install_tasks
|
27
|
+
|
28
|
+
begin
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec)
|
31
|
+
task :default => :spec
|
32
|
+
rescue LoadError
|
33
|
+
end
|
data/garage-doorkeeper.gemspec
CHANGED
@@ -6,14 +6,13 @@ module Garage
|
|
6
6
|
|
7
7
|
# Garage::ControllerHelper already implements `doorkeeper_token`,
|
8
8
|
# so monkey patch here.
|
9
|
-
::Doorkeeper::Helpers
|
9
|
+
::Doorkeeper::Rails::Helpers.class_eval do
|
10
10
|
alias_method :original_doorkeeper_token, :doorkeeper_token
|
11
11
|
end
|
12
12
|
|
13
13
|
included do
|
14
|
-
|
14
|
+
before_action :doorkeeper_authorize!
|
15
15
|
alias_method :doorkeeper_unauthorized_render_options, :unauthorized_render_options
|
16
|
-
doorkeeper_for :all
|
17
16
|
end
|
18
17
|
|
19
18
|
def verify_permission?
|
@@ -11,7 +11,7 @@
|
|
11
11
|
development:
|
12
12
|
adapter: mysql2
|
13
13
|
encoding: utf8
|
14
|
-
database:
|
14
|
+
database: garage_doorkeeper_dummy_development
|
15
15
|
pool: 5
|
16
16
|
username: root
|
17
17
|
password:
|
@@ -23,7 +23,7 @@ development:
|
|
23
23
|
test:
|
24
24
|
adapter: mysql2
|
25
25
|
encoding: utf8
|
26
|
-
database:
|
26
|
+
database: garage_doorkeeper_dummy_test
|
27
27
|
pool: 5
|
28
28
|
username: root
|
29
29
|
password:
|
@@ -32,7 +32,7 @@ test:
|
|
32
32
|
production:
|
33
33
|
adapter: mysql2
|
34
34
|
encoding: utf8
|
35
|
-
database:
|
35
|
+
database: garage_doorkeeper_dummy_production
|
36
36
|
pool: 5
|
37
37
|
username: root
|
38
38
|
password:
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -9,70 +9,71 @@
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
11
|
#
|
12
|
-
# It's strongly recommended
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:
|
14
|
+
ActiveRecord::Schema.define(version: 20141209001746) do
|
15
15
|
|
16
|
-
create_table "comments", :
|
17
|
-
t.integer "user_id"
|
18
|
-
t.integer "post_id"
|
19
|
-
t.string "body"
|
20
|
-
t.datetime "created_at"
|
21
|
-
t.datetime "updated_at"
|
16
|
+
create_table "comments", force: :cascade do |t|
|
17
|
+
t.integer "user_id", limit: 4
|
18
|
+
t.integer "post_id", limit: 4
|
19
|
+
t.string "body", limit: 255
|
20
|
+
t.datetime "created_at"
|
21
|
+
t.datetime "updated_at"
|
22
22
|
end
|
23
23
|
|
24
|
-
create_table "oauth_access_grants", :
|
25
|
-
t.integer "resource_owner_id", :null
|
26
|
-
t.integer "application_id", :null
|
27
|
-
t.string "token", :null
|
28
|
-
t.integer "expires_in", :null
|
29
|
-
t.string "redirect_uri", :null
|
30
|
-
t.datetime "created_at",
|
24
|
+
create_table "oauth_access_grants", force: :cascade do |t|
|
25
|
+
t.integer "resource_owner_id", limit: 4, null: false
|
26
|
+
t.integer "application_id", limit: 4, null: false
|
27
|
+
t.string "token", limit: 255, null: false
|
28
|
+
t.integer "expires_in", limit: 4, null: false
|
29
|
+
t.string "redirect_uri", limit: 255, null: false
|
30
|
+
t.datetime "created_at", null: false
|
31
31
|
t.datetime "revoked_at"
|
32
|
-
t.string "scopes"
|
32
|
+
t.string "scopes", limit: 255
|
33
33
|
end
|
34
34
|
|
35
|
-
add_index "oauth_access_grants", ["token"], :
|
35
|
+
add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true, using: :btree
|
36
36
|
|
37
|
-
create_table "oauth_access_tokens", :
|
38
|
-
t.integer "resource_owner_id"
|
39
|
-
t.integer "application_id", :null
|
40
|
-
t.string "token", :null
|
41
|
-
t.string "refresh_token"
|
42
|
-
t.integer "expires_in"
|
37
|
+
create_table "oauth_access_tokens", force: :cascade do |t|
|
38
|
+
t.integer "resource_owner_id", limit: 4
|
39
|
+
t.integer "application_id", limit: 4, null: false
|
40
|
+
t.string "token", limit: 255, null: false
|
41
|
+
t.string "refresh_token", limit: 255
|
42
|
+
t.integer "expires_in", limit: 4
|
43
43
|
t.datetime "revoked_at"
|
44
|
-
t.datetime "created_at",
|
45
|
-
t.string "scopes"
|
44
|
+
t.datetime "created_at", null: false
|
45
|
+
t.string "scopes", limit: 255
|
46
46
|
end
|
47
47
|
|
48
|
-
add_index "oauth_access_tokens", ["refresh_token"], :
|
49
|
-
add_index "oauth_access_tokens", ["resource_owner_id"], :
|
50
|
-
add_index "oauth_access_tokens", ["token"], :
|
48
|
+
add_index "oauth_access_tokens", ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true, using: :btree
|
49
|
+
add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id", using: :btree
|
50
|
+
add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true, using: :btree
|
51
51
|
|
52
|
-
create_table "oauth_applications", :
|
53
|
-
t.string "name", :null
|
54
|
-
t.string "uid", :null
|
55
|
-
t.string "secret", :null
|
56
|
-
t.string "redirect_uri", :null
|
57
|
-
t.datetime "created_at"
|
58
|
-
t.datetime "updated_at"
|
52
|
+
create_table "oauth_applications", force: :cascade do |t|
|
53
|
+
t.string "name", limit: 255, null: false
|
54
|
+
t.string "uid", limit: 255, null: false
|
55
|
+
t.string "secret", limit: 255, null: false
|
56
|
+
t.string "redirect_uri", limit: 255, null: false
|
57
|
+
t.datetime "created_at"
|
58
|
+
t.datetime "updated_at"
|
59
|
+
t.string "scopes", limit: 255, default: "", null: false
|
59
60
|
end
|
60
61
|
|
61
|
-
add_index "oauth_applications", ["uid"], :
|
62
|
+
add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
|
62
63
|
|
63
|
-
create_table "posts", :
|
64
|
-
t.integer "user_id"
|
65
|
-
t.string "title"
|
66
|
-
t.string "body"
|
67
|
-
t.datetime "created_at"
|
68
|
-
t.datetime "updated_at"
|
64
|
+
create_table "posts", force: :cascade do |t|
|
65
|
+
t.integer "user_id", limit: 4
|
66
|
+
t.string "title", limit: 255
|
67
|
+
t.string "body", limit: 255
|
68
|
+
t.datetime "created_at"
|
69
|
+
t.datetime "updated_at"
|
69
70
|
end
|
70
71
|
|
71
|
-
create_table "users", :
|
72
|
-
t.string "name"
|
73
|
-
t.string "email"
|
74
|
-
t.datetime "created_at"
|
75
|
-
t.datetime "updated_at"
|
72
|
+
create_table "users", force: :cascade do |t|
|
73
|
+
t.string "name", limit: 255
|
74
|
+
t.string "email", limit: 255
|
75
|
+
t.datetime "created_at"
|
76
|
+
t.datetime "updated_at"
|
76
77
|
end
|
77
78
|
|
78
79
|
end
|
@@ -57,7 +57,7 @@ describe "Authorization" do
|
|
57
57
|
|
58
58
|
context "with another valid scope" do
|
59
59
|
let(:scopes) do
|
60
|
-
"sudo"
|
60
|
+
"public sudo"
|
61
61
|
end
|
62
62
|
it { should == 200 }
|
63
63
|
end
|
@@ -146,7 +146,7 @@ describe "Authorization" do
|
|
146
146
|
|
147
147
|
describe "GET /posts/namespaced" do
|
148
148
|
let(:scopes) do
|
149
|
-
"foobar.read_post"
|
149
|
+
"public foobar.read_post"
|
150
150
|
end
|
151
151
|
|
152
152
|
context "with valid condition" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: garage-doorkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taiki Ono
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.5.0
|
19
|
+
version: 2.0.0
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.5.0
|
26
|
+
version: 2.0.0
|
33
27
|
description: Garage extension to integrate doorkeeper gem.
|
34
28
|
email:
|
35
29
|
- taiks.4559@gmail.com
|
@@ -38,6 +32,7 @@ extensions: []
|
|
38
32
|
extra_rdoc_files: []
|
39
33
|
files:
|
40
34
|
- ".gitignore"
|
35
|
+
- ".travis.yml"
|
41
36
|
- CHANGELOG.md
|
42
37
|
- Gemfile
|
43
38
|
- LICENSE.txt
|
@@ -96,6 +91,7 @@ files:
|
|
96
91
|
- spec/dummy/db/migrate/20130501215033_create_users.rb
|
97
92
|
- spec/dummy/db/migrate/20130501215056_create_posts.rb
|
98
93
|
- spec/dummy/db/migrate/20130508032709_create_comments.rb
|
94
|
+
- spec/dummy/db/migrate/20150520073214_add_scopes_to_oauth_applications.rb
|
99
95
|
- spec/dummy/db/schema.rb
|
100
96
|
- spec/dummy/doc/garage/overview.ja.md
|
101
97
|
- spec/dummy/doc/garage/overview.md
|
@@ -192,6 +188,7 @@ test_files:
|
|
192
188
|
- spec/dummy/db/migrate/20130501215033_create_users.rb
|
193
189
|
- spec/dummy/db/migrate/20130501215056_create_posts.rb
|
194
190
|
- spec/dummy/db/migrate/20130508032709_create_comments.rb
|
191
|
+
- spec/dummy/db/migrate/20150520073214_add_scopes_to_oauth_applications.rb
|
195
192
|
- spec/dummy/db/schema.rb
|
196
193
|
- spec/dummy/doc/garage/overview.ja.md
|
197
194
|
- spec/dummy/doc/garage/overview.md
|
@@ -214,4 +211,3 @@ test_files:
|
|
214
211
|
- spec/support/authenticated_context.rb
|
215
212
|
- spec/support/database_cleaner.rb
|
216
213
|
- spec/support/rest_api_spec_helper.rb
|
217
|
-
has_rdoc:
|