rack-oauth2 0.14.7 → 0.14.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -3
- data/VERSION +1 -1
- data/lib/rack/oauth2/server/authorize.rb +2 -2
- data/spec/rack/oauth2/server/authorize_spec.rb +24 -3
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-oauth2 (0.14.
|
4
|
+
rack-oauth2 (0.14.7)
|
5
5
|
activesupport (>= 2.3)
|
6
6
|
attr_required (>= 0.0.5)
|
7
7
|
httpclient (>= 2.2.0.2)
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: http://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (3.2.
|
15
|
+
activesupport (3.2.8)
|
16
16
|
i18n (~> 0.6)
|
17
17
|
multi_json (~> 1.0)
|
18
18
|
addressable (2.2.8)
|
@@ -31,7 +31,6 @@ GEM
|
|
31
31
|
jruby-openssl (0.7.7)
|
32
32
|
bouncy-castle-java (>= 1.5.0146.1)
|
33
33
|
json (1.7.4)
|
34
|
-
json (1.7.4-java)
|
35
34
|
multi_json (1.3.6)
|
36
35
|
rack (1.4.1)
|
37
36
|
rake (0.9.2.2)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.14.
|
1
|
+
0.14.8
|
@@ -60,8 +60,8 @@ module Rack
|
|
60
60
|
else
|
61
61
|
bad_request! 'Invalid redirect_uri is given'
|
62
62
|
end
|
63
|
-
elsif pre_registered.present?
|
64
|
-
pre_registered
|
63
|
+
elsif pre_registered.present? && Array(pre_registered).size == 1
|
64
|
+
Array(pre_registered).first
|
65
65
|
else
|
66
66
|
bad_request! 'No redirect_uri is given'
|
67
67
|
end
|
@@ -108,10 +108,31 @@ describe Rack::OAuth2::Server::Authorize do
|
|
108
108
|
end
|
109
109
|
|
110
110
|
context 'when redirect_uri is missing' do
|
111
|
-
let(:pre_registered) { redirect_uri }
|
112
111
|
let(:env) { Rack::MockRequest.env_for("/authorize?client_id=client") }
|
113
|
-
|
114
|
-
|
112
|
+
|
113
|
+
context 'when pre-registered redirect_uri is a String' do
|
114
|
+
let(:pre_registered) { redirect_uri }
|
115
|
+
it 'should use pre-registered redirect_uri' do
|
116
|
+
request.verify_redirect_uri!(pre_registered).should == pre_registered
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
context 'when pre-registered redirect_uri is an Array' do
|
121
|
+
context 'when only 1' do
|
122
|
+
let(:pre_registered) { [redirect_uri] }
|
123
|
+
it 'should use pre-registered redirect_uri' do
|
124
|
+
request.verify_redirect_uri!(pre_registered).should == pre_registered.first
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
context 'when more than 2' do
|
129
|
+
let(:pre_registered) { [redirect_uri, 'http://client.example.com/callback2'] }
|
130
|
+
it do
|
131
|
+
expect do
|
132
|
+
request.verify_redirect_uri!(pre_registered)
|
133
|
+
end.to raise_error Rack::OAuth2::Server::Authorize::BadRequest
|
134
|
+
end
|
135
|
+
end
|
115
136
|
end
|
116
137
|
end
|
117
138
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|