gds-sso 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gds-sso/user.rb +1 -1
- data/lib/gds-sso/version.rb +1 -1
- data/lib/gds-sso/warden_config.rb +1 -1
- data/spec/fixtures/integration/signonotron2.sql +2 -2
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/log/test.log +3808 -0
- data/spec/requests/authentication_soot2.rb +1 -46
- data/spec/requests/end_to_end_spec.rb +0 -14
- metadata +4 -4
@@ -96,52 +96,7 @@ describe "authenticating with sign-on-o-tron" do
|
|
96
96
|
cookie = sign_in_post.headers['Set-Cookie'].split('; ')[0]
|
97
97
|
authz_location = URI.parse(sign_in_post.headers['location'])
|
98
98
|
|
99
|
-
return
|
100
|
-
end
|
101
|
-
|
102
|
-
def do_authz_request(authz_location, cookie)
|
103
|
-
authz_request = @signonotron.get do |req|
|
104
|
-
req.url authz_location
|
105
|
-
req.headers['Content-Type'] = 'text/html'
|
106
|
-
req.headers['Cookie'] = cookie
|
107
|
-
end
|
108
|
-
|
109
|
-
debug_request('Authz', 'GET', authz_location, authz_request, cookie)
|
110
|
-
|
111
|
-
cookie = authz_request.headers['Set-Cookie'].split('; ')[0]
|
112
|
-
|
113
|
-
if authz_request.headers['location']
|
114
|
-
puts "RETURNING #{authz_request.headers['location']}"
|
115
|
-
return URI.parse(authz_request.headers['location'])
|
116
|
-
else
|
117
|
-
authz_confirm_location = Nokogiri.parse(authz_request.body).xpath("//form").first.attributes['action'].text
|
118
|
-
authenticity_token = Nokogiri.parse(authz_request.body).xpath("//input[@name='authenticity_token']").first.attributes['value'].text
|
119
|
-
|
120
|
-
return do_authz_confirm_post(authz_confirm_location, cookie, authenticity_token)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
def do_authz_confirm_post(authz_confirm_location, cookie, authenticity_token)
|
125
|
-
authz_confirm_request = @signonotron.post do |req|
|
126
|
-
req.url authz_confirm_location
|
127
|
-
req.body = { :commit => 'Authorize', :authenticity_token => authenticity_token,
|
128
|
-
:authorization => {
|
129
|
-
:client_id => '1acd5e4e34a0e15225383bbbdf88cf95f8efd82664f3811b917869cc51c8f449',
|
130
|
-
:redirect_uri => 'http://www.example.com/auth/gds/callback',
|
131
|
-
:response_type => 'code',
|
132
|
-
:state => '',
|
133
|
-
:scope => ''
|
134
|
-
}
|
135
|
-
}
|
136
|
-
req.headers['Cookie'] = cookie
|
137
|
-
end
|
138
|
-
|
139
|
-
debug_request('Authz Confirm', 'POST', authz_confirm_location, authz_confirm_request, cookie)
|
140
|
-
|
141
|
-
cookie = authz_confirm_request.headers['Set-Cookie'].split('; ')[0]
|
142
|
-
|
143
|
-
puts "RETURNING #{authz_confirm_request.headers['location']}"
|
144
|
-
return URI.parse(authz_confirm_request.headers['location'])
|
99
|
+
return authz_location
|
145
100
|
end
|
146
101
|
|
147
102
|
def debug_request(name, method, path, response, cookie)
|
@@ -32,8 +32,6 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
32
32
|
fill_in "Passphrase", :with => "q1w2e3r4t5y6u7i8o9p0"
|
33
33
|
click_on "Sign in"
|
34
34
|
|
35
|
-
click_authorize
|
36
|
-
|
37
35
|
page.should have_content('restricted kablooie')
|
38
36
|
end
|
39
37
|
|
@@ -44,8 +42,6 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
44
42
|
fill_in "Passphrase", :with => "q1w2e3r4t5y6u7i8o9p0"
|
45
43
|
click_on "Sign in"
|
46
44
|
|
47
|
-
click_authorize
|
48
|
-
|
49
45
|
# At this point the app should be authorised, we reset the session to simulate a new browser visit.
|
50
46
|
reset_session!
|
51
47
|
page.driver.header 'accept', 'text/html'
|
@@ -65,7 +61,6 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
65
61
|
fill_in "Email", :with => "test@example-client.com"
|
66
62
|
fill_in "Passphrase", :with => "q1w2e3r4t5y6u7i8o9p0"
|
67
63
|
click_on "Sign in"
|
68
|
-
click_authorize
|
69
64
|
|
70
65
|
# At this point the app should be authorised, we reset the session to simulate a new browser visit.
|
71
66
|
reset_session!
|
@@ -87,7 +82,6 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
87
82
|
fill_in "Email", :with => "test@example-client.com"
|
88
83
|
fill_in "Passphrase", :with => "q1w2e3r4t5y6u7i8o9p0"
|
89
84
|
click_on "Sign in"
|
90
|
-
click_authorize
|
91
85
|
|
92
86
|
page.driver.header 'accept', 'text/html'
|
93
87
|
page.should have_content('restricted kablooie')
|
@@ -123,8 +117,6 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
123
117
|
fill_in "Passphrase", :with => "q1w2e3r4t5y6u7i8o9p0"
|
124
118
|
click_on "Sign in"
|
125
119
|
|
126
|
-
click_authorize
|
127
|
-
|
128
120
|
page.should have_content('restricted kablooie')
|
129
121
|
|
130
122
|
Timecop.travel(Time.now.utc + GDS::SSO::Config.auth_valid_for + 5.minutes) do
|
@@ -142,8 +134,6 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
142
134
|
fill_in "Passphrase", :with => "q1w2e3r4t5y6u7i8o9p0"
|
143
135
|
click_on "Sign in"
|
144
136
|
|
145
|
-
click_authorize
|
146
|
-
|
147
137
|
page.should have_content('restricted kablooie')
|
148
138
|
|
149
139
|
Timecop.travel(Time.now.utc + GDS::SSO::Config.auth_valid_for - 5.minutes) do
|
@@ -204,8 +194,4 @@ describe "Integration of client using GDS-SSO with signonotron" do
|
|
204
194
|
page.should have_content('you have signin permission')
|
205
195
|
end
|
206
196
|
end
|
207
|
-
|
208
|
-
def click_authorize
|
209
|
-
click_on( page.has_button?("Authorize") ? "Authorize" : "Yes" )
|
210
|
-
end
|
211
197
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gds-sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.0.
|
5
|
+
version: 3.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Matt Patterson
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2013-01-
|
14
|
+
date: 2013-01-21 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -232,7 +232,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
232
|
requirements:
|
233
233
|
- - ">="
|
234
234
|
- !ruby/object:Gem::Version
|
235
|
-
hash:
|
235
|
+
hash: -843889514767446827
|
236
236
|
segments:
|
237
237
|
- 0
|
238
238
|
version: "0"
|
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
241
|
requirements:
|
242
242
|
- - ">="
|
243
243
|
- !ruby/object:Gem::Version
|
244
|
-
hash:
|
244
|
+
hash: -843889514767446827
|
245
245
|
segments:
|
246
246
|
- 0
|
247
247
|
version: "0"
|