mς KγΈEc@sKdZdkZdkZdfd„ƒYZd„Zdfd„ƒYZdS(s₯Base classes for defining an authentication protocol. Database -- abstract base class for password database Client -- abstract base class for authentication client NtClientcBstZgZd„ZRS(NcCs@||_x0|iD]%}t|i||ii|ƒƒqWdS(N(tstubtselft extensionstmtsetattrtextensionMethod(RRR((t,/data/zmath/zope/lib/python/ZEO/auth/base.pyt__init__s  (t__name__t __module__RR(((RRscCs|iƒ|S(s#Sort a list in-place and return it.N(tLtsort(R ((RR !s tDatabasecBsktZdZeZed„Zed„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z RS( sgAbstracts a password database. This class is used both in the authentication process (via get_password()) and by client scripts that manage the password database file. The password file is a simple, colon-separated text file mapping usernames to password hashes. The hashes are SHA hex digests produced from the password string. cCsrh|_||_|iƒ|oK|io4|i|jo$td|pd|ifƒ‚qn||_ndS(s2Creates a new Database filename: a string containing the full pathname of the password database file. Must be readable by the user running ZEO. Must be writeable by any client script that accesses the database. realm: the realm name (a string) s1Specified realm %r differs from database realm %rtN(Rt_userstfilenametloadtrealmt ValueError(RRR((RR2s    $c Csƒ|i}|pt|dƒ}n|io|dI|iIJnx8t|iiƒƒD]!}|d||i|fIJqZWdS(NtwRs%s: %s( RRtfdtopenRR Rtkeystusername(RRRR((RtsaveFs  cCsΰ|i}|pdSntii|ƒpdSnt|ƒ}|iƒ}|pdSn|di dƒo,|i dƒi ƒ}|t dƒ|_nx?|D]7}|i ƒiddƒ\}}|i ƒ|i|