t.c.c.SSHPublicKeyDatabase : class documentation

Part of twisted.conch.checkers View Source View In Hierarchy

Implements interfaces: twisted.cred.checkers.ICredentialsChecker

Checker that authenticates SSH public keys, based on public keys listed in authorized_keys and authorized_keys2 files in user .ssh/ directories.
Method requestAvatarId
Method getAuthorizedKeysFiles Return a list of FilePath instances for authorized_keys files which might contain information about authorized keys for the given credentials.
Method checkKey Retrieve files containing authorized keys and check against user credentials.
Method _cbRequestAvatarId Check whether the credentials themselves are valid, now that we know if the key matches the user.
Method _ebRequestAvatarId Undocumented
def requestAvatarId(self, credentials): (source)
Parameterscredentialssomething which implements one of the interfaces in self.credentialInterfaces.
Returnsa Deferred which will fire a string which identifies an avatar, an empty tuple to specify an authenticated anonymous user (provided as checkers.ANONYMOUS) or fire a Failure(UnauthorizedLogin). Alternatively, return the result itself.
See Alsotwisted.cred.credentials
def _cbRequestAvatarId(self, validKey, credentials): (source)
Check whether the credentials themselves are valid, now that we know if the key matches the user.
ParametersvalidKeyA boolean indicating whether or not the public key matches a key in the user's authorized_keys file.
credentialsThe credentials offered by the user. (type: ISSHPrivateKey provider )
ReturnsThe user's username, if authentication was successful.
RaisesUnauthorizedLogin(as a failure) if the key does not match the user in credentials. Also raised if the user provides an invalid signature.
ValidPublicKey(as a failure) if the key matches the user but the credentials do not include a signature. See error.ValidPublicKey for more information.
def getAuthorizedKeysFiles(self, credentials): (source)

Return a list of FilePath instances for authorized_keys files which might contain information about authorized keys for the given credentials.

On OpenSSH servers, the default location of the file containing the list of authorized public keys is $HOME/.ssh/authorized_keys.

$HOME/.ssh/authorized_keys2 is also returned, though it has been deprecated by OpenSSH since 2001.
ReturnsA list of FilePath instances to files with the authorized keys.
def checkKey(self, credentials): (source)
Retrieve files containing authorized keys and check against user credentials.
def _ebRequestAvatarId(self, f): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.