devise_oauth2_providable 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ module Devise
|
|
32
32
|
def authorize_endpoint(allow_approval = false)
|
33
33
|
Rack::OAuth2::Server::Authorize.new do |req, res|
|
34
34
|
@client = Client.find_by_identifier(req.client_id) || req.bad_request!
|
35
|
-
res.redirect_uri
|
35
|
+
res.redirect_uri = @redirect_uri = req.verify_redirect_uri!(@client.redirect_uri)
|
36
36
|
if allow_approval
|
37
37
|
if params[:approve].present?
|
38
38
|
case req.response_type
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_development_dependency(%q<pry>, ['0.9.6.2'])
|
24
24
|
s.add_development_dependency(%q<factory_girl>, ['2.2.0'])
|
25
25
|
s.add_development_dependency(%q<factory_girl_rspec>, ['0.0.1'])
|
26
|
+
s.add_development_dependency(%q<rake>, ['0.9.2.2'])
|
26
27
|
|
27
28
|
s.files = `git ls-files`.split("\n")
|
28
29
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -2,15 +2,31 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Devise::Oauth2Providable::AuthorizationsController do
|
4
4
|
describe 'GET #new' do
|
5
|
-
with
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
context 'with valid redirect_uri' do
|
6
|
+
with :user
|
7
|
+
with :client
|
8
|
+
let(:redirect_uri) { client.redirect_uri }
|
9
|
+
before do
|
10
|
+
sign_in user
|
11
|
+
get :new, :client_id => client.identifier, :redirect_uri => redirect_uri, :response_type => 'code', :use_route => 'devise_oauth2_providable'
|
12
|
+
end
|
13
|
+
it { should respond_with :ok }
|
14
|
+
it { should respond_with_content_type :html }
|
15
|
+
it { should assign_to(:redirect_uri).with(redirect_uri) }
|
16
|
+
it { should assign_to(:response_type) }
|
17
|
+
it { should render_template 'devise/oauth2_providable/authorizations/new' }
|
18
|
+
it { should render_with_layout 'application' }
|
19
|
+
end
|
20
|
+
context 'with invalid redirect_uri' do
|
21
|
+
with :user
|
22
|
+
with :client
|
23
|
+
let(:redirect_uri) { 'http://example.com/foo/bar' }
|
24
|
+
before do
|
25
|
+
sign_in user
|
26
|
+
get :new, :client_id => client.identifier, :redirect_uri => redirect_uri, :response_type => 'code', :use_route => 'devise_oauth2_providable'
|
27
|
+
end
|
28
|
+
it { should respond_with :bad_request }
|
29
|
+
it { should respond_with_content_type :html }
|
10
30
|
end
|
11
|
-
it { should respond_with :ok }
|
12
|
-
it { should respond_with_content_type :html }
|
13
|
-
it { should assign_to(:redirect_uri) }
|
14
|
-
it { should assign_to(:response_type) }
|
15
31
|
end
|
16
32
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_oauth2_providable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 5
|
10
|
+
version: 1.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Sonnek
|
@@ -15,12 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
22
|
none: false
|
25
23
|
requirements:
|
26
24
|
- - ">="
|
@@ -31,12 +29,12 @@ dependencies:
|
|
31
29
|
- 1
|
32
30
|
- 0
|
33
31
|
version: 3.1.0
|
34
|
-
|
32
|
+
requirement: *id001
|
33
|
+
prerelease: false
|
34
|
+
name: rails
|
35
35
|
type: :runtime
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
38
|
-
prerelease: false
|
39
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
38
|
none: false
|
41
39
|
requirements:
|
42
40
|
- - ">="
|
@@ -47,12 +45,12 @@ dependencies:
|
|
47
45
|
- 4
|
48
46
|
- 3
|
49
47
|
version: 1.4.3
|
50
|
-
|
48
|
+
requirement: *id002
|
49
|
+
prerelease: false
|
50
|
+
name: devise
|
51
51
|
type: :runtime
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
|
-
|
54
|
-
prerelease: false
|
55
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
54
|
none: false
|
57
55
|
requirements:
|
58
56
|
- - ~>
|
@@ -63,12 +61,12 @@ dependencies:
|
|
63
61
|
- 11
|
64
62
|
- 0
|
65
63
|
version: 0.11.0
|
66
|
-
|
64
|
+
requirement: *id003
|
65
|
+
prerelease: false
|
66
|
+
name: rack-oauth2
|
67
67
|
type: :runtime
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
|
70
|
-
prerelease: false
|
71
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
70
|
none: false
|
73
71
|
requirements:
|
74
72
|
- - "="
|
@@ -79,12 +77,12 @@ dependencies:
|
|
79
77
|
- 6
|
80
78
|
- 1
|
81
79
|
version: 2.6.1
|
82
|
-
|
80
|
+
requirement: *id004
|
81
|
+
prerelease: false
|
82
|
+
name: rspec-rails
|
83
83
|
type: :development
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
|
86
|
-
prerelease: false
|
87
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
88
86
|
none: false
|
89
87
|
requirements:
|
90
88
|
- - "="
|
@@ -95,12 +93,12 @@ dependencies:
|
|
95
93
|
- 3
|
96
94
|
- 4
|
97
95
|
version: 1.3.4
|
98
|
-
|
96
|
+
requirement: *id005
|
97
|
+
prerelease: false
|
98
|
+
name: sqlite3
|
99
99
|
type: :development
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
|
-
|
102
|
-
prerelease: false
|
103
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
101
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
104
102
|
none: false
|
105
103
|
requirements:
|
106
104
|
- - "="
|
@@ -113,12 +111,12 @@ dependencies:
|
|
113
111
|
- beta
|
114
112
|
- 3
|
115
113
|
version: 1.0.0.beta3
|
116
|
-
|
114
|
+
requirement: *id006
|
115
|
+
prerelease: false
|
116
|
+
name: shoulda-matchers
|
117
117
|
type: :development
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
|
-
|
120
|
-
prerelease: false
|
121
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
119
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
122
120
|
none: false
|
123
121
|
requirements:
|
124
122
|
- - "="
|
@@ -130,12 +128,12 @@ dependencies:
|
|
130
128
|
- 6
|
131
129
|
- 2
|
132
130
|
version: 0.9.6.2
|
133
|
-
|
131
|
+
requirement: *id007
|
132
|
+
prerelease: false
|
133
|
+
name: pry
|
134
134
|
type: :development
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
|
-
|
137
|
-
prerelease: false
|
138
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
136
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
139
137
|
none: false
|
140
138
|
requirements:
|
141
139
|
- - "="
|
@@ -146,12 +144,12 @@ dependencies:
|
|
146
144
|
- 2
|
147
145
|
- 0
|
148
146
|
version: 2.2.0
|
149
|
-
|
147
|
+
requirement: *id008
|
148
|
+
prerelease: false
|
149
|
+
name: factory_girl
|
150
150
|
type: :development
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
|
-
|
153
|
-
prerelease: false
|
154
|
-
requirement: &id009 !ruby/object:Gem::Requirement
|
152
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
155
153
|
none: false
|
156
154
|
requirements:
|
157
155
|
- - "="
|
@@ -162,7 +160,26 @@ dependencies:
|
|
162
160
|
- 0
|
163
161
|
- 1
|
164
162
|
version: 0.0.1
|
165
|
-
|
163
|
+
requirement: *id009
|
164
|
+
prerelease: false
|
165
|
+
name: factory_girl_rspec
|
166
|
+
type: :development
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - "="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
hash: 11
|
174
|
+
segments:
|
175
|
+
- 0
|
176
|
+
- 9
|
177
|
+
- 2
|
178
|
+
- 2
|
179
|
+
version: 0.9.2.2
|
180
|
+
requirement: *id010
|
181
|
+
prerelease: false
|
182
|
+
name: rake
|
166
183
|
type: :development
|
167
184
|
description: Rails3 engine that adds OAuth2 Provider support to any application built with Devise authentication
|
168
185
|
email:
|
@@ -292,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
309
|
requirements: []
|
293
310
|
|
294
311
|
rubyforge_project: devise_oauth2_providable
|
295
|
-
rubygems_version: 1.8.
|
312
|
+
rubygems_version: 1.8.10
|
296
313
|
signing_key:
|
297
314
|
specification_version: 3
|
298
315
|
summary: OAuth2 Provider for Rails3 applications
|