[Twisted-Python] Getting my Cred interfaces right: IUsername(Hashed)?Password

Laurens Van Houtven _ at lvh.cc
Wed Nov 14 08:29:54 EST 2012

On Wed, Nov 14, 2012 at 1:29 PM, <exarkun at twistedmatrix.com> wrote:

>  This isn't right.  The point of declaring interfaces on the checker is
> so the system knows what kind of credentials it can check.  If your
> credentials object implements a different interface than your checker
> declares it can check, the system won't ever ask the checker to check
> the credentials.

Just to be clear: the thing being checked, i.e. the thing being provided by
the user when logging in, is just an IUsernamePassword. Hence, the
credentialInterfaces list on the ICredentialsChecker is [IUsernamePassword].

The only place where IUsernameHashedPassword comes in to play is storage,
i.e. the thing I am checking the user-provided IUsernamePassword against.

Maybe code is better: https://gist.github.com/4072062 (old.py is what it is
now, new.py is what I'm proposing)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20121114/23464cc8/attachment.htm 

More information about the Twisted-Python mailing list