[Twisted-Python] Re: +AFs-Twisted-Python+AF0- Re: +AFs-Twisted-commits+AF0- CVS: Twisted/twisted/python otp.py,NONE,1.1

Benjamin Bruheim grolgh at online.no
Thu Sep 6 14:01:40 EDT 2001

> To continue the trend of beating on poor Benjamin here, a few comments about
> twisted.python.otp... :-)

Oh, I can take it. It kinda stores up my shares for _my_ nasty replies later on ;)

> It seems oddly placed in twisted.python, maybe twisted.protocols would be
> better?  I know it's not a wire protocol, but it is an RFC implementation.

Well, it is selfcontained and is divided into two classes: one with service routines, 
and one which is a selfupdating password container. I can't say that I understand
what these should do in protocols, since they have nothing in common with any
of the other modules in protocols. It can also be used in a calculator as well, which
is the most popular usage of OTP :)

> It uses the same vocabulary as twisted.python.authenticator, which is hopefully
> being obseleted soon (by twisted.internet.passport)  Is that just a
> coincidence?  If not, it shouldn't; those classes have nothing to do with each
> other, and the parallels are very misleading.  Otherwise, leave the names as
> they are, since the other class will be removed soon.

I must admit that I used Authenticator as inspiration for finding names, but it does 
not work the same way at all. I think the parameters and docstrings should make 
that obvious.
I haven't looked into it yet, but I expect that some names may change if I 
add SASL-compliance.

> I applaud your effort to do testing, but could you please use the same testing
> style as the rest of Twisted, as in the twisted/test directory? :-)  Maybe that
> should be in the coding standard...

Hm, I kinda followed the "python-standard" there, but whatever fits :)

Some other issues: SMTP seems to use SASL authentication and I could write some
routines for OTP that can be used in SASL since it supports the OTP authentication
scheme. And there's one big flaw in OTP as well: When the sequence has run out 
(default is 1000 password issued) the sequence has to be reset, this is not done
automatically since this needs to be implemented in each protocol; or by an util
which has to be run on the serverside on a secure connection. 

More information about the Twisted-Python mailing list