Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Reza Lotun
Hi Chris, > Automatic daemonization and monitoring? This sounds like exactly what I'm > after. > > I've been calling twisted like so for a project: explicitly setting > the process id, logger and source file here. And relying on a separate > cron script to check if all is well: > > twistd --pidfi

Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Chris Adams
Thanks Reza, > Generally it looks fine - but I should mention these random snippets > of code were given with the assumption that a .tac file is being used. > A .tac file is basically a "runner" script or driver for your twisted > program - it works in conjunction with the twistd command-line util

Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Reza Lotun
Hi Chris, > My annotated example is also up on github - http://gist.github.com/169102 > > > The original on twisted matrix > http://twistedmatrix.com/projects/web/documentation/examples/webguard.py Generally it looks fine - but I should mention these random snippets of code were given with the as

Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Chris Adams
Wow, thanks fo the quick replies guys. I've tried to combine this with the example earlier, with some annotations as to what I think is going on, but I'm on somewhat shaky ground here. Do these annotations sum up roughly what is going on here? My annotated example is also up on github - http://g

Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Reza Lotun
Hi Colin, > Where is Portal and SimpleRealm in your example? Those are actually quite > large constructs which are crucial to guard doing anything useful at all. Sorry, this snippet of code I wrote tracked the webguard.py example that I linked to. from twisted.cred.portal import IRealm, Portal

Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Colin Alston
On Mon, Aug 17, 2009 at 11:45 AM, Reza Lotun wrote: > The short answer is that you need to use twisted.cred. You don't need to do that at all, it just happens to be the best way. > wrapper = guard.HTTPAuthSessionWrapper( >Portal(SimpleRealm(), checkers), >

Re: [Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Reza Lotun
Hi Chris, > I'm using twisted-web on an openwrt computer, using busybox, and after > looking through the docs, I'm a little unclear about how to implement > something like apache's htpasswd style authentication. > > Using apache, I'd do something like: > > htpasswd -c passwrods admin topSecretPass

[Twisted-Python] How to do basic authentication on twisted web

2009-08-17 Thread Chris Adams
Hi there, I'm new to twisted, so please excuse the noobish question, but: I'm using twisted-web on an openwrt computer, using busybox, and after looking through the docs, I'm a little unclear about how to implement something like apache's htpasswd style authentication. Using apache, I'd do somet