Class: BrowserID::Provider
- Inherits:
-
Object
- Object
- BrowserID::Provider
- Defined in:
- lib/browserid-provider/provider.rb
Overview
The BrowserID Provider Rack App
Default paths are:
GET /users/sign_in
GET /browserid/provision
GET /browserid/whoami
POST /browserid/certify
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#env ⇒ Object
Returns the value of attribute env.
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#req ⇒ Object
Returns the value of attribute req.
Instance Method Summary collapse
-
#call(env) ⇒ Object
Rack enabled!.
-
#initialize(app = nil, options = {}) ⇒ Provider
constructor
A new instance of Provider.
Constructor Details
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/browserid-provider/provider.rb', line 10 def config @config end |
#env ⇒ Object
Returns the value of attribute env.
10 11 12 |
# File 'lib/browserid-provider/provider.rb', line 10 def env @env end |
#identity ⇒ Object
Returns the value of attribute identity.
10 11 12 |
# File 'lib/browserid-provider/provider.rb', line 10 def identity @identity end |
#req ⇒ Object
Returns the value of attribute req.
10 11 12 |
# File 'lib/browserid-provider/provider.rb', line 10 def req @req end |
Instance Method Details
#call(env) ⇒ Object
Rack enabled!
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/browserid-provider/provider.rb', line 18 def call(env) @env, @path = env, env["PATH_INFO"], @req = Rack::Request.new(env) env['browserid'] = @config # Return Not found or send call back to middleware stack unless the URL is captured here return (@app ? @app.call(env) : not_found) unless @config.urls.include? @path case @path when "/.well-known/browserid" @req.get? ? well_known_browserid : not_found when config.whoami_path @req.get? ? whoami : not_found when config.provision_path @req.get? ? provision : not_found when config.certify_path @req.post? ? certify : not_found else not_found end end |