Package twisted :: Package enterprise :: Module dbcred :: Class DatabaseAuthorizer |
[frames | no frames]

## Class DatabaseAuthorizer

    Augmentation --+
                   |
    Accessor --+   |
               |   |
      Authorizer --+
                   |
                  DatabaseAuthorizer

A PyPgSQL authorizer for Twisted Cred

Method Summary
| `__init__(self, dbpool, serviceCollection)`
| `_cbIdentity(self, identData)`
| ``addEmptyIdentity`(self, identityName, hashedPassword, callback, errback)` Create an empty identity (no perspectives).
| ``addIdentity`(self, identity)` Store an identity in the database.
| ``addPerspective`(self, identityName, perspectiveName, serviceName, callback, errback)` Add a perspective by name to an identity.
| `changePassword(self, identityName, hashedPassword, callback, errback)`
| ``getIdentities`(self)` Get the identities in the db.
| ``getIdentityRequest`(self, name)` get the identity from the database with the specified name.
| ``getPerspectives`(self, identity_name)` Get the perspectives for an identity.
| ``getServices`(self)` Get the known services.
| ``removeIdentity`(self, identityName)` Delete an identity
| ``removePerspective`(self, identityName, perspectiveName, callback, errback)` Delete a perspective for an identity
Inherited from Authorizer
| ``createIdentity`(self, name)` Create an identity of an appropriate type for this Authorizer.
| ``get_application`(self)`
| ``getServiceNamed`(self, name)`
| ``setApplication`(self, app)` Set the application for this authorizer.
| ``setServiceCollection`(self, collection)` Set the service collection for this authorizer.
Inherited from Accessor
| ``__delattr__`(self, k)`
| ``__getattr__`(self, k)`
| ``__setattr__`(self, k, v)`
| ``reallyDel`(self, k)` *actually* del self.k without incurring side-effects.
| ``reallySet`(self, k, v)` *actually* set self.k to v without incurring side-effects.
Inherited from Augmentation
| ``__setstate__`(self, state)`
| ``createSchema`(self)`
| ``operationDone`(self, done)` Example callback for database operation success.
| ``operationError`(self, error)` Example callback for database operation failure.
| ``runInteraction`(self, interaction, *args, **kw)`
| ``runOperation`(self, *args, **kw)`
| ``runQuery`(self, *args, **kw)`
| ``schemaCreated`(self, result)`
| ``schemaNotCreated`(self, error)`

Instance Variable Summary
Inherited from Authorizer
`_AbstractServiceCollection` | `serviceCollection`: The set of services that are using this authorizer.

Class Variable Summary
`str` | `schema` = `'\n CREATE TABLE twisted_identities\n (\n...`

Method Details

### addEmptyIdentity(self, identityName, hashedPassword, callback=None, errback=None) Create an empty identity (no perspectives). Used by web admin interface.

### addIdentity(self, identity) Store an identity in the database. Overrides: `twisted.cred.authorizer.Authorizer.addIdentity`

### addPerspective(self, identityName, perspectiveName, serviceName, callback=None, errback=None) Add a perspective by name to an identity.

### getIdentities(self) Get the identities in the db. Used by web admin interface.

### getIdentityRequest(self, name) get the identity from the database with the specified name. Overrides: `twisted.cred.authorizer.Authorizer.getIdentityRequest`

### getPerspectives(self, identity_name) Get the perspectives for an identity. Used by the web admin interface.

### getServices(self) Get the known services. Used by the web admin interface.

### removeIdentity(self, identityName) Delete an identity Overrides: `twisted.cred.authorizer.Authorizer.removeIdentity`

### removePerspective(self, identityName, perspectiveName, callback=None, errback=None) Delete a perspective for an identity

Class Variable Details

    ### schema Type: `str` Value:
        '''
            CREATE TABLE twisted_identities
            (
              identity_name     varchar(64) PRIMARY KEY,
              password          varchar(64)
            );

            CREATE TABLE twisted_services
        ...

Generated by Epydoc 2.0 on Sat Oct 25 00:54:59 2003 | http://epydoc.sf.net