public
Description: HTTP Authorization helpers for Sinatra
Homepage:
Clone URL: git://github.com/integrity/sinatra-authorization.git
name age message
file .gitignore Thu Feb 12 21:48:57 -0800 2009 Ignore dist/ [sr]
file README.rdoc Thu Mar 19 12:57:34 -0700 2009 Update README [sr]
file Rakefile Thu Mar 19 12:58:10 -0700 2009 Use MG to manage release; simplify test task [sr]
directory lib/ Thu Mar 19 12:57:23 -0700 2009 Be a proper Sinatra extension [sr]
file sinatra-authorization.gemspec Thu Mar 19 13:31:49 -0700 2009 Update gemspec; 1.0.0 release [sr]
directory test/ Thu Mar 19 12:57:34 -0700 2009 Replace Sinatra::Test by Rack::Test [sr]
README.rdoc

Sinatra Authorization

HTTP Authorization helpers for Sinatra.

Example

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