Sha256: d4f9075698069a49c2a2b36773feeaf5e26c8cfe61116d08f366e03d258877f7

Contents?: true

Size: 419 Bytes

Versions: 123

Compression:

Stored size: 419 Bytes

Contents

require File.join(File.dirname(__FILE__), 'basic')

class BasicAuth < Basic
  before do
    auth ||= Rack::Auth::Basic::Request.new(request.env)
    user, pass = auth.provided? && auth.basic? && auth.credentials
    unless [user, pass] == ["test_user", "test_password"]
      response['WWW-Authenticate'] = %(Basic realm="Restricted Area")
      throw(:halt, [401, "Not authorized\n"])
    end
  end
end

run BasicAuth

Version data entries

123 entries across 121 versions & 6 rubygems

Version Path
excon-0.28.0 tests/rackups/basic_auth.ru
excon-0.27.6 tests/rackups/basic_auth.ru
excon-0.27.5 tests/rackups/basic_auth.ru
excon-0.27.4 tests/rackups/basic_auth.ru
excon-0.27.3 tests/rackups/basic_auth.ru
excon-0.27.2 tests/rackups/basic_auth.ru
excon-0.27.1 tests/rackups/basic_auth.ru
excon-0.27.0 tests/rackups/basic_auth.ru
excon-0.26.0 tests/rackups/basic_auth.ru
excon-0.25.3 tests/rackups/basic_auth.ru
excon-0.25.2 tests/rackups/basic_auth.ru
excon-0.25.1 tests/rackups/basic_auth.ru
excon-0.25.0 tests/rackups/basic_auth.ru
excon-0.24.0 tests/rackups/basic_auth.ru
excon-0.23.0 tests/rackups/basic_auth.ru
excon-0.22.1 tests/rackups/basic_auth.ru
excon-0.22.0 tests/rackups/basic_auth.ru
vagrant-shell-0.2.6 vendor/bundle/gems/excon-0.20.1/tests/rackups/basic_auth.ru
vagrant-shell-0.2.5 vendor/bundle/gems/excon-0.20.1/tests/rackups/basic_auth.ru
excon-0.21.0 tests/rackups/basic_auth.ru