roman-rots 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rots.rb +1 -1
- data/lib/rots/identity_page_app.rb +9 -4
- data/lib/rots/test_helper.rb +2 -8
- data/rots.gemspec +1 -1
- metadata +2 -2
data/lib/rots.rb
CHANGED
@@ -11,14 +11,13 @@ class Rots::IdentityPageApp
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def call(env)
|
14
|
-
request = Rack::Request.new(env)
|
15
|
-
flag = request.params['openid.success'] == 'true' ? '?openid.success=true' : ''
|
14
|
+
@request = Rack::Request.new(env)
|
16
15
|
Rack::Response.new do |response|
|
17
16
|
response.write <<-HERE
|
18
17
|
<html>
|
19
18
|
<head>
|
20
|
-
<link rel="openid2.provider" href="
|
21
|
-
<link rel="openid.server" href="
|
19
|
+
<link rel="openid2.provider" href="#{op_endpoint}" />
|
20
|
+
<link rel="openid.server" href="#{op_endpoint}" />
|
22
21
|
</head>
|
23
22
|
<body>
|
24
23
|
<h1>This is #{@config['identity']} identity page</h1>
|
@@ -28,4 +27,10 @@ class Rots::IdentityPageApp
|
|
28
27
|
end.finish
|
29
28
|
end
|
30
29
|
|
30
|
+
def op_endpoint
|
31
|
+
"http://%s:%d/server/%s" % [@request.host,
|
32
|
+
@request.port,
|
33
|
+
(@request.params['openid.success'] ? '?openid.success=true' : '')]
|
34
|
+
end
|
35
|
+
|
31
36
|
end
|
data/lib/rots/test_helper.rb
CHANGED
@@ -9,14 +9,8 @@ module Rots::TestHelper
|
|
9
9
|
openid_response_uri = URI(openid_response['Location'])
|
10
10
|
openid_response_qs = Rack::Utils.parse_query(openid_response_uri.query)
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
visit(openid_response_uri.to_s)
|
15
|
-
else
|
16
|
-
# NOTE: Works on Rails and Merb frameworks via duck typing
|
17
|
-
# later we will check on Sinatra
|
18
|
-
get(openid_response_uri.path, openid_response_qs)
|
19
|
-
end
|
12
|
+
{ :url => openid_response_uri.to_s,
|
13
|
+
:query_params => openid_response_qs }
|
20
14
|
end
|
21
15
|
|
22
16
|
end
|
data/rots.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roman-rots
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Gonzalez
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-29 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|