Class: Rack::Auth::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/auth/signature.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, &block) ⇒ Signature

Returns a new instance of Signature.



14
15
16
17
18
# File 'lib/rack/auth/signature.rb', line 14

def initialize(app, options = {}, &block)
  @app = app
  @options = load_options(options)
  instance_eval(&block) if block
end

Instance Method Details

#call(env) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/rack/auth/signature.rb', line 20

def call(env)
  @request = Rack::Request.new(env)

  if excluded? || allowed?
    @app.call(env)
  else
    response = options[:error_response].values
    Rack::Response.new(*response).finish
  end
end