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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e86f10c7895c4ede58f8145ca968a8be565410c
4
- data.tar.gz: b097ce253e5ef97b5f514cd279254ac451bffacf
3
+ metadata.gz: 19f54ae10f7f220604e51d3e228a995b7b4ac265
4
+ data.tar.gz: ed25e285cde80c307d61edf2a9d6e559adfeb6a3
5
5
  SHA512:
6
- metadata.gz: 786be0ce8b40cd602239f949c55627d43ddb2db4ee13fefe257508f32f625d2ccbffa54150c7fb7e68619f2d50dce3d173ee4b673c2a3186f409d1d6371421ab
7
- data.tar.gz: 54f298f72f4d05b7b38774813cdacffd923c04a46c63c2efbeebd34d8eb426195940351b52b3ced03fac7ceb330dc64d58931492086136fdcc83d5652c110f6a
6
+ metadata.gz: 851ee4aca564017d463d5f28c5e3798e18ef17862bd12cb5798565292f056db877b0aa11877291202621350d5606b36ffc26fd82902c698017e15e8e1088fba0
7
+ data.tar.gz: 35406645e5c791fd9a506c2c1322e04283211affe430140107a9a0012a7b3e85191b094b5b7fc299a4f291e680a4424c1c2d590334902d6f7b3e4108e4ee273f
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ sudo: false
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1
6
+ - 2.2
7
+ before_script:
8
+ - RAILS_ENV=test bundle exec rake db:create db:migrate
@@ -1,2 +1,5 @@
1
+ ## 2.0.0
2
+ - Doorkeeper v2 compatible release.
3
+
1
4
  ## 1.0.0
2
5
  - Doorkeeper v1 compatible release.
data/Rakefile CHANGED
@@ -1,2 +1,33 @@
1
- require "bundler/gem_tasks"
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
@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "doorkeeper", ">= 0.6.7", "< 1.5.0"
21
+ spec.add_dependency "doorkeeper", ">= 2.0.0"
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Garage
2
2
  module Doorkeeper
3
- VERSION = "1.0.0"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
@@ -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::Filter.class_eval do
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
- include ::Doorkeeper::Helpers::Filter
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: garage_dummy_development
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: garage_dummy_test
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: garage_dummy_production
35
+ database: garage_doorkeeper_dummy_production
36
36
  pool: 5
37
37
  username: root
38
38
  password:
@@ -0,0 +1,5 @@
1
+ class AddScopesToOauthApplications < ActiveRecord::Migration
2
+ def change
3
+ add_column :oauth_applications, :scopes, :string, null: false, default: ''
4
+ end
5
+ end
@@ -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 to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130508032709) do
14
+ ActiveRecord::Schema.define(version: 20141209001746) do
15
15
 
16
- create_table "comments", :force => true do |t|
17
- t.integer "user_id"
18
- t.integer "post_id"
19
- t.string "body"
20
- t.datetime "created_at", :null => false
21
- t.datetime "updated_at", :null => false
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", :force => true do |t|
25
- t.integer "resource_owner_id", :null => false
26
- t.integer "application_id", :null => false
27
- t.string "token", :null => false
28
- t.integer "expires_in", :null => false
29
- t.string "redirect_uri", :null => false
30
- t.datetime "created_at", :null => false
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"], :name => "index_oauth_access_grants_on_token", :unique => true
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", :force => true do |t|
38
- t.integer "resource_owner_id"
39
- t.integer "application_id", :null => false
40
- t.string "token", :null => false
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", :null => false
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"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true
49
- add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id"
50
- add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true
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", :force => true do |t|
53
- t.string "name", :null => false
54
- t.string "uid", :null => false
55
- t.string "secret", :null => false
56
- t.string "redirect_uri", :null => false
57
- t.datetime "created_at", :null => false
58
- t.datetime "updated_at", :null => false
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"], :name => "index_oauth_applications_on_uid", :unique => true
62
+ add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
62
63
 
63
- create_table "posts", :force => true do |t|
64
- t.integer "user_id"
65
- t.string "title"
66
- t.string "body"
67
- t.datetime "created_at", :null => false
68
- t.datetime "updated_at", :null => false
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", :force => true do |t|
72
- t.string "name"
73
- t.string "email"
74
- t.datetime "created_at", :null => false
75
- t.datetime "updated_at", :null => false
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: 1.0.0
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.6.7
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.6.7
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: