doorkeeper 4.2.5 → 4.2.6
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 +1 -0
- data/NEWS.md +4 -0
- data/README.md +1 -1
- data/RELEASING.md +5 -12
- data/app/views/doorkeeper/applications/_form.html.erb +1 -1
- data/app/views/doorkeeper/authorizations/new.html.erb +1 -1
- data/doorkeeper.gemspec +0 -1
- data/lib/doorkeeper/errors.rb +18 -0
- data/lib/doorkeeper/helpers/controller.rb +1 -16
- data/lib/doorkeeper/version.rb +1 -1
- data/spec/controllers/authorizations_controller_spec.rb +27 -12
- data/spec/lib/models/expirable_spec.rb +0 -1
- data/spec/requests/flows/authorization_code_errors_spec.rb +11 -1
- data/spec/spec_helper_integration.rb +0 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4b94e7f1fb4975a36ad84ccfda9bcfb0b5e2bd7
|
4
|
+
data.tar.gz: fc5914c689e55572a9313caa07f2644c29f37574
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90cc508667ce0ec9693925a187fbc9ae5b9eeaf95b74648c9981ceea9eaef305d9981f75d48a8b8f0e00929bcc748a51da4b013b814ffa8a9344a4fc44257e1
|
7
|
+
data.tar.gz: 433cafea0488b8d0ab2d7d9b164b9510191f9a6d6534443674064e60c8ea2c0007494a9015b8c9d96a44b603182217496d4221db752c21d1cc5e56b1e377ae86
|
data/.travis.yml
CHANGED
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Doorkeeper - awesome
|
1
|
+
# Doorkeeper - awesome OAuth2 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
4
|
[![Dependency Status](https://gemnasium.com/doorkeeper-gem/doorkeeper.svg?travis)](https://gemnasium.com/doorkeeper-gem/doorkeeper)
|
data/RELEASING.md
CHANGED
@@ -1,17 +1,10 @@
|
|
1
1
|
# Releasing doorkeeper
|
2
2
|
|
3
|
+
How to release doorkeeper in five easy steps!
|
4
|
+
|
3
5
|
1. Update `lib/doorkeeper/version.rb` file accordingly.
|
4
6
|
2. Update `NEWS.md` to reflect the changes since last release.
|
5
|
-
3. Commit changes
|
6
|
-
|
7
|
-
|
8
|
-
5. Push changes: `git push && git push --tags`
|
9
|
-
6. Build and publish the gem:
|
10
|
-
|
11
|
-
```bash
|
12
|
-
gem build doorkeeper.gemspec
|
13
|
-
gem push doorkeeper-*.gem
|
14
|
-
```
|
15
|
-
|
16
|
-
7. Announce the new release, making sure to say “thank you” to the contributors
|
7
|
+
3. Commit changes: `git commit -am 'Bump to vVERSION'`
|
8
|
+
4. Run `rake release`
|
9
|
+
5. Announce the new release, making sure to say “thank you” to the contributors
|
17
10
|
who helped shape this version!
|
@@ -21,7 +21,7 @@
|
|
21
21
|
</span>
|
22
22
|
<% if Doorkeeper.configuration.native_redirect_uri %>
|
23
23
|
<span class="help-block">
|
24
|
-
<%= raw t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri:
|
24
|
+
<%= raw t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: content_tag(:code) { Doorkeeper.configuration.native_redirect_uri }) %>
|
25
25
|
</span>
|
26
26
|
<% end %>
|
27
27
|
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<main role="main">
|
6
6
|
<p class="h4">
|
7
|
-
<%= raw t('.prompt', client_name:
|
7
|
+
<%= raw t('.prompt', client_name: content_tag(:strong, class: 'text-info') { @pre_auth.client.name }) %>
|
8
8
|
</p>
|
9
9
|
|
10
10
|
<% if @pre_auth.scopes.count > 0 %>
|
data/doorkeeper.gemspec
CHANGED
data/lib/doorkeeper/errors.rb
CHANGED
@@ -1,21 +1,39 @@
|
|
1
1
|
module Doorkeeper
|
2
2
|
module Errors
|
3
3
|
class DoorkeeperError < StandardError
|
4
|
+
def type
|
5
|
+
message
|
6
|
+
end
|
4
7
|
end
|
5
8
|
|
6
9
|
class InvalidAuthorizationStrategy < DoorkeeperError
|
10
|
+
def type
|
11
|
+
:unsupported_response_type
|
12
|
+
end
|
7
13
|
end
|
8
14
|
|
9
15
|
class InvalidTokenReuse < DoorkeeperError
|
16
|
+
def type
|
17
|
+
:invalid_request
|
18
|
+
end
|
10
19
|
end
|
11
20
|
|
12
21
|
class InvalidGrantReuse < DoorkeeperError
|
22
|
+
def type
|
23
|
+
:invalid_grant
|
24
|
+
end
|
13
25
|
end
|
14
26
|
|
15
27
|
class InvalidTokenStrategy < DoorkeeperError
|
28
|
+
def type
|
29
|
+
:unsupported_grant_type
|
30
|
+
end
|
16
31
|
end
|
17
32
|
|
18
33
|
class MissingRequestStrategy < DoorkeeperError
|
34
|
+
def type
|
35
|
+
:invalid_request
|
36
|
+
end
|
19
37
|
end
|
20
38
|
|
21
39
|
class UnableToGenerateToken < DoorkeeperError
|
@@ -34,22 +34,7 @@ module Doorkeeper
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def get_error_response_from_exception(exception)
|
37
|
-
|
38
|
-
when Errors::InvalidTokenStrategy
|
39
|
-
:unsupported_grant_type
|
40
|
-
when Errors::InvalidAuthorizationStrategy
|
41
|
-
:unsupported_response_type
|
42
|
-
when Errors::MissingRequestStrategy
|
43
|
-
:invalid_request
|
44
|
-
when Errors::InvalidTokenReuse
|
45
|
-
:invalid_request
|
46
|
-
when Errors::InvalidGrantReuse
|
47
|
-
:invalid_grant
|
48
|
-
when Errors::DoorkeeperError
|
49
|
-
exception.message
|
50
|
-
end
|
51
|
-
|
52
|
-
OAuth::ErrorResponse.new name: error_name, state: params[:state]
|
37
|
+
OAuth::ErrorResponse.new name: exception.type, state: params[:state]
|
53
38
|
end
|
54
39
|
|
55
40
|
def handle_token_exception(exception)
|
data/lib/doorkeeper/version.rb
CHANGED
@@ -3,9 +3,24 @@ require 'spec_helper_integration'
|
|
3
3
|
describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
|
4
4
|
include AuthorizationRequestHelper
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
if Rails::VERSION::MAJOR == 5
|
7
|
+
class ActionDispatch::TestResponse
|
8
|
+
def query_params
|
9
|
+
@_query_params ||= begin
|
10
|
+
fragment = URI.parse(location).fragment
|
11
|
+
Rack::Utils.parse_query(fragment)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
else
|
16
|
+
class ActionController::TestResponse
|
17
|
+
def query_params
|
18
|
+
@_query_params ||= begin
|
19
|
+
fragment = URI.parse(location).fragment
|
20
|
+
Rack::Utils.parse_query(fragment)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
9
24
|
end
|
10
25
|
|
11
26
|
def translated_error_message(key)
|
@@ -35,15 +50,15 @@ describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
|
|
35
50
|
end
|
36
51
|
|
37
52
|
it 'includes access token in fragment' do
|
38
|
-
expect(
|
53
|
+
expect(response.query_params['access_token']).to eq(Doorkeeper::AccessToken.first.token)
|
39
54
|
end
|
40
55
|
|
41
56
|
it 'includes token type in fragment' do
|
42
|
-
expect(
|
57
|
+
expect(response.query_params['token_type']).to eq('bearer')
|
43
58
|
end
|
44
59
|
|
45
60
|
it 'includes token expiration in fragment' do
|
46
|
-
expect(
|
61
|
+
expect(response.query_params['expires_in'].to_i).to eq(2.hours.to_i)
|
47
62
|
end
|
48
63
|
|
49
64
|
it 'issues the token for the current client' do
|
@@ -70,15 +85,15 @@ describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
|
|
70
85
|
end
|
71
86
|
|
72
87
|
it 'does not include access token in fragment' do
|
73
|
-
expect(
|
88
|
+
expect(response.query_params['access_token']).to be_nil
|
74
89
|
end
|
75
90
|
|
76
91
|
it 'includes error in fragment' do
|
77
|
-
expect(
|
92
|
+
expect(response.query_params['error']).to eq('invalid_scope')
|
78
93
|
end
|
79
94
|
|
80
95
|
it 'includes error description in fragment' do
|
81
|
-
expect(
|
96
|
+
expect(response.query_params['error_description']).to eq(translated_error_message(:invalid_scope))
|
82
97
|
end
|
83
98
|
|
84
99
|
it 'does not issue any access token' do
|
@@ -95,7 +110,7 @@ describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
|
|
95
110
|
end
|
96
111
|
|
97
112
|
it 'returns the existing access token in a fragment' do
|
98
|
-
expect(
|
113
|
+
expect(response.query_params['access_token']).to eq(access_token.token)
|
99
114
|
end
|
100
115
|
|
101
116
|
it 'does not creates a new access token' do
|
@@ -169,11 +184,11 @@ describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
|
|
169
184
|
end
|
170
185
|
|
171
186
|
it 'includes token type in fragment' do
|
172
|
-
expect(
|
187
|
+
expect(response.query_params['token_type']).to eq('bearer')
|
173
188
|
end
|
174
189
|
|
175
190
|
it 'includes token expiration in fragment' do
|
176
|
-
expect(
|
191
|
+
expect(response.query_params['expires_in'].to_i).to eq(2.hours.to_i)
|
177
192
|
end
|
178
193
|
|
179
194
|
it 'issues the token for the current client' do
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'spec_helper_integration'
|
2
2
|
|
3
3
|
feature 'Authorization Code Flow Errors' do
|
4
|
+
let(:client_params) { {} }
|
4
5
|
background do
|
5
6
|
config_is_set(:authenticate_resource_owner) { User.first || redirect_to('/sign_in') }
|
6
|
-
client_exists
|
7
|
+
client_exists client_params
|
7
8
|
create_resource_owner
|
8
9
|
sign_in
|
9
10
|
end
|
@@ -12,6 +13,15 @@ feature 'Authorization Code Flow Errors' do
|
|
12
13
|
access_grant_should_not_exist
|
13
14
|
end
|
14
15
|
|
16
|
+
context "with a client trying to xss resource owner" do
|
17
|
+
let(:client_name) { "<div id='xss'>XSS</div>" }
|
18
|
+
let(:client_params) { { name: client_name } }
|
19
|
+
scenario "resource owner visit authorization endpoint" do
|
20
|
+
visit authorization_endpoint_url(client: @client)
|
21
|
+
expect(page).not_to have_css("#xss")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
15
25
|
context 'when access was denied' do
|
16
26
|
scenario 'redirects with error' do
|
17
27
|
visit authorization_endpoint_url(client: @client)
|
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: 4.2.
|
4
|
+
version: 4.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Elias Philipp
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -124,20 +124,6 @@ dependencies:
|
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
|
-
name: timecop
|
129
|
-
requirement: !ruby/object:Gem::Requirement
|
130
|
-
requirements:
|
131
|
-
- - "~>"
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: 0.8.1
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
requirements:
|
138
|
-
- - "~>"
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: 0.8.1
|
141
127
|
description: Doorkeeper is an OAuth 2 provider for Rails and Grape.
|
142
128
|
email:
|
143
129
|
- me@jonathanmoss.me
|
@@ -400,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
400
386
|
version: '0'
|
401
387
|
requirements: []
|
402
388
|
rubyforge_project:
|
403
|
-
rubygems_version: 2.
|
389
|
+
rubygems_version: 2.6.11
|
404
390
|
signing_key:
|
405
391
|
specification_version: 4
|
406
392
|
summary: OAuth 2 provider for Rails and Grape
|