[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - BasicVFSAuthAdapter.py:1.1.2.1 security.zcml:1.1.2.3.6.1
Stephan Richter
srichter@cbu.edu
Wed, 10 Apr 2002 05:31:25 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv23463/lib/python/Zope/App/Security
Modified Files:
Tag: Zope3-Server-Branch
security.zcml
Added Files:
Tag: Zope3-Server-Branch
BasicVFSAuthAdapter.py
Log Message:
Okay, it finally works! We have a Publisher FTP server again. All the basic
functionalitry is there, from dir listing, file transfer to security.
I punted for now on recognizing file endings, since Jim wants to write a
proposal for that next week. Also, I did not solve the statistical file
information problem, since this takes some more research.
=== Added File Zope3/lib/python/Zope/App/Security/BasicVFSAuthAdapter.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.
#
##############################################################################
# HTTP Basic Authentication adapter
from Zope.Publisher.VFS.IVFSCredentials import IVFSCredentials
from LoginPassword import LoginPassword
class BasicVFSAuthAdapter(LoginPassword):
__used_for__ = IVFSCredentials
__request = None
def __init__(self, request):
self.__request = request
# XXX base64 decoding should be done here, not in request
lpw = request._authUserPW()
if lpw is None:
login, password = None, None
else:
login, password = lpw
LoginPassword.__init__(self, login, password)
def needLogin(self, realm):
self.__request.unauthorized("Did not work")
=== Zope3/lib/python/Zope/App/Security/security.zcml 1.1.2.3 => 1.1.2.3.6.1 ===
for="Zope.Publisher.HTTP.IHTTPCredentials." />
+<adapter factory="Zope.App.Security.BasicVFSAuthAdapter."
+ provides="Zope.App.Security.ILoginPassword."
+ for="Zope.Publisher.VFS.IVFSCredentials." />
<!-- Role-Permission management view -->