[albatross-users] Login.py second draft

Eric S. Johansson esj at harvee.org
Tue Sep 16 09:13:10 EST 2003


knocked in this out this afternoon.  Got no answer on the python newsgroup about 
authenticating against your own password file in a portable fashion.  It is a 
difficult problem that hasn't itched anyone enough.

You will notice (if you read the code) that I have added a second class for 
dealing with another password file.  It's basically the same type of code as I 
used for white list management so I felt pretty good taking it as a 
cut-and-paste inheritance.  It also counts on an external program called 
portalocker which is probably similar to portaloo.  It gives you portable file 
locking on many types of UNIX, Linux, and Windows.  I try to be very 
conservative about locking files which unfortunately costs performance. 
Fortunately this code isn't critical path.

Critique would be nice as I'm always trying to improve what I write.

now, I am puzzling over how to integrate this login code with albatross. 
Ideally there should be little or no impact.  If there is no authentication 
token or the token has expired, put up the login screen, repeatedly until they 
succeed.  then return control to the desired screen by the user hopefully with 
all stored values intact.

It might be possible to put this all as an alternative path to page_display and 
once it succeeds, page_display is called but only if you can guarantee that none 
of the other processing methods get called.

but what do I know.  I haven't spent anytime with the albatross source.  I'm 
only guessing from observed behavior.  all I hope for is that this code or some 
variant thereof will find its way into albatross.

---eric



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: login.py
URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20030915/dc088531/attachment.ksh>


More information about the Albatross-users mailing list