[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/pluggableauth - __init__.py:1.1.2.1 configure.zcml:1.1.2.1

Zachery Bir zbir@urbanape.com
Tue, 3 Jun 2003 09:34:04 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/services/pluggableauth
In directory cvs.zope.org:/tmp/cvs-serv21295/src/zope/app/browser/services/pluggableauth

Added Files:
      Tag: pluggable_authentication_service-branch
	__init__.py configure.zcml 
Log Message:
In directory src/zope/app/browser/services/pluggableauth:

  - src/zope/app/browser/services/pluggableauth/__init__.py

    Adding override for the PluggableAuthenticationService

  - src/zope/app/browser/services/pluggableauth/configure.zcml

    Configuration for the views for PluggableAuthenticationService, 
    BTreePrincipalSource, and SimplePrincipal

    XXX: TODO: - contents.html view for PluggableAuthenticationService
                 and BTreePrincipalSource

               - get BTreePrincipalSource to actually have additional 
                 zmi_views to be more like a container, for example, it 
                 currently does not have a "Contents" tab

               - views for the login challenge

In directory src/zope/app/container:

  - src/zope/app/container/ordered.py

    Implementation of an OrderedContainer

In directory src/zope/app/container/tests:

  - src/zope/app/container/tests/test_ordered.py

    Test module for OrderedContainer (all tests currently in docstrings)

In directory src/zope/app/interfaces/container:

  - src/zope/app/interfaces/container/__init__.py

    Added interface for OrderedContainer

In directory src/zope/app/interfaces/services/pluggableauth:

  - src/zope/app/interfaces/services/pluggableauth/__init__.py

    Interfaces for PluggableAuthenticationService, Read/WritePrincipalSource,
    and UserSchemafied

In directory src/zope/app/services:

  - src/zope/app/services/configure.zcml

    Included the pluggableauth package

In directory src/zope/app/services/pluggableauth:

  - src/zope/app/services/pluggableauth/__init__.py

    Implementation of the PluggableAuthenticationService, BTreePrincipalSource,
    and SimplePrincipal classes

    XXX: TODO: - Wrap all returned items from getPrincipals() in both
                 PluggableAuthenticationService and BTreePrincipalSource
                 so that the ids being handed up are tuplified (in the case
                 of BTreePrincipalSource) and triplified (in the case of
                 PluggableAuthenticationService) to ensure proper uniquity

  - src/zope/app/services/pluggableauth/configure.zcml

    Content directives for the above

In directory src/zope/app/services/tests:

  - src/zope/app/services/tests/test_pluggableauth.py

    Test module for PluggableAuthenticationService, BTreePrincipalSource, and
    SimplePrincipal classes (all available tests currently in docstrings)

    XXX: TODO: - write unit tests for the ContextMethods to ensure proper
                 delegation of Authentication responsibility (perhaps 
                 functional tests, instead?)


=== Added File Zope3/src/zope/app/browser/services/pluggableauth/__init__.py ===
# For Views

from zope.app.browser.services.service import Adding
from zope.context import ContextSuper
from zope.app.interfaces.services.pluggableauth import IReadPrincipalSource
        
class PrincipalSourceAdding(Adding):
    """Adding subclass used for principal sources."""

    menu_id = "add_principal_source"

    def add(self, content):

        if not IReadPrincipalSource.isImplementedBy(content):
            raise TypeError("%s is not a readable principal source" % content)

        return ContextSuper(PrincipalSourceAdding, self).add(content)


=== Added File Zope3/src/zope/app/browser/services/pluggableauth/configure.zcml ===
<zopeConfigure xmlns="http://namespaces.zope.org/browser"
     xmlns:global_translation="http://namespaces.zope.org/gts">

<!-- Pluggable Authentication Service -->

<menuItem
     menu="add_service"
     for="zope.app.interfaces.container.IAdding"
     action="zope.app.services.PluggableAuthenticationService"
     title="Pluggable Authentication Service"
     description="A Pluggable Authentication Service"
     />

<page
     name="index.html" 
     for="zope.app.services.pluggableauth.IPluggableAuthenticationService"
     permission="zope.ManageServices" 
     class="zope.app.browser.container.contents.Contents"
     attribute="contents"
     />

<view
     name="+"  
     menu="zmi_actions" title="Add Source"
     for="zope.app.services.pluggableauth.IPluggableAuthenticationService"
     permission="zope.ManageContent"
     class="zope.app.browser.services.pluggableauth.PrincipalSourceAdding" >

    <page name="index.html" attribute="index"/>
    <page name="action.html" attribute="action"/>

</view>

<menu id="add_principal_source"
    title="Menu for adding new PrincipalSource."/>

<!-- Principal Source -->

<menuItem
    menu="add_principal_source"
    for="zope.app.interfaces.container.IAdding"
    action="zope.app.principalsources.BTreePrincipalSource"
    title="BTree Principal Source"
    description="BTree Principal Source"
    />

<page
     name="index.html" 
     for="zope.app.services.pluggableauth.IPrincipalSource"
     permission="zope.ManageServices" 
     class="zope.app.browser.container.contents.Contents"
     attribute="contents"
     />

<view
    name="+"  
    for="zope.app.services.pluggableauth.IPrincipalSource"
    permission="zope.ManageContent"
    class="zope.app.browser.container.adding.Adding"/>

<menuItem
    menu="zmi_actions" title="Add Principal"
    for="zope.app.services.pluggableauth.IPrincipalSource"
    action="+/AddPrincipalForm"
    />

<addform
    schema="zope.app.interfaces.services.pluggableauth.IUserSchemafied" 
    label="Add Simple User with details" 
    content_factory="zope.app.services.pluggableauth.SimplePrincipal" 
    arguments="login password title description" 
    fields="login password title description"
    name="AddPrincipalForm" 
    permission="zope.ManageContent" /> 

<editform 
    schema="zope.app.interfaces.services.pluggableauth.IUserSchemafied" 
    label="Edit User Information"     
    fields="login password title description"
    name="edit.html"        
    menu="zmi_views" title="Edit" 
    permission="zope.ManageContent" /> 

<!-- Principals -->

</zopeConfigure>