t.w.a.w.HTTPAuthResource(object) : class documentation

Part of twisted.web2.auth.wrapper View Source View In Hierarchy

Implements interfaces: twisted.web2.iweb.IResource

I wrap a resource to prevent it being accessed unless the authentication can be completed using the credential factory, portal, and interfaces specified.
Method __init__
Method login
Method authenticate Attempt to authenticate the givin request
Method locateChild Authenticate the request then return the self.wrappedResource and the unmodified segments.
Method renderHTTP Authenticate the request then return the result of calling renderHTTP on self.wrappedResource
Method _loginSucceeded Callback for successful login.
Method _loginFailed Errback for failed login.
def __init__(self, wrappedResource, credentialFactories, portal, interfaces): (source)
ParameterswrappedResourceA twisted.web2.iweb.IResource to be returned from locateChild and render upon successful authentication.
credentialFactoriesA list of instances that implement ICredentialFactory. (type: list )
portalPortal to handle logins for this resource. (type: twisted.cred.portal.Portal )
interfacesthe interfaces that are allowed to log in via the given portal (type: tuple )
def _loginSucceeded(self, avatar, request): (source)
Callback for successful login.
ParametersavatarA tuple of the form (interface, avatar) as returned by your realm.
requestIRequest that encapsulates this auth attempt.
Returnsthe IResource in self.wrappedResource
def _loginFailed(self, result, request): (source)
Errback for failed login.
ParametersresultFailure returned by portal.login
requestIRequest that encapsulates this auth attempt.
ReturnsA Failure containing an HTTPError containing the UnauthorizedResponse if result is an UnauthorizedLogin or UnhandledCredentials error
def login(self, factory, response, request): (source)
ParametersfactoryAn ICredentialFactory that understands the given response.
responseThe client's authentication response as a string.
requestThe request that prompted this authentication attempt.
ReturnsA Deferred that fires with the wrappedResource on success or a failure containing an UnauthorizedResponse
def authenticate(self, request): (source)
Attempt to authenticate the givin request
ParametersrequestAn IRequest to be authenticated.
def locateChild(self, request, seg): (source)
Authenticate the request then return the self.wrappedResource and the unmodified segments.
def renderHTTP(self, request): (source)
Authenticate the request then return the result of calling renderHTTP on self.wrappedResource
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:02:37.