class Rots::IdentityPageApp

Public Class Methods

new(config, server_options) click to toggle source
# File lib/rots/identity_page_app.rb, line 8
def initialize(config, server_options)
  @server_options = server_options
  @config = config
end

Public Instance Methods

call(env) click to toggle source
# File lib/rots/identity_page_app.rb, line 13
  def call(env)
    @request = Rack::Request.new(env)
    Rack::Response.new do |response|
      response.write <<-HERE
<html>
  <head>
  <link rel="openid2.provider" href="#{op_endpoint}" />
  <link rel="openid.server" href="#{op_endpoint}" />
  </head>
  <body>
    <h1>This is #{@config['identity']} identity page</h1>
  </body>
</html>
      HERE
    end.finish
  end
op_endpoint() click to toggle source
# File lib/rots/identity_page_app.rb, line 30
def op_endpoint
  "http://%s:%d/server/%s" % [@request.host, 
                         @request.port, 
                         (@request.params['openid.success'] ? '?openid.success=true' : '')]
end