The Query View for Authentication Utilities =========================================== A regular authentication service will not provide the `ISourceQueriables` interface, but it is a queriable itself, since it provides the simple `getPrincipals(name)` method: >>> class Principal: ... def __init__(self, id): ... self.id = id >>> class MyAuthUtility: ... data = {'jim': Principal(42), 'don': Principal(0), ... 'stephan': Principal(1)} ... ... def getPrincipals(self, name): ... return [principal ... for id, principal in self.data.items() ... if name in id] Now that we have our queriable, we create the view for it: >>> from zope.app.security.browser.auth import AuthUtilitySearchView >>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> view = AuthUtilitySearchView(MyAuthUtility(), request) This allows us to render a search form. >>> print view.render('test') # doctest: +NORMALIZE_WHITESPACE