Re: circuits.web and http-auth

16 views
Skip to first unread message

James Mills

unread,
Mar 14, 2013, 7:19:10 PM3/14/13
to Matt Schmidt, circuit...@googlegroups.com
Hi Mat,,

I'll take a look ant provide a clear response tonight!

Thanks for getting in touch!

cheers
James 



On Fri, Mar 15, 2013 at 3:47 AM, Matt Schmidt <ma...@mattptr.net> wrote:
Hi James, 

I believe I've come up with something similar to the circumstances in the blog post I made last year. As I was thinking about it more, I really couldn't remember what the project was that I was working on when I decided to try circuits. I was hoping I had it in a repository somewhere, but it doesn't seem so.


What I'm attempting to do is have the Admin controller require Auth, but let the Root controller stay open. I pieced it together from memory and the different examples in the repository.

Obviously, if I wanted to include the Root controller as part of what requires Auth, I'd include Auth() in the component chain on line 40. What I did seems to have the same effect.

And one weird thing I encountered, initializing Server(8000) seemed to bind the server socket to my LAN IP address, rather than the loopback. Nothing major, but worth noting. Without the debugger on, I wouldn't have picked up on it.

Today I'm testing on a Mac 10.7.5, Python 2.7.3, and circuits 2.1.0. Please take a look and let me know what I've got wrong. Thanks!

Matt Schmidt

unread,
Mar 14, 2013, 1:47:35 PM3/14/13
to James Mills, circuit...@googlegroups.com

James Mills

unread,
Mar 14, 2013, 8:28:12 PM3/14/13
to Matt Schmidt, circuit...@googlegroups.com
Ahh I see what you're trying to do.

Something like this should work: http://codepad.org/N9Nsx7qi
(It's at least one way).

This works by filtering the request path and passing to
Auth() the path you want to match. Very naive, but works.

I tested this little example on circuits-dev with elinks. (2.1.0 shoudl be fine too)

What do you think?

cheers
James
On Fri, Mar 15, 2013 at 3:47 AM, Matt Schmidt <ma...@mattptr.net> wrote:
Reply all
Reply to author
Forward
0 new messages