Package cherrypy :: Package lib :: Module auth
[hide private]
[frames] | no frames]

Module auth

source code

Functions [hide private]
 
check_auth(users, encrypt=None, realm=None)
If an authorization header contains credentials, return True, else False.
source code
 
basic_auth(realm, users, encrypt=None)
If auth fails, raise 401 with a basic authentication header.
source code
 
digest_auth(realm, users)
If auth fails, raise 401 with a digest authentication header.
source code
Function Details [hide private]

basic_auth(realm, users, encrypt=None)

source code 
If auth fails, raise 401 with a basic authentication header.

realm: a string containing the authentication realm.
users: a dict of the form: {username: password} or a callable returning a dict.
encrypt: callable used to encrypt the password returned from the user-agent.
         if None it defaults to a md5 encryption.

digest_auth(realm, users)

source code 

If auth fails, raise 401 with a digest authentication header.

realm: a string containing the authentication realm. users: a dict of the form: {username: password} or a callable returning a dict.