[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/VFS - IFilesystemAccess.py:1.1.2.1 IUsernamePassword.py:1.1.2.1

Shane Hathaway shane@cvs.zope.org
Wed, 10 Apr 2002 17:59:23 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Server/VFS
In directory cvs.zope.org:/tmp/cvs-serv18340/VFS

Added Files:
      Tag: Zope3-Server-Branch
	IFilesystemAccess.py IUsernamePassword.py 
Log Message:
- Removed AlternateSocketMapMixin.  It was there to support multiple socket
maps, but if we really need multiple socket maps, it would be better to
change asyncore.  Had to update a lot of __init__ methods.

- Added IUsernamePassword and IFilesystemAccess, which provide a way to
implement all kinds of authentication schemes without FTP knowing about
any of the details.  Modified FTPServerChannel to work based on an
IFilesystemAccess object.

- Added detection of the ZOPE_SERVER_DEBUG env var.

- Added comments here and there.

- Fixed CRs :-)


=== Added File Zope3/lib/python/Zope/Server/VFS/IFilesystemAccess.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""

$Id: IFilesystemAccess.py,v 1.1.2.1 2002/04/10 21:59:22 shane Exp $
"""

from Interface import Interface

# XXX This interface should be in a more central location.

class IFilesystemAccess(Interface):
    """Provides authenticated access to a filesystem.
    """

    def authenticate(credentials):
        """Verifies filesystem access based on the presented credentials.

        Should raise Unauthorized if the user can not be authenticated.

        This method only checks general access and is not used for each
        call to open().  Rather, open() should do its own verification.
        """

    def open(credentials):
        """Returns an IReadFilesystem or IWriteFilesystem.

        Should raise Unauthorized if the user can not be authenticated.
        """


=== Added File Zope3/lib/python/Zope/Server/VFS/IUsernamePassword.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""

$Id: IUsernamePassword.py,v 1.1.2.1 2002/04/10 21:59:22 shane Exp $
"""

from Interface import Interface

# XXX These interfaces should be located in a more central location.
# (so I don't mind putting them together in one module for now ;-) )


class ICredentials(Interface):
    """Base interface for presentation of authentication credentials.

    Different kinds of credentials include username/password, client
    certificate, IP address and port, etc., including combinations.
    """


class IUsernamePassword(ICredentials):
    """A type of authentication credentials consisting of user name and
    password.  The most recognized form of credentials.
    """

    def getUserName():
        """Returns the user name presented for authentication.
        """

    def getPassword():
        """Returns the password presented for authentication.
        """