Class: Rots::ServerApp

Inherits:
Object
  • Object
show all
Defined in:
lib/rots/server_app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, server_options) ⇒ ServerApp

Returns a new instance of ServerApp.



21
22
23
24
# File 'lib/rots/server_app.rb', line 21

def initialize(config, server_options)
  @server_options = server_options
  @sreg_fields = config["sreg"]
end

Instance Attribute Details

#openid_requestObject

Returns the value of attribute openid_request.



15
16
17
# File 'lib/rots/server_app.rb', line 15

def openid_request
  @openid_request
end

#openid_responseObject

Returns the value of attribute openid_response.



15
16
17
# File 'lib/rots/server_app.rb', line 15

def openid_response
  @openid_response
end

#requestObject

Returns the value of attribute request.



15
16
17
# File 'lib/rots/server_app.rb', line 15

def request
  @request
end

#responseObject

Returns the value of attribute response.



15
16
17
# File 'lib/rots/server_app.rb', line 15

def response
  @response
end

#serverObject

Returns the value of attribute server.



15
16
17
# File 'lib/rots/server_app.rb', line 15

def server
  @server
end

Instance Method Details

#call(env) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rots/server_app.rb', line 26

def call(env)
  on_openid_request(env) do
    if !is_checkid_request?
      @openid_response = @server.handle_request(@openid_request)
      reply_consumer
    elsif is_checkid_immediate?
      process_immediate_checkid_request
    else
      process_checkid_request
    end
  end
end