doorkeeper 3.1.0 → 4.0.0.rc1

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.

Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -8
  3. data/Gemfile +8 -4
  4. data/NEWS.md +16 -0
  5. data/README.md +21 -5
  6. data/app/controllers/doorkeeper/application_metal_controller.rb +0 -1
  7. data/app/controllers/doorkeeper/applications_controller.rb +2 -2
  8. data/app/controllers/doorkeeper/authorizations_controller.rb +1 -1
  9. data/app/controllers/doorkeeper/authorized_applications_controller.rb +1 -1
  10. data/doorkeeper.gemspec +3 -3
  11. data/lib/doorkeeper/models/access_token_mixin.rb +9 -3
  12. data/lib/doorkeeper/oauth/authorization_code_request.rb +1 -1
  13. data/lib/doorkeeper/oauth/code_response.rb +1 -1
  14. data/lib/doorkeeper/oauth/password_access_token_request.rb +1 -1
  15. data/lib/doorkeeper/version.rb +1 -1
  16. data/lib/generators/doorkeeper/templates/migration.rb +12 -2
  17. data/spec/controllers/authorizations_controller_spec.rb +0 -14
  18. data/spec/controllers/protected_resources_controller_spec.rb +2 -2
  19. data/spec/dummy/app/controllers/full_protected_resources_controller.rb +2 -2
  20. data/spec/dummy/app/controllers/metal_controller.rb +1 -1
  21. data/spec/dummy/app/controllers/semi_protected_resources_controller.rb +1 -1
  22. data/spec/dummy/db/migrate/{20130902165751_create_doorkeeper_tables.rb → 20151223192035_create_doorkeeper_tables.rb} +23 -4
  23. data/spec/dummy/db/migrate/{20130902175349_add_owner_to_application.rb → 20151223200000_add_owner_to_application.rb} +0 -0
  24. data/spec/dummy/db/schema.rb +20 -20
  25. data/spec/lib/oauth/authorization_code_request_spec.rb +1 -1
  26. data/spec/lib/oauth/code_response_spec.rb +34 -0
  27. data/spec/lib/oauth/password_access_token_request_spec.rb +1 -1
  28. metadata +20 -20
  29. data/spec/dummy/db/migrate/20141209001746_add_scopes_to_oauth_applications.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03417189314de7b84fcfa05699c35a0346a55035
4
- data.tar.gz: e4026de8e9ed39d2bb270abc9efc4e1ccca20775
3
+ metadata.gz: b1938eaf21efdea722af36789d561f304efeff2b
4
+ data.tar.gz: fe6f991a4629c210d625f525908d5f404add55b9
5
5
  SHA512:
6
- metadata.gz: bbe0a1693809bfc8802a66c50df30a128a527a3f239114ffdc69d46e948ac0516594fe3872f3624157632e91078a0ad64aa1f98932b26bdf389228b22bed246b
7
- data.tar.gz: 6d434e7dc34b65d1022914f8fd348c9d1c8e6ef41bb30761411eb0c693531ccb12c87c237c1e54fbcbee11a8dd0bf68c82768a6801f273dab2bcaf1fe96afea6
6
+ metadata.gz: 5f61954327e10dffc33b76e8bffed89df45f8bf54bbf127ca0ccac328a63749f09853b40647ff2d848190434a102d2eeac3a582d2056f4ed99f05084d78a8402
7
+ data.tar.gz: 9204913127b42e8f7fc8dcc9c351145ad5fb9e04ec2b9e07398eeec96631cef127fcbbd4102fdb4b90f73fc76a3337df57f5f4ce5f110ef3b0dd00e89c0d5bd7
@@ -3,20 +3,17 @@ language: ruby
3
3
  sudo: false
4
4
 
5
5
  rvm:
6
- - 2.0
7
6
  - 2.1
8
- - 2.2
7
+ - 2.2.2
9
8
  - jruby-head
10
9
 
11
10
  env:
12
- - rails=3.2.0
13
- - rails=4.1.0
14
11
  - rails=4.2.0
