t.w.a.d.DigestCredentialFactory(object) : class documentation

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

Implements interfaces: twisted.web2.auth.interfaces.ICredentialFactory

Support for RFC2617 HTTP Digest Authentication
Instance VariablesprivateKeyA random string used for generating the secure opaque.
Class VariablesCHALLENGE_LIFETIME_SECSThe number of seconds for which an opaque should be valid.
Method __init__ No summary
Method generateNonce Undocumented
Method generateOpaque Generate an opaque to be returned to the client. This should be a unique string that can be returned to us and verified.
Method verifyOpaque Given the opaque and nonce from the request, as well as the clientip that made the request, verify that the opaque was generated by us. And that it's not too old.
Method getChallenge Generate the challenge for use in the WWW-Authenticate header
Method decode Decode the given response and attempt to generate a DigestedCredentials from it.
Method _getTime Parameterize the time based seed used in generateOpaque so we can deterministically unittest it's behavior.
def __init__(self, algorithm, realm): (source)
Parametersalgorithmcase insensitive string that specifies the hash algorithm used, should be either, md5, md5-sess or sha (type: str )
realmcase sensitive string that specifies the realm portion of the challenge (type: str )
def generateNonce(self): (source)
Undocumented
def _getTime(self): (source)
Parameterize the time based seed used in generateOpaque so we can deterministically unittest it's behavior.
def generateOpaque(self, nonce, clientip): (source)
Generate an opaque to be returned to the client. This should be a unique string that can be returned to us and verified.
def verifyOpaque(self, opaque, nonce, clientip): (source)
Given the opaque and nonce from the request, as well as the clientip that made the request, verify that the opaque was generated by us. And that it's not too old.
ParametersopaqueThe opaque value from the Digest response
nonceThe nonce value from the Digest response
clientipThe remote IP address of the client making the request
ReturnsTrue if the opaque was successfully verified.
Raiseserror.LoginFailedif opaque could not be parsed or contained the wrong values.
def getChallenge(self, peer): (source)
Generate the challenge for use in the WWW-Authenticate header
ParameterspeerThe IAddress of the requesting client.
ReturnsThe dict that can be used to generate a WWW-Authenticate header.
def decode(self, response, request): (source)
Decode the given response and attempt to generate a DigestedCredentials from it.
ParametersresponseA string of comma seperated key=value pairs (type: str )
requestthe request being processed (type: twisted.web2.server.Request )
ReturnsDigestedCredentials
Raiseserror.LoginFailed if the response does not contain a username, a nonce, an opaque, or if the opaque is invalid.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:02:37.