t.w._.w.HTTPAuthSessionWrapper(object) : class documentation

Part of twisted.web._auth.wrapper View Source View In Hierarchy

Implements interfaces: twisted.web.resource.IResource

Wrap a portal, enforcing supported header-based authentication schemes.
Instance Variables_portalThe Portal which will be used to retrieve IResource avatars.
_credentialFactoriesA list of ICredentialFactory providers which will be used to decode Authorization headers into ICredentials providers.
Method __init__ Initialize a session wrapper
Method render No summary
Method getChildWithDefault No summary
Method _login Get the IResource avatar for the given credentials.
Method _loginSucceeded Handle login success by wrapping the resulting IResource avatar so that the logout callback will be invoked when rendering is complete.
Method _loginFailed Handle login failure by presenting either another challenge (for expected authentication/authorization-related failures) or a server error page (for anything else).
Method _selectParseHeader Choose an ICredentialFactory from _credentialFactories suitable to use to decode the given Authenticate header.
def __init__(self, portal, credentialFactories): (source)
Initialize a session wrapper
ParametersportalThe portal that will authenticate the remote client (type: Portal )
credentialFactoriesThe portal that will authenticate the remote client based on one submitted ICredentialFactory (type: Iterable )
def render(self, request): (source)
Render a request. This is called on the leaf resource for a request. Render must return either a string, which will be sent to the browser as the HTML for the request, or server.NOT_DONE_YET. If NOT_DONE_YET is returned, at some point later (in a Deferred callback, usually) call request.write("<html>") to write data to the request, and request.finish() to send the data to the browser.
def getChildWithDefault(self, path, request): (source)
Inspect the Authorization HTTP header, and return a deferred which, when fired after successful authentication, will return an authorized Avatar. On authentication failure, an UnauthorizedResource will be returned, essentially halting further dispatch on the wrapped resource and all children
def _login(self, credentials): (source)
Get the IResource avatar for the given credentials.
ReturnsA Deferred which will be called back with an IResource avatar or which will errback if authentication fails.
def _loginSucceeded(self, (interface, avatar, logout)): (source)
Handle login success by wrapping the resulting IResource avatar so that the logout callback will be invoked when rendering is complete.
def _loginFailed(self, result): (source)
Handle login failure by presenting either another challenge (for expected authentication/authorization-related failures) or a server error page (for anything else).
def _selectParseHeader(self, header): (source)
Choose an ICredentialFactory from _credentialFactories suitable to use to decode the given Authenticate header.
ReturnsA two-tuple of a factory and the remaining portion of the header value to be decoded or a two-tuple of None if no factory can decode the header value.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:02:37.