Class: CosmosAuthentication::RackMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/cosmos_authentication/rack_middleware.rb

Defined Under Namespace

Classes: Authenticator

Instance Method Summary collapse

Constructor Details

#initialize(app, opts = {}) ⇒ RackMiddleware

Returns a new instance of RackMiddleware.



127
128
129
130
# File 'lib/cosmos_authentication/rack_middleware.rb', line 127

def initialize(app, opts = {})
  @app  = app
  @opts = opts
end

Instance Method Details

#call(env) ⇒ Object



132
133
134
135
# File 'lib/cosmos_authentication/rack_middleware.rb', line 132

def call(env)
  env['authentication'] = Authenticator.new(@opts, env)
  @app.call env
end