Method: Aker::Rack::Setup#call

Defined in:
lib/aker/rack/setup.rb

#call(env) ⇒ Array

Implements the rack middleware behavior.

This class exposes three environment variables to downstream middleware and the app:

* `"aker.configuration"`: the {Aker::Configuration configuration}
   for this application.
* `"aker.authority"`: the {Aker::Authorities authority} for
  this application.
* `"aker.interactive"`: a boolean indicating whether this
  request is being treated as an interactive (UI) or
  non-interactive (API) request

[There is a related fourth environment variable:

* `"aker.check"`: an instance of {Aker::Rack::Facade}
  permitting authentication and authorization queries about the
  current user (if any).

This fourth variable is added by the Authenticate middleware; see its documentation for more.]

Parameters:

  • env (Hash)

    the rack env

Returns:

  • (Array)

    the standard rack return



58
59
60
61
62
63
64
# File 'lib/aker/rack/setup.rb', line 58

def call(env)
  env['aker.configuration'] = @configuration
  env['aker.authority'] = @configuration.composite_authority
  env['aker.interactive'] = interactive?(env)

  @app.call(env)
end