c.l.w.a.LaunchpadLoginSource : class documentation

Part of canonical.launchpad.webapp.authentication View In Hierarchy

Implements interfaces: canonical.launchpad.webapp.interfaces.IPlacelessLoginSource

A login source that uses the launchpad SQL database to look up principal information.
Method getPrincipal Return an ILaunchpadPrincipal for the account with the given id.
Method getPrincipals Not implemented.
Method getPrincipalByLogin Return a principal based on the account with the email address
Method _principalForAccount Return a LaunchpadPrincipal for the given account.
def getPrincipal(self, id, access_level=AccessLevel.WRITE_PRIVATE, scope=None):
Return an ILaunchpadPrincipal for the account with the given id.

Return None if there is no account with the given id.

The access_level can be used for further restricting the capability of the principal. By default, no further restriction is added.

Similarly, when a scope is given, the principal's capabilities will apply only to things within that scope. For everything else that is not private, the principal will have only read access.

Note that we currently need to be able to retrieve principals for invalid People, as the login machinery needs the principal to validate the password against so it may then email a validation request to the user and inform them it has done so.

def getPrincipals(self, name):
Not implemented.

Get principals with matching names. See zope.app.pluggableauth.interfaces.IPrincipalSource

def getPrincipalByLogin(self, login, access_level=AccessLevel.WRITE_PRIVATE, scope=None, want_password=True):
Return a principal based on the account with the email address
signified by "login".

:param want_password: If want_password is False, the pricipal
will have None for a password. Use this when trying to retrieve a
principal in contexts where we don't need the password and the
database connection does not have access to the Account or
AccountPassword tables.

:return: None if there is no account with the given email address.

The `access_level` can be used for further restricting the capability
of the principal.  By default, no further restriction is added.

Similarly, when a `scope` is given, the principal's capabilities will
apply only to things within that scope.  For everything else that is
not private, the principal will have only read access.


Note that we currently need to be able to retrieve principals for
invalid People, as the login machinery needs the principal to
validate the password against so it may then email a validation
request to the user and inform them it has done so.
def _principalForAccount(self, account, access_level, scope, want_password=True):
Return a LaunchpadPrincipal for the given account.

The LaunchpadPrincipal will also have the given access level and scope.

If want_password is True, the principal's password will be set to the account's password. Otherwise it's set to None.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.