HTTPAuthSessionWrapper can't protect child nodes of a Site

[email protected] Fri, 11 Sep 2009 04:25:22 -0000
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from unshift <[email protected]>:

When using twisted.guard.HTTPAuthSessionWrapper to guard child nodes of my Site object, rendering raises a NotImplementedException instead of calling the render method of the protected resource.

For more information, see: http://twistedmatrix.com/pipermail/twisted-web/2009-July/004215.html

My code in particular is something like:

{{{
    ...
    siteRoot = Resource()
    siteRoot.isLeaf = False

    
    jobWrapper = guard.HTTPAuthSessionWrapper(Portal(JobRealm(), [JobDBChecker(db)]), [guard.BasicCredentialFactory("foo realm")])
    siteRoot.putChild("job", jobWrapper)
}}}

However POSTs and GETs to /job result in NotImplementedExceptions, because the request is handled in HTTPAuthSessionWrapper and not passed through to JobRealm's avatar.

According to an IRC conversation this should work if the root node at /job has no render methods and I only call /job/''child'' entities, though I haven't confirmed this.

----------
Type     : defect
Component: web
Keywords : 
Priority : normal
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/4014