doorkeeper 2.1.4 → 2.2.0
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/CHANGELOG.md +1 -430
- data/Gemfile +1 -8
- data/NEWS.md +449 -0
- data/README.md +46 -3
- data/doorkeeper.gemspec +1 -1
- data/gemfiles/Gemfile.common.rb +0 -7
- data/gemfiles/Gemfile.mongo_mapper.rb +2 -2
- data/gemfiles/Gemfile.mongoid2.rb +1 -1
- data/gemfiles/Gemfile.mongoid4.rb +0 -1
- data/lib/doorkeeper/config.rb +7 -0
- data/lib/doorkeeper/engine.rb +4 -0
- data/lib/doorkeeper/errors.rb +6 -0
- data/lib/doorkeeper/models/access_token_mixin.rb +6 -1
- data/lib/doorkeeper/rails/helpers.rb +1 -1
- data/lib/doorkeeper/version.rb +1 -1
- data/lib/generators/doorkeeper/templates/initializer.rb +4 -0
- data/spec/controllers/applications_controller_spec.rb +0 -1
- data/spec/controllers/token_info_controller_spec.rb +0 -4
- data/spec/controllers/tokens_controller_spec.rb +4 -3
- data/spec/dummy/config/application.rb +2 -0
- data/spec/lib/config_spec.rb +18 -2
- data/spec/lib/oauth/authorization_code_request_spec.rb +1 -1
- data/spec/lib/oauth/client/credentials_spec.rb +2 -2
- data/spec/lib/oauth/password_access_token_request_spec.rb +1 -1
- data/spec/lib/oauth/pre_authorization_spec.rb +9 -10
- data/spec/lib/oauth/refresh_token_request_spec.rb +0 -1
- data/spec/lib/oauth/token_request_spec.rb +3 -3
- data/spec/lib/server_spec.rb +3 -1
- data/spec/models/doorkeeper/access_token_spec.rb +48 -0
- data/spec/requests/applications/applications_request_spec.rb +1 -1
- data/spec/requests/endpoints/authorization_spec.rb +2 -1
- data/spec/requests/endpoints/token_spec.rb +9 -9
- data/spec/requests/flows/authorization_code_errors_spec.rb +4 -4
- data/spec/requests/flows/authorization_code_spec.rb +10 -2
- data/spec/requests/flows/implicit_grant_spec.rb +14 -5
- data/spec/requests/flows/password_spec.rb +14 -20
- data/spec/requests/flows/refresh_token_spec.rb +7 -7
- data/spec/requests/flows/revoke_token_spec.rb +9 -31
- data/spec/requests/protected_resources/metal_spec.rb +3 -3
- data/spec/requests/protected_resources/private_api_spec.rb +11 -0
- data/spec/routing/custom_controller_routes_spec.rb +1 -2
- data/spec/routing/default_routes_spec.rb +1 -2
- data/spec/routing/scoped_routes_spec.rb +0 -1
- data/spec/spec_helper_integration.rb +3 -1
- data/spec/support/helpers/access_token_request_helper.rb +1 -1
- data/spec/support/helpers/authorization_request_helper.rb +1 -1
- data/spec/support/helpers/config_helper.rb +1 -1
- data/spec/support/helpers/model_helper.rb +1 -1
- data/spec/support/helpers/request_spec_helper.rb +1 -1
- data/spec/support/helpers/url_helper.rb +1 -1
- metadata +5 -4
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'spec_helper_integration'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
describe 'ActionController::Metal API' do
|
4
|
+
before do
|
5
5
|
@client = FactoryGirl.create(:application)
|
6
6
|
@resource = User.create!(name: 'Joe', password: 'sekret')
|
7
7
|
@token = client_is_authorized(@client, @resource)
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
it 'client requests protected resource with valid token' do
|
11
11
|
get "/metal.json?access_token=#{@token.token}"
|
12
12
|
should_have_json 'ok', true
|
13
13
|
end
|
@@ -40,6 +40,17 @@ feature 'Private API' do
|
|
40
40
|
expect(page.body).to have_content('index')
|
41
41
|
end
|
42
42
|
|
43
|
+
scenario 'access token with no default scopes' do
|
44
|
+
Doorkeeper.configuration.instance_eval {
|
45
|
+
@default_scopes = Doorkeeper::OAuth::Scopes.from_array([:public])
|
46
|
+
@scopes = default_scopes + optional_scopes
|
47
|
+
}
|
48
|
+
@token.update_attribute :scopes, 'dummy'
|
49
|
+
with_access_token_header @token.token
|
50
|
+
visit '/full_protected_resources'
|
51
|
+
response_status_should_be 403
|
52
|
+
end
|
53
|
+
|
43
54
|
scenario 'access token with no allowed scopes' do
|
44
55
|
@token.update_attribute :scopes, nil
|
45
56
|
with_access_token_header @token.token
|
@@ -42,7 +42,7 @@ describe 'Custom controller for routes' do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'POST /space/oauth/revoke routes to tokens controller' do
|
45
|
-
post('/space/oauth/revoke').
|
45
|
+
expect(post('/space/oauth/revoke')).to route_to('custom_authorizations#revoke')
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'GET /space/oauth/applications routes to applications controller' do
|
@@ -68,5 +68,4 @@ describe 'Custom controller for routes' do
|
|
68
68
|
it 'GET /outer_space/oauth/token_info is not routable' do
|
69
69
|
expect(get('/outer_space/oauth/token/info')).not_to be_routable
|
70
70
|
end
|
71
|
-
|
72
71
|
end
|
@@ -18,7 +18,7 @@ describe 'Default routes' do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'POST /oauth/revoke routes to tokens controller' do
|
21
|
-
post('/oauth/revoke').
|
21
|
+
expect(post('/oauth/revoke')).to route_to('doorkeeper/tokens#revoke')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'GET /oauth/applications routes to applications controller' do
|
@@ -32,5 +32,4 @@ describe 'Default routes' do
|
|
32
32
|
it 'GET /oauth/token/info route to authorzed tokeninfo controller' do
|
33
33
|
expect(get('/oauth/token/info')).to route_to('doorkeeper/token_info#show')
|
34
34
|
end
|
35
|
-
|
36
35
|
end
|
@@ -11,10 +11,10 @@ require 'capybara/rspec'
|
|
11
11
|
require 'rspec/active_model/mocks'
|
12
12
|
require 'dummy/config/environment'
|
13
13
|
require 'rspec/rails'
|
14
|
-
require 'rspec/autorun'
|
15
14
|
require 'generator_spec/test_case'
|
16
15
|
require 'timecop'
|
17
16
|
require 'database_cleaner'
|
17
|
+
require 'pry'
|
18
18
|
|
19
19
|
Rails.logger.info "====> Doorkeeper.orm = #{Doorkeeper.configuration.orm.inspect}"
|
20
20
|
if Doorkeeper.configuration.orm == :active_record
|
@@ -40,6 +40,8 @@ RSpec.configure do |config|
|
|
40
40
|
|
41
41
|
config.infer_base_class_for_anonymous_controllers = false
|
42
42
|
|
43
|
+
config.include RSpec::Rails::RequestExampleGroup, type: :request
|
44
|
+
|
43
45
|
config.before do
|
44
46
|
DatabaseCleaner.start
|
45
47
|
Doorkeeper.configure { orm DOORKEEPER_ORM }
|
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: 2.
|
4
|
+
version: 2.2.0
|
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
|
+
date: 2015-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 3.1.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:
|
55
|
+
version: 3.1.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: capybara
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- CONTRIBUTING.md
|
181
181
|
- Gemfile
|
182
182
|
- MIT-LICENSE
|
183
|
+
- NEWS.md
|
183
184
|
- README.md
|
184
185
|
- RELEASING.md
|
185
186
|
- Rakefile
|