Ñò
ô†³Kc @ sö d Z d d k l Z d d k Ty d d k l Z Wn# e j
o d d k l Z n Xd d k Z d d k Z d „ Z d e
f d „ ƒ YZ d e
f d
„ ƒ YZ e Z
d d g Z d „ Z d
e j o# d d k Z e i d e i ƒ n d S( s
Digest HTTP/1.1 Authentication
This module implements ``Digest`` authentication as described by
RFC 2617 [1]_ .
Basically, you just put this module before your application, and it
takes care of requesting and handling authentication requests. This
module has been tested with several common browsers "out-in-the-wild".
>>> from paste.wsgilib import dump_environ
>>> from paste.httpserver import serve
>>> # from paste.auth.digest import digest_password, AuthDigestHandler
>>> realm = 'Test Realm'
>>> def authfunc(environ, realm, username):
... return digest_password(realm, username, username)
>>> serve(AuthDigestHandler(dump_environ, realm, authfunc))
serving on...
This code has not been audited by a security expert, please use with
caution (or better yet, report security holes). At this time, this
implementation does not provide for further challenges, nor does it
support Authentication-Info header. It also uses md5, and an option
to use sha would be a good thing.
.. [1] http://www.faqs.org/rfcs/rfc2617.html
iÿÿÿÿ( t HTTPUnauthorized( t *( t md5Nc C s t d | | | f ƒ i ƒ S( s; construct the appropriate hashcode needed for HTTP digest s %s:%s:%s( R t hexdigest( t realmt usernamet password( ( s5 /usr/lib/python2.6/site-packages/paste/auth/digest.pyt digest_password( s t AuthDigestAuthenticatorc B s; e Z d Z d „ Z d d „ Z d „ Z d „ Z e Z RS( s9 implementation of RFC 2617 - HTTP Digest Authentication c C s h | _ | | _ | | _ d S( N( t noncet authfuncR ( t selfR R
( ( s5 /usr/lib/python2.6/site-packages/paste/auth/digest.pyt __init__. s t c C s÷ t d t i ƒ t i ƒ f ƒ i ƒ } t d t i ƒ t i ƒ f ƒ i ƒ } d | i |