[Twisted-Python] Missing Interface?

Glyph Lefkowitz glyph at twistedmatrix.com
Fri Jul 31 01:23:47 EDT 2009


On Fri, Jul 31, 2009 at 12:31 AM, Kevin Horn <kevin.horn at gmail.com> wrote:

> the following classes:
>
> twisted.cred.credentials.CramMD5Credentials
> twisted.mail.imap4.PLAINCredentials
> twisted.mail.imap4.LOGINCredentials
>
> all seem to implement the same interface, yet there is no Interface defined
> for these objects.
>

It would be great if there were such an interface.

"But Kevin", you might be thinking, "They all implement
> twisted.cred.credentials.IUsernameHashedPassword or
> t.c.c.IUsernamePassword".  That's true, but they all have additional methods
> which make them useful for handling SASL authentication in various
> protocols.  And those methods aren't included in those interfaces.
>

Aaah, SASL.  There has been *quite* a bit of discussion of this, which
resulted in a branch that looked near completion but eventually stalled,
here:  http://twistedmatrix.com/trac/ticket/2015

I don't think that unifying this interface would *necessarily* require the
resolution of this ticket, but it would at least be useful to see where
things have been.

So, should there be an Interface which describes the interface that these
> objects implement?


Sounds good to me, but then, I haven't done a lot of work with SASL.


> And why are two of these in the IMAP package and the third in cred?  Why
> not in the same place?
>

LOGIN and PLAIN authentication methods were implemented specifically for
IMAP, since as with all things IMAP it had special requirements.  The
general idea of hashed passwords was around before that in cred, but as you
can see in the changeset that introduced it —
http://twistedmatrix.com/trac/changeset/8290 — something was apparently
(and, I suspect, naughtily) expecting to call moreChallenges and setResponse
on an IUsernameHashedPassword.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090731/5c8335e2/attachment-0001.htm 


More information about the Twisted-Python mailing list