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.
@@ -1,7 +1,7 @@
1
1
  module Rots
2
2
 
3
3
  def self.release
4
- "0.2.0"
4
+ "0.2.1"
5
5
  end
6
6
 
7
7
  end
@@ -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="http://localhost:#{@server_options[:port]}/server/#{flag}" />
21
- <link rel="openid.server" href="http://localhost:#{@server_options[:port]}/server/#{flag}" />
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
@@ -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
- # invoking the OpenID consumer with the options of the response of the ServerApp
13
- if defined?(Webrat)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rots"
5
- s.version = '0.2.0'
5
+ s.version = '0.2.1'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.summary = "an OpenID server for making tests of OpenID clients implementations"
8
8
 
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.0
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-21 00:00:00 -07:00
12
+ date: 2009-03-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency