twisted.cred.checkers.InMemoryUsernamePasswordDatabaseDontUse(object) class documentationtwisted.cred.checkers
(View In Hierarchy)
Implements interfaces: twisted.cred.checkers.ICredentialsChecker
An extremely simple credentials checker.
This is only of use in one-off test programs or examples which don't want to focus too much on how credentials are verified.
You really don't want to use this for anything else.  It is, at best, a 
toy.  If you need a simple credentials checker for a real application, see 
FilePasswordDB.
| Class Variable | credentialInterfaces | Tuple of IUsernamePasswordandIUsernameHashedPassword. | 
| Instance Variable | users | Mapping of usernames to passwords. (type: dictmappingbytestobytes) | 
| Method | __init__ | Initialize the in-memory database. | 
| Method | addUser | Set a user's password. | 
| Method | requestAvatarId | Validate credentials and produce an avatar ID. | 
| Method | _cbPasswordMatch | Undocumented | 
Initialize the in-memory database.
For example:
   db = InMemoryUsernamePasswordDatabaseDontUse(
       user1=b'sesame',
       user2=b'hunter2',
   )
| Parameters | users | Usernames and passwords to seed the database with. Each username given as a
keyword is encoded to bytesas ASCII. Passwords must be given asbytes. (type:dictofstrtobytes) | 
Validate credentials and produce an avatar ID.
| Parameters | credentials | something which implements one of the interfaces in credentialInterfaces. | 
| Returns | a Deferredwhich will fire with abytesthat identifies an avatar, an empty tuple to specify an authenticated 
anonymous user (provided astwisted.cred.checkers.ANONYMOUS)
or fail withUnauthorizedLogin.
Alternatively, return the result itself. | |
| See Also | twisted.cred.credentials | |