https://github.com/integrity/sinatra-authorization
HTTP Authorization helpers for Sinatra
https://github.com/integrity/sinatra-authorization
Last synced: about 1 year ago
JSON representation
HTTP Authorization helpers for Sinatra
- Host: GitHub
- URL: https://github.com/integrity/sinatra-authorization
- Owner: integrity
- Created: 2009-03-19T20:00:41.000Z (over 17 years ago)
- Default Branch: master
- Last Pushed: 2013-12-27T13:25:56.000Z (over 12 years ago)
- Last Synced: 2025-04-24T22:24:08.701Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 130 KB
- Stars: 73
- Watchers: 3
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
- awesome-sinatra - Sinatra Authorization - HTTP Authorization helpers for Sinatra. (Authroization)
README
= 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