hancock-client 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/hancock-client.rb +0 -9
- data/spec/hancock_sinatra_spec.rb +20 -0
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/hancock-client.rb
CHANGED
@@ -23,15 +23,6 @@ module Hancock
|
|
23
23
|
end
|
24
24
|
|
25
25
|
register Sinatra::Hancock::SSO
|
26
|
-
|
27
|
-
get '*' do
|
28
|
-
if session[:user_id]
|
29
|
-
forward
|
30
|
-
else
|
31
|
-
session[:return_to] = request.path_info
|
32
|
-
redirect "#{options.sso_url}/login?return_to=#{absolute_url('/sso/login')}"
|
33
|
-
end
|
34
|
-
end
|
35
26
|
end
|
36
27
|
end
|
37
28
|
end
|
@@ -9,6 +9,26 @@ describe Sinatra::Hancock::SSO do
|
|
9
9
|
last_response.headers['Location'].should eql('http://localhost:20000/login?return_to=http://example.org/sso/login')
|
10
10
|
end
|
11
11
|
|
12
|
+
it "should protect the root url from HTTP post" do
|
13
|
+
post '/'
|
14
|
+
last_response.headers['Location'].should eql('/sso/login')
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should protect the root url from HTTP head" do
|
18
|
+
head '/'
|
19
|
+
last_response.headers['Location'].should eql('/sso/login')
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should protect the root url from HTTP put" do
|
23
|
+
put '/'
|
24
|
+
last_response.headers['Location'].should eql('/sso/login')
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should protect the root url from HTTP delete" do
|
28
|
+
delete '/'
|
29
|
+
last_response.headers['Location'].should eql('/sso/login')
|
30
|
+
end
|
31
|
+
|
12
32
|
it "should greet the user when authenticated" do
|
13
33
|
pending
|
14
34
|
get '/'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hancock-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Donohoe
|
@@ -9,7 +9,7 @@ autorequire: hancock-client
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-01 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|