[Zope-CVS] CVS: Products/PluggableAuthService/interfaces -
authservice.py:1.4.2.1
Zachery Bir
zbir at urbanape.com
Wed Feb 23 09:58:29 EST 2005
Update of /cvs-repository/Products/PluggableAuthService/interfaces
In directory cvs.zope.org:/tmp/cvs-serv12754/interfaces
Modified Files:
Tag: zbir_fixing_ids_branch
authservice.py
Log Message:
Initial go at removing id mangling from PAS. Plugins need some UI for
specifying an optional identifier, so they can work together if
necessary, so this effort is ongoing.
Also, I removed support for exact matching in searching, but will
probably add it back in, minus the assumption on demangling an id.
=== Products/PluggableAuthService/interfaces/authservice.py 1.4 => 1.4.2.1 ===
--- Products/PluggableAuthService/interfaces/authservice.py:1.4 Thu Jan 27 14:00:23 2005
+++ Products/PluggableAuthService/interfaces/authservice.py Wed Feb 23 09:57:59 2005
@@ -31,7 +31,7 @@
def getId():
""" Get the ID of the user.
-
+
o The ID can be used, at least from Python, to get the user from
the user's UserDatabase
"""
@@ -69,7 +69,7 @@
""" Specify the interface called out in AccessControl.User.BasicUserFolder
as the "Public UserFolder object interface":
-
+
o N.B: "enumeration" methods ('getUserNames', 'getUsers') are *not*
part of the contract! See IEnumerableUserFolder.
"""
@@ -98,100 +98,98 @@
o 'auth' is any credential information already extracted by
the caller
- o roles is the list of roles the caller
+ o roles is the list of roles the caller
"""
class IPluggableAuthService( IUserFolder ):
-
+
""" The full, default contract for the pluggable authentication service.
"""
-
+
def searchUsers(**kw):
-
- """ Search for users. Returns a sequence of dicts, each dict
- representing a user matching the query, with the keys
- 'userid','id', 'login', 'title', and 'principal_type', possibly among
- others. 'principal_type' is always 'user'.
-
+
+ """ Search for users. Returns a sequence of dicts, each dict
+ representing a user matching the query, with the keys
+ 'userid','id', 'login', 'title', and 'principal_type',
+ possibly among others. 'principal_type' is always 'user'.
+
Possible keywords include the following:
-
- o exact_match: boolean; forces an exact match on id (unused if id is not
- part of query)
-
+
o id: user id
-
+
o name: user name
-
- o max_results: an int (or value castable to int) indicating the maximum
- number of results the method should return
-
- o sort_by: the key in the user dictionary that should be used to sort
- the results
-
+
+ o max_results: an int (or value castable to int) indicating
+ the maximum number of results the method should return
+
+ o sort_by: the key in the user dictionary that should be used
+ to sort the results
+
o login: user login
"""
def searchGroups(**kw):
- """ Search for groups. Returns a sequence of dicts, each dict
- representing a group matching the query, with the keys
- 'groupid','id', 'title', and 'principal_type', possibly among
+ """ Search for groups. Returns a sequence of dicts, each dict
+ representing a group matching the query, with the keys
+ 'groupid','id', 'title', and 'principal_type', possibly among
others. 'principal_type' is always 'group'.
-
+
Possible keywords include the following:
-
- o exact_match: boolean; forces an exact match on id (unused if id is not
- part of query)
-
+
o id: user id
-
+
o name: user name
-
- o max_results: an int (or value castable to int) indicating the maximum
- number of results the method should return
-
- o sort_by: the key in the user dictionary that should be used to sort
- the results
+
+ o max_results: an int (or value castable to int) indicating
+ the maximum number of results the method should return
+
+ o sort_by: the key in the user dictionary that should be used
+ to sort the results
"""
def searchPrincipals(groups_first=False, **kw):
- """ Search for principals (users, groups, or both).
- Returns a sequence of dicts, each dict
- representing a principal (group or user) matching the query. groups
- will be represented with dictionaries as described in searchGroups,
- and users as described in searchUsers. Possible keywords include
- exact_match, id, name, max_results, sort_by, and login.
+ """ Search for principals (users, groups, or both). Returns a
+ sequence of dicts, each dict representing a principal (group
+ or user) matching the query. groups will be represented with
+ dictionaries as described in searchGroups, and users as
+ described in searchUsers. Possible keywords include id, name,
+ max_results, sort_by, and login.
"""
def updateCredentials(request, response, login, new_password):
"""Central updateCredentials method
- This method is needed for cases where the credentials storage and
- the credentials extraction is handled by different plugins. Example
- case would be if the CookieAuthHelper is used as a Challenge and
- Extraction plugin only to take advantage of the login page feature
- but the credentials are not stored in the CookieAuthHelper cookie
- but somewhere else, like in a Session.
+ This method is needed for cases where the credentials storage
+ and the credentials extraction is handled by different
+ plugins. Example case would be if the CookieAuthHelper is used
+ as a Challenge and Extraction plugin only to take advantage of
+ the login page feature but the credentials are not stored in
+ the CookieAuthHelper cookie but somewhere else, like in a
+ Session.
"""
def logout(REQUEST):
"""Publicly accessible method to log out a usera wrapper
- around resetCredentials that may implement some policy (the default
- implementation redirects to HTTP_REFERER)
+ around resetCredentials that may implement some policy (the
+ default implementation redirects to HTTP_REFERER)
"""
def resetCredentials(self, request, response):
- """Reset credentials by informing all active resetCredentials plugins
+ """Reset credentials by informing all active resetCredentials
+ plugins
"""
-# The IMutableUserFolder and IEnumerableFolder are not supported out-of-the-box
-# by the pluggable authentication service. These interfaces describe contracts
-# that other standard Zope user folders implement.
+# The IMutableUserFolder and IEnumerableFolder are not supported
+# out-of-the-box by the pluggable authentication service. These
+# interfaces describe contracts that other standard Zope user folders
+# implement.
class IMutableUserFolder( Interface ):
- """ Specify the interface called out in AccessControl.User.BasicUserFolder
- as the "Public UserFolder object interface":
-
+ """ Specify the interface called out in
+ AccessControl.User.BasicUserFolder as the
+ "Public UserFolder object interface":
+
o N.B: "enumeration" methods ('getUserNames', 'getUsers') are *not*
part of the contract! See IEnumerableUserFolder.
"""
More information about the Zope-CVS
mailing list