Table of Contents

Class: Identity Twisted-0.18.0/twisted/cred/identity.py

An identity, with different methods for verification.

An identity represents a user's permissions with a particular application. It is a username, a password, and a collection of Perspective/Service name pairs, each of which is a perspective that this identity is allowed to access.

Methods   
__init__
addKeyByString
addKeyForPerspective
challenge
getAllKeys
removeKey
requestPerspectiveForKey
requestPerspectiveForService
setAlreadyHashedPassword
setPassword
verifyPassword
verifyPlainPassword
  __init__ 
__init__ (
        self,
        name,
        application,
        )

Create an identity.

I must have a name, and a backreference to the Application that the Keys on my keyring make reference to.

Exceptions   
TypeError
  addKeyByString 
addKeyByString (
        self,
        serviceName,
        perspectiveName,
        )

Put a key on my keyring.

This key will give me a token to access to some service in the future.

  addKeyForPerspective 
addKeyForPerspective ( self,  perspective )

Add a key for the given perspective.

  challenge 
challenge ( self )

I return some random data.

This is a method in addition to the module-level function because it is anticipated that we will want to change this to store salted passwords.

  getAllKeys 
getAllKeys ( self )

Returns a list of all services and perspectives this identity can connect to.

This returns a sequence of keys.

  removeKey 
removeKey (
        self,
        serviceName,
        perspectiveName,
        )

Remove a key from my keyring.

If this key is not present, raise KeyError.

  requestPerspectiveForKey 
requestPerspectiveForKey (
        self,
        serviceName,
        perspectiveName,
        )

Get a perspective request (a Deferred) for the given key.

If this identity does not have access to the given (serviceName, perspectiveName) pair, I will raise KeyError.

  requestPerspectiveForService 
requestPerspectiveForService ( self,  serviceName )

Get the first available perspective for a given service.

  setAlreadyHashedPassword 
setAlreadyHashedPassword ( self,  cyphertext )

(legacy) Set a password for this identity, already md5 hashed.

  setPassword 
setPassword ( self,  plaintext )

  verifyPassword 
verifyPassword (
        self,
        challenge,
        hashedPassword,
        )

Verify a challenge/response password.

  verifyPlainPassword 
verifyPlainPassword ( self,  plaintext )

Verify plain text password.

This is insecure, but necessary to support legacy protocols such as IRC, POP3, HTTP, etc.


Table of Contents

This document was automatically generated on Sat Jun 1 22:28:42 2002 by HappyDoc version 2.0