Skip to content
HTTP Authorization helpers for Sinatra
Ruby
Pull request Compare This branch is 17 commits ahead, 4 commits behind integrity:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/sinatra
test
.gitignore
COPYING
Gemfile
README
Rakefile
sinatra-authorization.gemspec

README

        Sinatra Authorization -- HTTP Authorization helpers for Sinatra

USAGE

  require "sinatra/authorization"

  set :authorization_realm, "Protected zone"

  helpers do
    def authorize(login, password)
      login == "admin" && password == "secret"
    end
  end

  get "/" do
    "Hello"
  end

  get "/admin" do
    login_required

    "Welcome in protected zone"
  end

TESTS

  gem install bundler
  gem bundle
  ./bin/rake
Something went wrong with that request. Please try again.