Class: Rack::Pubcookie
- Inherits:
-
Object
- Object
- Rack::Pubcookie
- Includes:
- Auth
- Defined in:
- lib/rack/pubcookie.rb,
lib/rack/pubcookie/aes.rb,
lib/rack/pubcookie/des.rb,
lib/rack/pubcookie/auth.rb,
lib/rack/pubcookie/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.0.3'
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options) ⇒ Pubcookie
constructor
A new instance of Pubcookie.
Methods included from Auth
#callback_path, #extract_username, #login_page_html, #pubcookie_options=, #set_pubcookie!
Methods included from DES
Methods included from AES
Constructor Details
#initialize(app, options) ⇒ Pubcookie
Returns a new instance of Pubcookie.
11 12 13 14 |
# File 'lib/rack/pubcookie.rb', line 11 def initialize app, @app = app self. = end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rack/pubcookie.rb', line 16 def call env request = Rack::Request.new env if request.path == '/auth/pubcookie' response = Rack::Response.new login_page_html else request.env['REMOTE_USER'] = extract_username request status, headers, body = @app.call(request.env) response = Rack::Response.new body, status, headers request, response end response.finish end |