12
+ - rails=5.0.0.beta1
15
13
 
16
14
  matrix:
17
15
  exclude:
18
- - env: rails=3.2.0
16
+ - env: rails=5.0.0.beta1
17
+ rvm: 2.1
18
+ - env: rails=5.0.0.beta1
19
19
  rvm: jruby-head
20
- exclude:
21
- - env: rails=3.2.0
22
- rvm: 2.2
data/Gemfile CHANGED
@@ -1,10 +1,14 @@
1
- ENV['rails'] ||= '4.2.0'
1
+ ENV["rails"] ||= "4.2.0"
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
- gem 'rails', "~> #{ENV['rails']}"
5
+ gem "rails", "~> #{ENV["rails"]}"
6
+
7
+ if ENV["rails"] == "5.0.0.beta1"
8
+ gem "capybara", github: "jnicklas/capybara"
9
+ end
6
10
 
7
- gem "sqlite3", platform: [:ruby, :mswin, :mingw]
8
11
  gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
12
+ gem "sqlite3", platform: [:ruby, :mswin, :mingw]
9
13
 
10
14
  gemspec
data/NEWS.md CHANGED
@@ -4,6 +4,22 @@ User-visible changes worth mentioning.
4
4
 
5
5
  ---
6
6
 
7
+ ## 4.0.0.rc1
8
+
9
+ ### Backward incompatible changes
10
+
11
+ - Drops support for Rails 4.1 and earlier
12
+ - Drops support for Ruby 2.0
13
+ - [#778] Bug fix: use the remaining time that a token is still valid when
14
+ building the redirect URI for the implicit grant flow
15
+
16
+ ### Other changes
17
+
18
+ - [#771] Validation error messages fixes
19
+ - Adds foreign key constraints in generated migrations between tokens and
20
+ grants, and applications
21
+ - Support Rails 5
22
+
7
23
  ## 3.1.0
8
24
 
9
25
  - [#736] Existing valid tokens are now reused in client_credentials flow
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Doorkeeper - awesome oauth provider for your Rails app.
2
2
 
3
3
  [![Build Status](https://travis-ci.org/doorkeeper-gem/doorkeeper.svg?branch=master)](https://travis-ci.org/doorkeeper-gem/doorkeeper)
4
- [![Dependency Status](https://gemnasium.com/applicake/doorkeeper.svg?travis)](https://gemnasium.com/applicake/doorkeeper)
5
- [![Code Climate](https://codeclimate.com/github/applicake/doorkeeper.svg)](https://codeclimate.com/github/applicake/doorkeeper)
4
+ [![Dependency Status](https://gemnasium.com/doorkeeper-gem/doorkeeper.svg?travis)](https://gemnasium.com/doorkeeper-gem/doorkeeper)
5
+ [![Code Climate](https://codeclimate.com/github/doorkeeper-gem/doorkeeper.svg)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper)
6
6
  [![Gem Version](https://badge.fury.io/rb/doorkeeper.svg)](https://rubygems.org/gems/doorkeeper)
7
7
 
8
8
  Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider
@@ -77,9 +77,25 @@ to generate the migration tables:
77
77
 
78
78
  rails generate doorkeeper:migration
79
79
 
80
- Don't forget to run the migration with:
80
+ You may want to add foreign keys to your migration. For example, if you plan on
81
+ using making `User` the resource owner, change the two lines in the migration
82
+ file:
81
83
 
82
- rake db:migrate
84
+ ```ruby
85
+ t.integer :resource_owner_id, null: false
86
+ ```
87
+
88
+ to:
89
+
90
+ ```ruby
91
+ t.references :user, foreign_key: true, null: false
92
+ ```
93
+
94
+ Then run migrations:
95
+
96
+ ```sh
97
+ rake db:migrate
98
+ ```
83
99
 
84
100
  ### Other ORMs
85
101
 
@@ -119,7 +135,7 @@ wiki](https://github.com/doorkeeper-gem/doorkeeper/wiki/Customizing-routes).
119
135
  ### Authenticating
120
136
 
121
137
  You need to configure Doorkeeper in order to provide `resource_owner` model
122
- and authentication block `initializers/doorkeeper.rb`
138
+ and authentication block in `config/initializers/doorkeeper.rb`:
123
139
 
124
140
  ``` ruby
125
141
  Doorkeeper.configure do
@@ -1,7 +1,6 @@
1
1
  module Doorkeeper
2
2
  class ApplicationMetalController < ActionController::Metal
3
3
  MODULES = [
4
- ActionController::RackDelegation,
5
4
  ActionController::Instrumentation,
6
5
  AbstractController::Rendering,
7
6
  ActionController::Rendering,
@@ -2,8 +2,8 @@ module Doorkeeper
2
2
  class ApplicationsController < Doorkeeper::ApplicationController
3
3
  layout 'doorkeeper/admin'
4
4
 
5
- before_filter :authenticate_admin!
6
- before_filter :set_application, only: [:show, :edit, :update, :destroy]
5
+ before_action :authenticate_admin!
6
+ before_action :set_application, only: [:show, :edit, :update, :destroy]
7
7
 
8
8
  def index
9
9
  @applications = Application.all
@@ -1,6 +1,6 @@
1
1
  module Doorkeeper
2
2
  class AuthorizationsController < Doorkeeper::ApplicationController
3
- before_filter :authenticate_resource_owner!
3
+ before_action :authenticate_resource_owner!
4
4
 
5
5
  def new
6
6
  if pre_auth.authorizable?
@@ -1,6 +1,6 @@
1
1
  module Doorkeeper
2
2
  class AuthorizedApplicationsController < Doorkeeper::ApplicationController
3
- before_filter :authenticate_resource_owner!
3
+ before_action :authenticate_resource_owner!
4
4
 
5
5
  def index
6
6
  @applications = Application.authorized_for(current_resource_owner)
@@ -16,10 +16,10 @@ Gem::Specification.new do |s|
16
16
  s.test_files = `git ls-files -- spec/*`.split("\n")
17
17
  s.require_paths = ["lib"]
18
18
 
19
- s.add_dependency "railties", ">= 3.2"
19
+ s.add_dependency "railties", ">= 4.2"
20
20
 
21
- s.add_development_dependency "rspec-rails", "~> 3.4.0"
22
- s.add_development_dependency "capybara", "~> 2.3.0"
21
+ s.add_development_dependency "rspec-rails"
22
+ s.add_development_dependency "capybara"
23
23
  s.add_development_dependency "generator_spec", "~> 0.9.0"
24
24
  s.add_development_dependency "factory_girl", "~> 4.5.0"
25
25
  s.add_development_dependency "timecop", "~> 0.7.0"
@@ -10,9 +10,15 @@ module Doorkeeper
10
10
  include ActiveModel::MassAssignmentSecurity if defined?(::ProtectedAttributes)
11
11
 
12
12
  included do
13
- belongs_to :application,
14
- class_name: 'Doorkeeper::Application',
15
- inverse_of: :access_tokens
13
+ belongs_to_options = {
14
+ class_name: 'Doorkeeper::Application',
15
+ inverse_of: :access_tokens
16
+ }
17
+ if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5
18
+ belongs_to_options.merge(optional: true)
19
+ end
20
+
21
+ belongs_to :application, belongs_to_options
16
22
 
17
23
  validates :token, presence: true, uniqueness: true
18
24
  validates :refresh_token, uniqueness: true, if: :use_refresh_token?
@@ -7,7 +7,7 @@ module Doorkeeper
7
7
  validate :attributes, error: :invalid_request
8
8
  validate :client, error: :invalid_client
9
9
  validate :grant, error: :invalid_grant
10
- validate :redirect_uri, error: :invalid_grant
10
+ validate :redirect_uri, error: :invalid_redirect_uri
11
11
 
12
12
  attr_accessor :server, :grant, :client, :redirect_uri, :access_token
13
13
 
@@ -24,7 +24,7 @@ module Doorkeeper
24
24
  pre_auth.redirect_uri,
25
25
  access_token: auth.token.token,
26
26
  token_type: auth.token.token_type,
27
- expires_in: auth.token.expires_in,
27
+ expires_in: auth.token.expires_in_seconds,
28
28
  state: pre_auth.state
29
29
  )
30
30
  else
@@ -6,7 +6,7 @@ module Doorkeeper
6
6
  include OAuth::Helpers
7
7
 
8
8
  validate :client, error: :invalid_client
9
- validate :resource_owner, error: :invalid_grant
9
+ validate :resource_owner, error: :invalid_resource_owner
10
10
  validate :scopes, error: :invalid_scope
11
11
 
12
12
  attr_accessor :server, :resource_owner, :credentials, :access_token
@@ -1,3 +1,3 @@
1
1
  module Doorkeeper
2
- VERSION = "3.1.0"
2
+ VERSION = "4.0.0.rc1"
3
3
  end
@@ -13,7 +13,7 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
13
13
 
14
14
  create_table :oauth_access_grants do |t|
15
15
  t.integer :resource_owner_id, null: false
16
- t.integer :application_id, null: false
16
+ t.references :application, null: false
17
17
  t.string :token, null: false
18
18
  t.integer :expires_in, null: false
19
19
  t.text :redirect_uri, null: false
@@ -23,10 +23,15 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
23
23
  end
24
24
 
25
25
  add_index :oauth_access_grants, :token, unique: true
26
+ add_foreign_key(
27
+ :oauth_access_grants,
28
+ :oauth_applications,
29
+ column: :application_id,
30
+ )
26
31
 
27
32
  create_table :oauth_access_tokens do |t|
28
33
  t.integer :resource_owner_id
29
- t.integer :application_id
34
+ t.references :application, null: false
30
35
 
31
36
  # If you use a custom token generator you may need to change this column
32
37
  # from string to text, so that it accepts tokens larger than 255
@@ -46,5 +51,10 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
46
51
  add_index :oauth_access_tokens, :token, unique: true
47
52
  add_index :oauth_access_tokens, :resource_owner_id
48
53
  add_index :oauth_access_tokens, :refresh_token, unique: true
54
+ add_foreign_key(
55
+ :oauth_access_tokens,
56
+ :oauth_applications,
57
+ column: :application_id,
58
+ )
49
59
  end
50
60
  end
@@ -89,16 +89,6 @@ describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
89
89
  it 'returns the existing access token in a fragment'
90
90
  end
91
91
 
92
- describe 'GET #new' do
93
- before do
94
- get :new, client_id: client.uid, response_type: 'token', redirect_uri: client.redirect_uri
95
- end
96
-
97
- it 'renders new template' do
98
- expect(response).to render_template(:new)
99
- end
100
- end
101
-
102
92
  describe 'GET #new token request with native url and skip_authorization true' do
103
93
  before do
104
94
  allow(Doorkeeper.configuration).to receive(:skip_authorization).and_return(proc do
@@ -191,10 +181,6 @@ describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
191
181
  expect(response).to_not be_redirect
192
182
  end
193
183
 
194
- it 'renders error template' do
195
- expect(response).to render_template(:error)
196
- end
197
-
198
184
  it 'does not issue any token' do
199
185
  expect(Doorkeeper::AccessGrant.count).to eq 0
200
186
  expect(Doorkeeper::AccessToken.count).to eq 0
@@ -13,7 +13,7 @@ end
13
13
  describe 'doorkeeper authorize filter' do
14
14
  context 'accepts token code specified as' do
15
15
  controller do
16
- before_filter :doorkeeper_authorize!
16
+ before_action :doorkeeper_authorize!
17
17
 
18
18
  def index
19
19
  render text: 'index'
@@ -58,7 +58,7 @@ describe 'doorkeeper authorize filter' do
58
58
 
59
59
  context 'defined for all actions' do
60
60
  controller do
61
- before_filter :doorkeeper_authorize!
61
+ before_action :doorkeeper_authorize!
62
62
 
63
63
  include ControllerActions
64
64
  end
@@ -1,6 +1,6 @@
1
1
  class FullProtectedResourcesController < ApplicationController
2
- before_filter -> { doorkeeper_authorize! :write, :admin }, only: :show
3
- before_filter :doorkeeper_authorize!, only: :index
2
+ before_action -> { doorkeeper_authorize! :write, :admin }, only: :show
3
+ before_action :doorkeeper_authorize!, only: :index
4
4
 
5
5
  def index
6
6
  render text: 'index'
@@ -3,7 +3,7 @@ class MetalController < ActionController::Metal
3
3
  include ActionController::Head
4
4
  include Doorkeeper::Rails::Helpers
5
5
 
6
- before_filter :doorkeeper_authorize!
6
+ before_action :doorkeeper_authorize!
7
7
 
8
8
  def index
9
9
  self.response_body = { ok: true }.to_json
@@ -1,5 +1,5 @@
1
1
  class SemiProtectedResourcesController < ApplicationController
2
- before_filter :doorkeeper_authorize!, only: :index
2
+ before_action :doorkeeper_authorize!, only: :index
3
3
 
4
4
  def index
5
5
  render text: 'protected index'
@@ -4,7 +4,8 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
4
4
  t.string :name, null: false
5
5
  t.string :uid, null: false
6
6
  t.string :secret, null: false
7
- t.string :redirect_uri, null: false, limit: 2048
7
+ t.text :redirect_uri, null: false
8
+ t.string :scopes, null: false, default: ''
8
9
  t.timestamps
9
10
  end
10
11
 
@@ -12,21 +13,34 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
12
13
 
13
14
  create_table :oauth_access_grants do |t|
14
15
  t.integer :resource_owner_id, null: false
15
- t.integer :application_id, null: false
16
+ t.references :application, null: false
16
17
  t.string :token, null: false
17
18
  t.integer :expires_in, null: false
18
- t.string :redirect_uri, null: false, limit: 2048
19
+ t.text :redirect_uri, null: false
19
20
  t.datetime :created_at, null: false
20
21
  t.datetime :revoked_at
21
22
  t.string :scopes
22
23
  end
23
24
 
24
25
  add_index :oauth_access_grants, :token, unique: true
26
+ add_foreign_key(
27
+ :oauth_access_grants,
28
+ :oauth_applications,
29
+ column: :application_id,
30
+ )
25
31
 
26
32
  create_table :oauth_access_tokens do |t|
27
33
  t.integer :resource_owner_id
28
- t.integer :application_id
34
+ t.references :application
35
+
36
+ # If you use a custom token generator you may need to change this column
37
+ # from string to text, so that it accepts tokens larger than 255
38
+ # characters. More info on custom token generators in:
39
+ # https://github.com/doorkeeper-gem/doorkeeper/tree/v3.0.0.rc1#custom-access-token-generator
40
+ #
41
+ # t.text :token, null: false
29
42
  t.string :token, null: false
43
+
30
44
  t.string :refresh_token
31
45
  t.integer :expires_in
32
46
  t.datetime :revoked_at
@@ -37,5 +51,10 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
37
51
  add_index :oauth_access_tokens, :token, unique: true
38
52
  add_index :oauth_access_tokens, :resource_owner_id
39
53
  add_index :oauth_access_tokens, :refresh_token, unique: true
54
+ add_foreign_key(
55
+ :oauth_access_tokens,
56
+ :oauth_applications,
57
+ column: :application_id,
58
+ )
40
59
  end
41
60
  end
@@ -11,22 +11,22 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20141209001746) do
14
+ ActiveRecord::Schema.define(version: 20151223200000) do
15
15
 
16
- create_table "oauth_access_grants", force: true do |t|
17
- t.integer "resource_owner_id", null: false
18
- t.integer "application_id", null: false
19
- t.string "token", null: false
20
- t.integer "expires_in", null: false
21
- t.string "redirect_uri", limit: 2048, null: false
22
- t.datetime "created_at", null: false
16
+ create_table "oauth_access_grants", force: :cascade do |t|
17
+ t.integer "resource_owner_id", null: false
18
+ t.integer "application_id", null: false
19
+ t.string "token", null: false
20
+ t.integer "expires_in", null: false
21
+ t.text "redirect_uri", null: false
22
+ t.datetime "created_at", null: false
23
23
  t.datetime "revoked_at"
24
24
  t.string "scopes"
25
25
  end
26
26
 
27
27
  add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true
28
28
 
29
- create_table "oauth_access_tokens", force: true do |t|
29
+ create_table "oauth_access_tokens", force: :cascade do |t|
30
30
  t.integer "resource_owner_id"
31
31
  t.integer "application_id"
32
32
  t.string "token", null: false
@@ -41,25 +41,25 @@ ActiveRecord::Schema.define(version: 20141209001746) do
41
41
  add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id"
42
42
  add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true
43
43
 
44
- create_table "oauth_applications", force: true do |t|
45
- t.string "name", null: false
46
- t.string "uid", null: false
47
- t.string "secret", null: false
48
- t.string "redirect_uri", limit: 2048, null: false
49
- t.datetime "created_at", null: false
50
- t.datetime "updated_at", null: false
44
+ create_table "oauth_applications", force: :cascade do |t|
45
+ t.string "name", null: false
46
+ t.string "uid", null: false
47
+ t.string "secret", null: false
48
+ t.text "redirect_uri", null: false
49
+ t.string "scopes", default: "", null: false
50
+ t.datetime "created_at"
51
+ t.datetime "updated_at"
51
52
  t.integer "owner_id"
52
53
  t.string "owner_type"
53
- t.string "scopes", default: "", null: false
54
54
  end
55
55
 
56
56
  add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type"
57
57
  add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true
58
58
 
59
- create_table "users", force: true do |t|
59
+ create_table "users", force: :cascade do |t|
60
60
  t.string "name"
61
- t.datetime "created_at", null: false
62
- t.datetime "updated_at", null: false
61
+ t.datetime "created_at"
62
+ t.datetime "updated_at"
63
63
  t.string "password"
64
64
  end
65
65
 
@@ -59,7 +59,7 @@ module Doorkeeper::OAuth
59
59
  it "matches the redirect_uri with grant's one" do
60
60
  subject.redirect_uri = 'http://other.com'
61
61
  subject.validate
62
- expect(subject.error).to eq(:invalid_grant)
62
+ expect(subject.error).to eq(:invalid_redirect_uri)
63
63
  end
64
64
 
65
65
  it "matches the client with grant's one" do
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ module Doorkeeper
4
+ module OAuth
5
+ describe CodeResponse do
6
+ describe '.redirect_uri' do
7
+ context 'when generating the redirect URI for an implicit grant' do
8
+ let :pre_auth do
9
+ double(
10
+ :pre_auth,
11
+ client: double(:application, id: 1),
12
+ redirect_uri: 'http://tst.com/cb',
13
+ state: nil,
14
+ scopes: Scopes.from_string('public'),
15
+ )
16
+ end
17
+
18
+ let :auth do
19
+ Authorization::Token.new(pre_auth, double(id: 1)).tap do |c|
20
+ c.issue_token
21
+ allow(c.token).to receive(:expires_in_seconds).and_return(3600)
22
+ end
23
+ end
24
+
25
+ subject { CodeResponse.new(pre_auth, auth, response_on_fragment: true).redirect_uri }
26
+
27
+ it 'includes the remaining TTL of the token relative to the time the token was generated' do
28
+ expect(subject).to include('expires_in=3600')
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -44,7 +44,7 @@ module Doorkeeper::OAuth
44
44
  it 'requires the owner' do
45
45
  subject.resource_owner = nil
46
46
  subject.validate
47
- expect(subject.error).to eq(:invalid_grant)
47
+ expect(subject.error).to eq(:invalid_resource_owner)
48
48
  end
49
49
 
50
50
  it 'optionally accepts the client' do
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: 3.1.0
4
+ version: 4.0.0.rc1
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-12-23 00:00:00.000000000 Z
12
+ date: 2016-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -17,42 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '3.2'
20
+ version: '4.2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '3.2'
27
+ version: '4.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec-rails
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 3.4.0
34
+ version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 3.4.0
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: capybara
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 2.3.0
48
+ version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 2.3.0
55
+ version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: generator_spec
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -258,9 +258,8 @@ files:
258
258
  - spec/dummy/config/routes.rb
259
259
  - spec/dummy/db/migrate/20111122132257_create_users.rb
260
260
  - spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
261
- - spec/dummy/db/migrate/20130902165751_create_doorkeeper_tables.rb
262
- - spec/dummy/db/migrate/20130902175349_add_owner_to_application.rb
263
- - spec/dummy/db/migrate/20141209001746_add_scopes_to_oauth_applications.rb
261
+ - spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
262
+ - spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
264
263
  - spec/dummy/db/schema.rb
265
264
  - spec/dummy/public/404.html
266
265
  - spec/dummy/public/422.html
@@ -290,6 +289,7 @@ files:
290
289
  - spec/lib/oauth/client_credentials_request_spec.rb
291
290
  - spec/lib/oauth/client_spec.rb
292
291
  - spec/lib/oauth/code_request_spec.rb
292
+ - spec/lib/oauth/code_response_spec.rb
293
293
  - spec/lib/oauth/error_response_spec.rb
294
294
  - spec/lib/oauth/error_spec.rb
295
295
  - spec/lib/oauth/forbidden_token_response_spec.rb
@@ -356,9 +356,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
356
356
  version: '0'
357
357
  required_rubygems_version: !ruby/object:Gem::Requirement
358
358
  requirements:
359
- - - ">="
359
+ - - ">"
360
360
  - !ruby/object:Gem::Version
361
- version: '0'
361
+ version: 1.3.1
362
362
  requirements: []
363
363
  rubyforge_project:
364
364
  rubygems_version: 2.5.1
@@ -399,9 +399,8 @@ test_files:
399
399
  - spec/dummy/config/routes.rb
400
400
  - spec/dummy/db/migrate/20111122132257_create_users.rb
401
401
  - spec/dummy/db/migrate/20120312140401_add_password_to_users.rb
402
- - spec/dummy/db/migrate/20130902165751_create_doorkeeper_tables.rb
403
- - spec/dummy/db/migrate/20130902175349_add_owner_to_application.rb
404
- - spec/dummy/db/migrate/20141209001746_add_scopes_to_oauth_applications.rb
402
+ - spec/dummy/db/migrate/20151223192035_create_doorkeeper_tables.rb
403
+ - spec/dummy/db/migrate/20151223200000_add_owner_to_application.rb
405
404
  - spec/dummy/db/schema.rb
406
405
  - spec/dummy/public/404.html
407
406
  - spec/dummy/public/422.html
@@ -431,6 +430,7 @@ test_files:
431
430
  - spec/lib/oauth/client_credentials_request_spec.rb
432
431
  - spec/lib/oauth/client_spec.rb
433
432
  - spec/lib/oauth/code_request_spec.rb
433
+ - spec/lib/oauth/code_response_spec.rb
434
434
  - spec/lib/oauth/error_response_spec.rb
435
435
  - spec/lib/oauth/error_spec.rb
436
436
  - spec/lib/oauth/forbidden_token_response_spec.rb
@@ -1,5 +0,0 @@
1
- class AddScopesToOauthApplications < ActiveRecord::Migration
2
- def change
3
- add_column :oauth_applications, :scopes, :string, null: false, default: ''
4
- end
5
- end