class Rack::PactBroker::UIAuthentication

Public Class Methods

new(app) click to toggle source
# File lib/rack/pact_broker/ui_authentication.rb, line 9
def initialize app
  @app = app
end

Public Instance Methods

auth?(env) click to toggle source
# File lib/rack/pact_broker/ui_authentication.rb, line 21
def auth? env
  authenticated? nil, env["HTTP_AUTHORIZATION"]
end
call(env) click to toggle source
# File lib/rack/pact_broker/ui_authentication.rb, line 13
def call env
  if auth? env
    @app.call(env)
  else
    [401, {"WWW-Authenticate" => 'Basic realm="Restricted Area"'}, []]
  end
end