Hi All,
Inspired by Authkit (
http://authkit.org) and Merb Auth I was wondering
how a complete Rack based authentication and authorization framework
would help for Ruby web applications. I have come across many cases
where it is possible to abstract and re-use authentication, rather
than lock it to be application specific. So in my belief project to
improve and extend authentication of Rack could be beneficial to Ruby
community.
Here are the major features I wish to work on for Summer of Code.
1. Implement New Handlers (by extending Rack::Auth::AbstractHandler)
- Form based endpoint
- Cookie based authentication
- Single Sign on with Param (e.g. for API access)
- One custom handler as a sample (i.e. LDAP or Facebook Connect)
2. Support cascading authentication handlers (e.g. Could define to try
cookie first, then form and then param)
3. Build a unified key-value store (probably using moneta) to hold
credentials and roles.
4. Support storing data fields (i.e. password) by encrypting with a
defined encryption method and salt.
5. Implement generic and flexible authorization system
- Application route level authorization
e.g.:
/admin/* - requires admin role for all sub paths (role
based)
HTTPS - controlling scheme to be only used for paid account
users (I have written a similar middleware earlier -
http://tinyurl.com/db7jyr)
- pass the roles enabled for a user to application (e.g.
"rack.auth-roles" => ['writer', 'reviewer'])
- Render correct status codes on failure (401 - for
authentication failure, 403 - for authorization failure)
I would like to have your comments and suggestions on this idea.