zope.app.security-3.7.5/0000755000175000017500000000000011321726146014755 5ustar faassenfaassenzope.app.security-3.7.5/setup.cfg0000644000175000017500000000007311321726146016576 0ustar faassenfaassen[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.app.security-3.7.5/bootstrap.py0000644000175000017500000000337011321726135017345 0ustar faassenfaassen############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. $Id: bootstrap.py 73551 2007-03-25 09:14:36Z dobe $ """ import os, shutil, sys, tempfile, urllib2 tmpeggs = tempfile.mkdtemp() ez = {} exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) import pkg_resources cmd = 'from setuptools.command.easy_install import main; main()' if sys.platform == 'win32': cmd = '"%s"' % cmd # work around spawn lamosity on windows ws = pkg_resources.working_set assert os.spawnle( os.P_WAIT, sys.executable, sys.executable, '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse('setuptools')).location ), ) == 0 ws.add_entry(tmpeggs) ws.require('zc.buildout') import zc.buildout.buildout zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) shutil.rmtree(tmpeggs) zope.app.security-3.7.5/buildout.cfg0000644000175000017500000000074511321726135017271 0ustar faassenfaassen[buildout] parts = test checker coverage-test coverage-report develop = . [test] recipe = zc.recipe.testrunner eggs = zope.app.security [test] [checker] recipe = lovely.recipe:importchecker path = src/zope/app/security [coverage-test] recipe = zc.recipe.testrunner eggs = zope.app.security [test] defaults = ['--coverage', '../../coverage'] [coverage-report] recipe = zc.recipe.egg eggs = z3c.coverage scripts = coverage=coverage-report arguments = ('coverage', 'coverage/report') zope.app.security-3.7.5/src/0000755000175000017500000000000011321726146015544 5ustar faassenfaassenzope.app.security-3.7.5/src/zope/0000755000175000017500000000000011321726146016521 5ustar faassenfaassenzope.app.security-3.7.5/src/zope/__init__.py0000644000175000017500000000031011321726135020622 0ustar faassenfaassen# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.app.security-3.7.5/src/zope/app/0000755000175000017500000000000011321726146017301 5ustar faassenfaassenzope.app.security-3.7.5/src/zope/app/__init__.py0000644000175000017500000000031011321726135021402 0ustar faassenfaassen# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.app.security-3.7.5/src/zope/app/security/0000755000175000017500000000000011321726146021150 5ustar faassenfaassenzope.app.security-3.7.5/src/zope/app/security/tests/0000755000175000017500000000000011321726146022312 5ustar faassenfaassenzope.app.security-3.7.5/src/zope/app/security/tests/__init__.py0000644000175000017500000000140311321726134024416 0ustar faassenfaassen############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Security Tests $Id: __init__.py 97952 2009-03-12 03:23:55Z nadako $ """ from zope.security.testing import addCheckerPublic # BBB zope.app.security-3.7.5/src/zope/app/security/tests/test_interfaces.py0000644000175000017500000000413711321726134026050 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Test importability of BBB interfaces $Id: test_interfaces.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check that permission vocabularies that were moved to zope.security are still importable from original place. >>> import zope.app.security.interfaces as old >>> import zope.authentication.interfaces as new >>> old.PrincipalLookupError is new.PrincipalLookupError True >>> old.IUnauthenticatedPrincipal is new.IUnauthenticatedPrincipal True >>> old.IFallbackUnauthenticatedPrincipal is new.IFallbackUnauthenticatedPrincipal True >>> old.IUnauthenticatedGroup is new.IUnauthenticatedGroup True >>> old.IAuthenticatedGroup is new.IAuthenticatedGroup True >>> old.IEveryoneGroup is new.IEveryoneGroup True >>> old.IAuthentication is new.IAuthentication True >>> old.ILoginPassword is new.ILoginPassword True >>> old.IPrincipalSource is new.IPrincipalSource True >>> old.ILogout is new.ILogout True >>> old.ILogoutSupported is new.ILogoutSupported True >>> import zope.security.interfaces as new >>> old.IPrincipal is new.IPrincipal True >>> old.IPermission is new.IPermission True >>> old.IGroup is new.IGroup True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_permission.py0000644000175000017500000000253111321726134026111 0ustar faassenfaassen############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Doctests for 'permission' module. $Id: test_permission.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's test that backward-compatibility imports still work: >>> from zope.app.security import permission as old >>> from zope.app.localpermission import permission as new >>> old.NULL_ID is new.NULL_ID True >>> old.LocalPermission is new.LocalPermission True >>> old.setIdOnActivation is new.setIdOnActivation True >>> old.unsetIdOnDeactivation is new.unsetIdOnDeactivation True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/tests.py0000644000175000017500000000066111321726134024026 0ustar faassenfaassenimport os import zope.app.testing.functional import unittest here = os.path.realpath(os.path.dirname(__file__)) PermissionsLayer = zope.app.testing.functional.ZCMLLayer( os.path.join(here, "ftesting.zcml"), __name__, "PermissionsLayer") def test_suite(): suite = zope.app.testing.functional.FunctionalDocFileSuite( 'persistentlist.txt') suite.layer = PermissionsLayer return unittest.TestSuite([suite]) zope.app.security-3.7.5/src/zope/app/security/tests/persistentlist.txt0000644000175000017500000000350711321726134026151 0ustar faassenfaassen############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Persistent List functional tests. """ Let's check that we can access the data attribute of a proxied PersistentList. This is to accomodate UserList operations which are used when an isinstance call will correctly identify a persistent list as a UserList. Some configurations may get incorrect behavior currently, such that isinstance claims that a proxied UserList is not a UserList. For these configurations this should not make a difference. Because several UserList methods use this isinstance check before accessing the data attribute we will simply try to get the data attribute from a proxied example. >>> import persistent.list >>> import zope.security.tests.test_proxy >>> import zope.security.proxy >>> persistent_list = persistent.list.PersistentList() >>> proxied_list = zope.security.proxy.ProxyFactory( ... persistent_list) >>> proxied_list.data [] We'll do the same with a persistent dict, which follows the same behavior pattern with UserDict. >>> import persistent.dict >>> persistent_dict = persistent.dict.PersistentDict() >>> proxied_dict = zope.security.proxy.ProxyFactory( ... persistent_dict) >>> proxied_dict.data {} zope.app.security-3.7.5/src/zope/app/security/tests/ftesting.zcml0000644000175000017500000000043511321726134025023 0ustar faassenfaassen zope.app.security-3.7.5/src/zope/app/security/tests/test_ftpauth.py0000644000175000017500000000211711321726134025374 0ustar faassenfaassen############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """FTP Authentication Test $Id: test_ftpauth.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check if original imports still work: >>> import zope.app.security.ftpauth as old >>> import zope.publisher.ftp as new >>> old.FTPAuth is new.FTPAuth True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_principalregistry.py0000644000175000017500000000614711321726134027502 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Global Authentication Serive or Principal Registry Tests $Id: test_principalregistry.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check that principal registry that was moved to zope.principalregistry is still importable from original places. >>> import zope.app.security.principalregistry as old >>> import zope.principalregistry.principalregistry as new >>> old.DuplicateLogin is new.DuplicateLogin True >>> old.DuplicateId is new.DuplicateId True >>> old.PrincipalRegistry is new.PrincipalRegistry True >>> old.principalRegistry is new.principalRegistry True >>> old.PrincipalBase is new.PrincipalBase True >>> old.Group is new.Group True >>> old.Principal is new.Principal True >>> old.UnauthenticatedPrincipal is new.UnauthenticatedPrincipal True >>> old.fallback_unauthenticated_principal is new.fallback_unauthenticated_principal True >>> old.UnauthenticatedGroup is new.UnauthenticatedGroup True >>> old.AuthenticatedGroup is new.AuthenticatedGroup True >>> old.EverybodyGroup is new.EverybodyGroup True >>> import zope.app.security.metadirectives as old >>> import zope.principalregistry.metadirectives as new >>> old.IBasePrincipalDirective is new.IBasePrincipalDirective True >>> old.IDefinePrincipalDirective is new.IDefinePrincipalDirective True >>> old.IDefineUnauthenticatedPrincipalDirective is new.IDefineUnauthenticatedPrincipalDirective True >>> old.IDefineUnauthenticatedGroupDirective is new.IDefineUnauthenticatedGroupDirective True >>> old.IDefineAuthenticatedGroupDirective is new.IDefineAuthenticatedGroupDirective True >>> old.IDefineEverybodyGroupDirective is new.IDefineEverybodyGroupDirective True >>> import zope.app.security.metaconfigure as old >>> import zope.principalregistry.metaconfigure as new >>> old.principal is new.principal True >>> old.unauthenticatedPrincipal is new.unauthenticatedPrincipal True >>> old.unauthenticatedGroup is new.unauthenticatedGroup True >>> old.authenticatedGroup is new.authenticatedGroup True >>> old.everybodyGroup is new.everybodyGroup True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_logout.py0000644000175000017500000000217111321726134025232 0ustar faassenfaassen############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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: test_logout.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check if original imports still work: >>> import zope.app.security as old >>> import zope.authentication.logout as new >>> old.NoLogout is new.NoLogout True >>> old.LogoutSupported is new.LogoutSupported True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_basicauthadapter.py0000644000175000017500000000220411321726134027222 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Test Basic Authentication Adapter $Id: test_basicauthadapter.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check if original imports still work: >>> import zope.app.security.basicauthadapter as old >>> import zope.publisher.http as new >>> old.BasicAuthAdapter is new.BasicAuthAdapter True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_principal.py0000644000175000017500000000210611321726134025700 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Test bbb imports for checkPrincipal $Id: test_principal.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ >>> import zope.authentication.principal as new >>> import zope.app.security.principal as old >>> old.checkPrincipal is new.checkPrincipal True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_principallogging.py0000644000175000017500000000231611321726134027252 0ustar faassenfaassen############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Test for PrincipalLogging. $Id: test_principallogging.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check that permission vocabularies that were moved to zope.security are still importable from original place. >>> import zope.publisher.principallogging as new >>> import zope.app.security.principallogging as old >>> old.PrincipalLogging is new.PrincipalLogging True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_loginpassword.py0000644000175000017500000000230711321726134026615 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Test Login and Password $Id: test_loginpassword.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check that permission vocabularies that were moved to zope.security are still importable from original place. >>> import zope.authentication.loginpassword as new >>> import zope.app.security.loginpassword as old >>> old.LoginPassword is new.LoginPassword True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/tests/test_vocabulary.py0000644000175000017500000000262211321726134026071 0ustar faassenfaassen############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Permission vocabluary doc tests. $Id: test_vocabulary.py 106799 2009-12-20 04:50:49Z fafhrd $ """ import unittest from zope.testing import doctest def test_bbb_imports(): """ Let's check that permission vocabularies that were moved to zope.security are still importable from original place. >>> import zope.security.permission as new >>> import zope.app.security.vocabulary as old >>> old.PermissionsVocabulary is new.PermissionsVocabulary True >>> old.PermissionIdsVocabulary is new.PermissionIdsVocabulary True >>> import zope.authentication.principal as new >>> old.PrincipalSource is new.PrincipalSource True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), )) zope.app.security-3.7.5/src/zope/app/security/__init__.py0000644000175000017500000000152411321726135023261 0ustar faassenfaassen############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Zope Application-specific Security code $Id: __init__.py 97950 2009-03-12 03:14:02Z nadako $ """ # BBB: the code was moved to zope.authentication from zope.authentication.logout import LogoutSupported, NoLogout zope.app.security-3.7.5/src/zope/app/security/metadirectives.py0000644000175000017500000000217011321726135024530 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Backward-compatibility imports for the global principal registry directives $Id: metadirectives.py 106799 2009-12-20 04:50:49Z fafhrd $ """ # BBB: these were moved to zope.principalregistry from zope.principalregistry.metadirectives import ( IBasePrincipalDirective, IDefinePrincipalDirective, IDefineUnauthenticatedPrincipalDirective, IDefineUnauthenticatedGroupDirective, IDefineAuthenticatedGroupDirective, IDefineEverybodyGroupDirective, ) zope.app.security-3.7.5/src/zope/app/security/standardpermissions.zcml0000644000175000017500000000132311321726135026130 0ustar faassenfaassen zope.app.security-3.7.5/src/zope/app/security/vocabulary.py0000644000175000017500000000170511321726135023672 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward-compatibility imports for PrincipalSource and permission vocabularies. $Id: vocabulary.py 97943 2009-03-12 00:38:29Z nadako $ """ # BBB from zope.security.permission import PermissionsVocabulary from zope.security.permission import PermissionIdsVocabulary from zope.authentication.principal import PrincipalSource zope.app.security-3.7.5/src/zope/app/security/_protections.py0000644000175000017500000000140211321726135024225 0ustar faassenfaassen############################################################################## # # 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.1 (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: _protections.py 97950 2009-03-12 03:14:02Z nadako $ """ def protect(): pass # this function is not needed anymore zope.app.security-3.7.5/src/zope/app/security/ftpauth.py0000644000175000017500000000146011321726135023174 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward compatibility for the IFTPCredentials -> ILoginPassword adapter $Id: ftpauth.py 98044 2009-03-13 19:39:44Z nadako $ """ # BBB from zope.publisher.ftp import FTPAuth zope.app.security-3.7.5/src/zope/app/security/metaconfigure.py0000644000175000017500000000167511321726135024361 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Backward-compatibility imports for the global principal registry directives $Id: metaconfigure.py 97947 2009-03-12 02:31:26Z nadako $ """ from zope.principalregistry.metaconfigure import ( principal, unauthenticatedPrincipal, unauthenticatedGroup, authenticatedGroup, everybodyGroup, ) zope.app.security-3.7.5/src/zope/app/security/principal.py0000644000175000017500000000147111321726135023504 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward-compatibility import for the checkPrincipal function $Id: principal.py 97943 2009-03-12 00:38:29Z nadako $ """ # BBB from zope.authentication.principal import checkPrincipal zope.app.security-3.7.5/src/zope/app/security/globalmodules.zcml0000644000175000017500000003506411321726135024676 0ustar faassenfaassen > zope.app.security-3.7.5/src/zope/app/security/settings.py0000644000175000017500000000242011321726135023356 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Backward-compatibility import for security policy constants to allow unpickling of old pickled security settings. $Id: settings.py 97750 2009-03-10 00:47:21Z nadako $ """ try: from zope.securitypolicy.settings import Allow, Deny, Unset except ImportError: import logging logging.error('Allow, Unset and Deny constants are now ' 'moved from zope.app.security.settings to ' 'zope.securitypolicy.settings and you don\'t ' 'seem to have it installed. This is very rare ' 'case and you should manually install ' 'the ``zope.securitypolicy`` package.') zope.app.security-3.7.5/src/zope/app/security/protectclass.py0000644000175000017500000000210111321726135024220 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Backward compatibility: code was moved to zope.security.protectclass. $Id: protectclass.py 95310 2009-01-28 13:16:45Z brandon_rhodes $ """ from zope.security.checker import defineChecker, getCheckerForInstancesOf from zope.security.checker import Checker, CheckerPublic from zope.security.protectclass import (protectName, protectSetAttribute, protectLikeUnto) zope.app.security-3.7.5/src/zope/app/security/interfaces.py0000644000175000017500000000220211321726135023637 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward-compatibility imports for authentication interfaces $Id: interfaces.py 97943 2009-03-12 00:38:29Z nadako $ """ # BBB from zope.security.interfaces import IPrincipal, IPermission, IGroup from zope.authentication.interfaces import ( PrincipalLookupError, IUnauthenticatedPrincipal, IFallbackUnauthenticatedPrincipal, IUnauthenticatedGroup, IAuthenticatedGroup, IEveryoneGroup, IAuthentication, ILoginPassword, IPrincipalSource, ILogout, ILogoutSupported, ) zope.app.security-3.7.5/src/zope/app/security/loginpassword.py0000644000175000017500000000151011321726135024410 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward-compatibility import for base ILoginPassword implementation. $Id: loginpassword.py 97943 2009-03-12 00:38:29Z nadako $ """ # BBB from zope.authentication.loginpassword import LoginPassword zope.app.security-3.7.5/src/zope/app/security/configure.zcml0000644000175000017500000000062311321726135024017 0ustar faassenfaassen zope.app.security-3.7.5/src/zope/app/security/i18n.py0000644000175000017500000000130711321726135022300 0ustar faassenfaassen############################################################################## # # Copyright (c) 2007 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## import zope.i18nmessageid _ = zope.i18nmessageid.MessageFactory("zope") zope.app.security-3.7.5/src/zope/app/security/meta.zcml0000644000175000017500000000027211321726135022764 0ustar faassenfaassen zope.app.security-3.7.5/src/zope/app/security/permission.py0000644000175000017500000000175011321726135023713 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward compatibility imports for zope.app.localpermission. $Id: permission.py 98062 2009-03-13 23:49:38Z nadako $ """ __docformat__ = 'restructuredtext' # BBB: the functionality was moved to zope.app.localpermission from zope.app.localpermission.permission import ( NULL_ID, LocalPermission, setIdOnActivation, unsetIdOnDeactivation, ) zope.app.security-3.7.5/src/zope/app/security/browser/0000755000175000017500000000000011321726146022633 5ustar faassenfaassenzope.app.security-3.7.5/src/zope/app/security/browser/__init__.py0000644000175000017500000000131111321726132024733 0ustar faassenfaassen############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Security Views $Id: __init__.py 29365 2005-03-01 18:32:59Z sidnei $ """ zope.app.security-3.7.5/src/zope/app/security/browser/logout.pt0000644000175000017500000000174511321726132024513 0ustar faassenfaassen

Logout successful!

You are now logged out.

Back to the main page.
zope.app.security-3.7.5/src/zope/app/security/browser/tests.py0000644000175000017500000000237611321726132024352 0ustar faassenfaassen############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Security Views Tests $Id: tests.py 106799 2009-12-20 04:50:49Z fafhrd $ """ __docformat__ = "reStructuredText" import unittest from zope.testing import doctest def test_bbb_imports(): """ >>> import zope.app.security.browser.principalterms as old >>> import zope.authentication.principal as new >>> old.PrincipalTerms is new.PrincipalTerms True >>> old.Term is new.PrincipalTerm True """ def test_suite(): return unittest.TestSuite(( doctest.DocTestSuite(), doctest.DocFileSuite('authutilitysearchview.txt'), doctest.DocFileSuite('loginlogout.txt'), )) zope.app.security-3.7.5/src/zope/app/security/browser/loginlogout.txt0000644000175000017500000000502211321726132025730 0ustar faassenfaassen==================== Login/Logout Snippet ==================== The class LoginLogout: >>> from zope.app.security.browser.auth import LoginLogout is used as a view to generate an HTML snippet suitable for logging in or logging out based on whether or not the current principal is authenticated. When the current principal is unauthenticated, it provides IUnauthenticatedPrincipal: >>> from zope.authentication.interfaces import IUnauthenticatedPrincipal >>> from zope.principalregistry.principalregistry import UnauthenticatedPrincipal >>> anonymous = UnauthenticatedPrincipal('anon', '', '') >>> IUnauthenticatedPrincipal.providedBy(anonymous) True When LoginLogout is used for a request that has an unauthenticated principal, it provides the user with a link to 'Login': >>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> request.setPrincipal(anonymous) >>> LoginLogout(None, request)() u'[Login]' Logout, however, behaves differently. Not all authentication protocols (i.e. credentials extractors/challengers) support 'logout'. Furthermore, we don't know how an admin may have configured Zope's authentication. Our solution is to rely on the admin to tell us explicitly that the site supports logout. By default, the LoginLogout snippet will not provide a logout link for an unauthenticated principal. To illustrate, we'll first setup a request with an unauthenticated principal: >>> from zope.security.interfaces import IPrincipal >>> from zope.interface import implements >>> class Bob: ... implements(IPrincipal) ... id = 'bob' ... title = description = '' >>> bob = Bob() >>> IUnauthenticatedPrincipal.providedBy(bob) False >>> request.setPrincipal(bob) In this case, the default behavior is to return None for the snippet: >>> print LoginLogout(None, request)() None To show a logout prompt, an admin must register a marker adapter that provides the interface: >>> from zope.authentication.interfaces import ILogoutSupported This flags to LoginLogout that the site supports logout. There is a 'no-op' adapter that can be registered for this: >>> from zope.authentication.logout import LogoutSupported >>> from zope.component import provideAdapter >>> provideAdapter(LogoutSupported, (None,), ILogoutSupported) Now when we use LoginLogout with an unauthenticated principal, we get a logout prompt: >>> LoginLogout(None, request)() u'[Logout]' zope.app.security-3.7.5/src/zope/app/security/browser/redirect.pt0000644000175000017500000000222311321726132024773 0ustar faassenfaassen

You are being redirected!

If you see this screen for more than 5 seconds, click here.

zope.app.security-3.7.5/src/zope/app/security/browser/configure.zcml0000644000175000017500000000243611321726132025503 0ustar faassenfaassen zope.app.security-3.7.5/src/zope/app/security/browser/authutilitysearchview.pt0000644000175000017500000000113711321726132027643 0ustar faassenfaassen

principals.zcml

Search String
zope.app.security-3.7.5/src/zope/app/security/browser/auth.py0000644000175000017500000001162711321726132024150 0ustar faassenfaassen############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Login and Logout screens $Id: auth.py 97952 2009-03-12 03:23:55Z nadako $ """ import urllib from zope import component from zope.app.pagetemplate import ViewPageTemplateFile from zope.app.publisher.interfaces.http import ILogin from zope.authentication.interfaces import IAuthentication from zope.authentication.interfaces import IUnauthenticatedPrincipal from zope.authentication.interfaces import ILogout, ILogoutSupported from zope.i18n import translate from zope.interface import implements from zope.app.security.i18n import _ class AuthUtilitySearchView(object): template = ViewPageTemplateFile('authutilitysearchview.pt') searchTitle = u'principals.zcml' def __init__(self, context, request): self.context = context self.request = request def render(self, name): return self.template(title=self.searchTitle, name=name) def results(self, name): if not (name+'.search' in self.request): return None searchstring = self.request[name+'.searchstring'] return [principal.id for principal in self.context.getPrincipals(searchstring)] class HTTPAuthenticationLogin(object): implements(ILogin) confirmation = ViewPageTemplateFile('login.pt') failed = ViewPageTemplateFile('login_failed.pt') def login(self, nextURL=None): # we don't want to keep challenging if we're authenticated if IUnauthenticatedPrincipal.providedBy(self.request.principal): component.getUtility(IAuthentication).unauthorized( self.request.principal.id, self.request) return self.failed() else: if nextURL is None: return self.confirmation() else: self.request.response.redirect(nextURL) class HTTPBasicAuthenticationLogin(HTTPAuthenticationLogin): """Issues a challenge to the browser to get basic auth credentials. This view can be used as a fail safe login in the even the normal login fails because of an improperly configured authentication utility. The failsafeness of this view relies on the fact that the global principal registry, which typically contains an adminitrator principal, uses basic auth credentials to authenticate. """ def login(self, nextURL=None): # we don't want to keep challenging if we're authenticated if IUnauthenticatedPrincipal.providedBy(self.request.principal): # hard-code basic auth challenge self.request.unauthorized('basic realm="Zope"') return self.failed() else: if nextURL is None: return self.confirmation() else: self.request.response.redirect(nextURL) class HTTPAuthenticationLogout(object): """Since HTTP Authentication really does not know about logout, we are simply challenging the client again.""" implements(ILogout) confirmation = ViewPageTemplateFile('logout.pt') redirect = ViewPageTemplateFile('redirect.pt') def __init__(self, context, request): self.context = context self.request = request def logout(self, nextURL=None): if not IUnauthenticatedPrincipal.providedBy(self.request.principal): auth = component.getUtility(IAuthentication) ILogout(auth).logout(self.request) if nextURL: return self.redirect() if nextURL is None: return self.confirmation() else: return self.request.response.redirect(nextURL) class LoginLogout(object): def __init__(self, context, request): self.context = context self.request = request def __call__(self): if IUnauthenticatedPrincipal.providedBy(self.request.principal): return u'%s' % ( urllib.quote(self.request.getURL()), translate(_('[Login]'), context=self.request, default='[Login]')) elif ILogoutSupported(self.request, None) is not None: return u'%s' % ( urllib.quote(self.request.getURL()), translate(_('[Logout]'), context=self.request, default='[Logout]')) else: return None zope.app.security-3.7.5/src/zope/app/security/browser/principalterms.py0000644000175000017500000000156311321726132026241 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward-compatibility imports for principal terms $Id: principalterms.py 97943 2009-03-12 00:38:29Z nadako $ """ # BBB from zope.authentication.principal import PrincipalTerm as Term from zope.authentication.principal import PrincipalTerms zope.app.security-3.7.5/src/zope/app/security/browser/authutilitysearchview.txt0000644000175000017500000000344611321726132030044 0ustar faassenfaassen=========================================== 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

principals.zcml

Search String
If we ask for results: >>> view.results('test') We don't get any, since we did not provide any. But if we give input: >>> request.form['test.searchstring'] = 'n' we still don't get any: >>> view.results('test') because we did not press the button. So let's press the button: >>> request.form['test.search'] = 'Search' so that we now get results (!): >>> ids = list(view.results('test')) >>> ids.sort() >>> ids [0, 1] zope.app.security-3.7.5/src/zope/app/security/browser/login_failed.pt0000644000175000017500000000071711321726132025614 0ustar faassenfaassen

Login Failed!

You cancelled the login procedure. Click here to return.

zope.app.security-3.7.5/src/zope/app/security/browser/login.pt0000644000175000017500000000071711321726132024310 0ustar faassenfaassen

Login successful!

You are now logged in as Joe Smith.

Back to the main page.
zope.app.security-3.7.5/src/zope/app/security/basicauthadapter.py0000644000175000017500000000150211321726135025022 0ustar faassenfaassen############################################################################## # # Copyright (c) 2009 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward compatibility for the IHTTPCredentials -> ILoginPassword adapter $Id: basicauthadapter.py 107659 2010-01-04 21:55:37Z faassen $ """ # BBB from zope.login.http import BasicAuthAdapter zope.app.security-3.7.5/src/zope/app/security/principallogging.py0000644000175000017500000000153411321726135025053 0ustar faassenfaassen############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## """Backward-compatibility import for PrincipalLogging $Id: principallogging.py 97916 2009-03-11 21:10:57Z nadako $ """ # BBB: this was moved to zope.publisher. from zope.publisher.principallogging import PrincipalLogging zope.app.security-3.7.5/src/zope/app/security/principalregistry.py0000644000175000017500000000220611321726135025272 0ustar faassenfaassen############################################################################## # # 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.1 (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. # ############################################################################## """Backward-compatibility imports for the global principal registry $Id: principalregistry.py 97947 2009-03-12 02:31:26Z nadako $ """ # BBB: these were moved to zope.principalregistry from zope.principalregistry.principalregistry import ( DuplicateLogin, DuplicateId, PrincipalRegistry, principalRegistry, PrincipalBase, Group, Principal, UnauthenticatedPrincipal, fallback_unauthenticated_principal, UnauthenticatedGroup, AuthenticatedGroup, EverybodyGroup, ) zope.app.security-3.7.5/src/zope/app/security/_protections.zcml0000644000175000017500000001215211321726135024546 0ustar faassenfaassen zope.app.security-3.7.5/src/zope.app.security.egg-info/0000755000175000017500000000000011321726146022640 5ustar faassenfaassenzope.app.security-3.7.5/src/zope.app.security.egg-info/SOURCES.txt0000644000175000017500000000454311321726142024526 0ustar faassenfaassenCHANGES.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.app.security.egg-info/PKG-INFO src/zope.app.security.egg-info/SOURCES.txt src/zope.app.security.egg-info/dependency_links.txt src/zope.app.security.egg-info/namespace_packages.txt src/zope.app.security.egg-info/not-zip-safe src/zope.app.security.egg-info/requires.txt src/zope.app.security.egg-info/top_level.txt src/zope/app/__init__.py src/zope/app/security/__init__.py src/zope/app/security/_protections.py src/zope/app/security/_protections.zcml src/zope/app/security/basicauthadapter.py src/zope/app/security/configure.zcml src/zope/app/security/ftpauth.py src/zope/app/security/globalmodules.zcml src/zope/app/security/i18n.py src/zope/app/security/interfaces.py src/zope/app/security/loginpassword.py src/zope/app/security/meta.zcml src/zope/app/security/metaconfigure.py src/zope/app/security/metadirectives.py src/zope/app/security/permission.py src/zope/app/security/principal.py src/zope/app/security/principallogging.py src/zope/app/security/principalregistry.py src/zope/app/security/protectclass.py src/zope/app/security/settings.py src/zope/app/security/standardpermissions.zcml src/zope/app/security/vocabulary.py src/zope/app/security/browser/__init__.py src/zope/app/security/browser/auth.py src/zope/app/security/browser/authutilitysearchview.pt src/zope/app/security/browser/authutilitysearchview.txt src/zope/app/security/browser/configure.zcml src/zope/app/security/browser/login.pt src/zope/app/security/browser/login_failed.pt src/zope/app/security/browser/loginlogout.txt src/zope/app/security/browser/logout.pt src/zope/app/security/browser/principalterms.py src/zope/app/security/browser/redirect.pt src/zope/app/security/browser/tests.py src/zope/app/security/tests/__init__.py src/zope/app/security/tests/ftesting.zcml src/zope/app/security/tests/persistentlist.txt src/zope/app/security/tests/test_basicauthadapter.py src/zope/app/security/tests/test_ftpauth.py src/zope/app/security/tests/test_interfaces.py src/zope/app/security/tests/test_loginpassword.py src/zope/app/security/tests/test_logout.py src/zope/app/security/tests/test_permission.py src/zope/app/security/tests/test_principal.py src/zope/app/security/tests/test_principallogging.py src/zope/app/security/tests/test_principalregistry.py src/zope/app/security/tests/test_vocabulary.py src/zope/app/security/tests/tests.pyzope.app.security-3.7.5/src/zope.app.security.egg-info/dependency_links.txt0000644000175000017500000000000111321726142026702 0ustar faassenfaassen zope.app.security-3.7.5/src/zope.app.security.egg-info/top_level.txt0000644000175000017500000000000511321726142025361 0ustar faassenfaassenzope zope.app.security-3.7.5/src/zope.app.security.egg-info/namespace_packages.txt0000644000175000017500000000001611321726142027164 0ustar faassenfaassenzope zope.app zope.app.security-3.7.5/src/zope.app.security.egg-info/PKG-INFO0000644000175000017500000003320611321726142023735 0ustar faassenfaassenMetadata-Version: 1.0 Name: zope.app.security Version: 3.7.5 Summary: ZMI Views For Zope3 Security Components Home-page: http://pypi.python.org/pypi/zope.app.security Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package provides ZMI browser views for Zope security components. It used to provide a large part of security functionality for Zope 3, but it was factored out from this package to several little packages to reduce dependencies and improve reusability. The functionality was splitted into these new packages: * zope.authentication - the IAuthentication interface and related utilities. * zope.principalregistry - the global principal registry and its zcml directives. * zope.app.localpermission - the LocalPermission class that implements persistent permissions. The rest of functionality that were provided by this package is merged into ``zope.security`` and ``zope.publisher``. Backward-compatibility imports are provided to ensure that older applications work. See CHANGES.txt for more info. Detailed Documentation ====================== =========================================== 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

principals.zcml

Search String
If we ask for results: >>> view.results('test') We don't get any, since we did not provide any. But if we give input: >>> request.form['test.searchstring'] = 'n' we still don't get any: >>> view.results('test') because we did not press the button. So let's press the button: >>> request.form['test.search'] = 'Search' so that we now get results (!): >>> ids = list(view.results('test')) >>> ids.sort() >>> ids [0, 1] ==================== Login/Logout Snippet ==================== The class LoginLogout: >>> from zope.app.security.browser.auth import LoginLogout is used as a view to generate an HTML snippet suitable for logging in or logging out based on whether or not the current principal is authenticated. When the current principal is unauthenticated, it provides IUnauthenticatedPrincipal: >>> from zope.authentication.interfaces import IUnauthenticatedPrincipal >>> from zope.principalregistry.principalregistry import UnauthenticatedPrincipal >>> anonymous = UnauthenticatedPrincipal('anon', '', '') >>> IUnauthenticatedPrincipal.providedBy(anonymous) True When LoginLogout is used for a request that has an unauthenticated principal, it provides the user with a link to 'Login': >>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> request.setPrincipal(anonymous) >>> LoginLogout(None, request)() u'[Login]' Logout, however, behaves differently. Not all authentication protocols (i.e. credentials extractors/challengers) support 'logout'. Furthermore, we don't know how an admin may have configured Zope's authentication. Our solution is to rely on the admin to tell us explicitly that the site supports logout. By default, the LoginLogout snippet will not provide a logout link for an unauthenticated principal. To illustrate, we'll first setup a request with an unauthenticated principal: >>> from zope.security.interfaces import IPrincipal >>> from zope.interface import implements >>> class Bob: ... implements(IPrincipal) ... id = 'bob' ... title = description = '' >>> bob = Bob() >>> IUnauthenticatedPrincipal.providedBy(bob) False >>> request.setPrincipal(bob) In this case, the default behavior is to return None for the snippet: >>> print LoginLogout(None, request)() None To show a logout prompt, an admin must register a marker adapter that provides the interface: >>> from zope.authentication.interfaces import ILogoutSupported This flags to LoginLogout that the site supports logout. There is a 'no-op' adapter that can be registered for this: >>> from zope.authentication.logout import LogoutSupported >>> from zope.component import provideAdapter >>> provideAdapter(LogoutSupported, (None,), ILogoutSupported) Now when we use LoginLogout with an unauthenticated principal, we get a logout prompt: >>> LoginLogout(None, request)() u'[Logout]' ======= CHANGES ======= 3.7.5 (2010-01-08) ------------------ - Move 'zope.ManageApplication' permission to zope.app.applicationcontrol - Fix tests using a newer zope.publisher that requires zope.login. 3.7.3 (2009-11-29) ------------------ - provide a clean zope setup and move zope.app.testing to a test dependency - removed unused dependencies like ZODB3 etc. from install_requires 3.7.2 (2009-09-10) ------------------ - Added data attribute to '_protections.zcml' for PersistentList and PersistentDict to accomodate UserList and UserDict behavior when they are proxied. 3.7.1 (2009-08-15) ------------------ - Changed globalmodules.zcml to avoid making declarations for deprecated standard modules, to avoid deprecation warnings. Note that globalmodules.zcml should be avoided. It's better to make declarations for only what you actually need to use. 3.7.0 (2009-03-14) ------------------ - All interfaces, as well as some authentication-related helper classes and functions (checkPrincipal, PrincipalSource, PrincipalTerms, etc.) were moved into the new ``zope.authentication`` package. Backward-compatibility imports are provided. - The "global principal registry" along with its zcml directives was moved into new "zope.principalregistry" package. Backward-compatibility imports are provided. - The IPrincipal -> zope.publisher.interfaces.logginginfo.ILoggingInfo adapter was moved to ``zope.publisher``. Backward-compatibility import is provided. - The PermissionsVocabulary and PermissionIdsVocabulary has been moved to the ``zope.security`` package. Backward-compatibility imports are provided. - The registration of the "zope.Public" permission as well as some other common permissions, like "zope.View" have been moved to ``zope.security``. Its configure.zcml is now included by this package. - The "protect" function is now a no-op and is not needed anymore, because zope.security now knows about i18n messages and __name__ and __parent__ attributes and won't protect them by default. - The addCheckerPublic was moved from zope.app.security.tests to zope.security.testing. Backward-compatibility import is provided. - The ``LocalPermission`` class is now moved to new ``zope.app.localpermission`` package. This package now only has backward-compatibility imports and zcml includes. - Cleanup dependencies after refactorings. Also, don't depend on zope.app.testing for tests anymore. - Update package's description to point about refactorings done. 3.6.2 (2009-03-10) ------------------ - The `Allow`, `Deny` and `Unset` permission settings was preferred to be imported from ``zope.securitypolicy.interfaces`` for a long time and now they are completely moved there from ``zope.app.security.settings`` as well as the ``PermissionSetting`` class. The only thing left for backward compatibility is the import of Allow/Unset/Deny constants if ``zope.securitypolicy`` is installed to allow unpickling of security settings. 3.6.1 (2009-03-09) ------------------ - Depend on new ``zope.password`` package instead of ``zope.app.authentication`` to get password managers for the authentication utility, thus remove dependency on ``zope.app.authentication``. - Use template for AuthUtilitySearchView instead of ugly HTML constructing in the python code. - Bug: The `sha` and `md5` modules has been deprecated in Python 2.6. Whenever the ZCML of this package was included when using Python 2.6, a deprecation warning had been raised stating that `md5` and `sha` have been deprecated. Provided a simple condition to check whether Python 2.6 or later is installed by checking for the presense of `json` module thas was added only in Python 2.6 and thus optionally load the security declaration for `md5` and `sha`. - Remove deprecated code, thus removing explicit dependency on zope.deprecation and zope.deferredimport. - Cleanup code a bit, replace old __used_for__ statements by ``adapts`` calls. 3.6.0 (2009-01-31) ------------------ - Changed mailing list address to zope-dev at zope.org, because zope3-dev is retired now. Changed "cheeseshop" to "pypi" in the package homepage. - Moved the `protectclass` module to `zope.security` leaving only a compatibility module here that imports from the new location. - Moved the directive implementation to `zope.security`. - Use `zope.container` instead of `zope.app.container`;. 3.5.3 (2008-12-11) ------------------ - use zope.browser.interfaces.ITerms instead of `zope.app.form.browser.interfaces`. 3.5.2 (2008-07-31) ------------------ - Bug: It turned out that checking for regex was not much better of an idea, since it causes deprecation warnings in Python 2.4. Thus let's look for a library that was added in Python 2.5. 3.5.1 (2008-06-24) ------------------ - Bug: The `gopherlib` module has been deprecated in Python 2.5. Whenever the ZCML of this package was included when using Python 2.5, a deprecation warning had been raised stating that `gopherlib` has been deprecated. Provided a simple condition to check whether Python 2.5 or later is installed by checking for the deleted `regex` module and thus optionally load the security declaration for `gopherlib`. 3.5.0 (2008-02-05) ------------------ - Feature: `zope.app.security.principalregistry.PrincipalRegistry.getPrincipal` returns `zope.security.management.system_user` when its id is used for the search key. 3.4.0 (2007-10-27) ------------------ - Initial release independent of the main Zope tree. Keywords: zope security authentication principal ftp http Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.security-3.7.5/src/zope.app.security.egg-info/not-zip-safe0000644000175000017500000000000111321726135025064 0ustar faassenfaassen zope.app.security-3.7.5/src/zope.app.security.egg-info/requires.txt0000644000175000017500000000041511321726142025234 0ustar faassenfaassensetuptools zope.app.localpermission zope.app.pagetemplate zope.app.publisher zope.authentication zope.i18n zope.i18nmessageid zope.interface zope.principalregistry zope.publisher >= 3.12 zope.security zope.securitypolicy zope.login [test] zope.app.testing zope.testingzope.app.security-3.7.5/PKG-INFO0000644000175000017500000003320611321726146016056 0ustar faassenfaassenMetadata-Version: 1.0 Name: zope.app.security Version: 3.7.5 Summary: ZMI Views For Zope3 Security Components Home-page: http://pypi.python.org/pypi/zope.app.security Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package provides ZMI browser views for Zope security components. It used to provide a large part of security functionality for Zope 3, but it was factored out from this package to several little packages to reduce dependencies and improve reusability. The functionality was splitted into these new packages: * zope.authentication - the IAuthentication interface and related utilities. * zope.principalregistry - the global principal registry and its zcml directives. * zope.app.localpermission - the LocalPermission class that implements persistent permissions. The rest of functionality that were provided by this package is merged into ``zope.security`` and ``zope.publisher``. Backward-compatibility imports are provided to ensure that older applications work. See CHANGES.txt for more info. Detailed Documentation ====================== =========================================== 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

principals.zcml

Search String
If we ask for results: >>> view.results('test') We don't get any, since we did not provide any. But if we give input: >>> request.form['test.searchstring'] = 'n' we still don't get any: >>> view.results('test') because we did not press the button. So let's press the button: >>> request.form['test.search'] = 'Search' so that we now get results (!): >>> ids = list(view.results('test')) >>> ids.sort() >>> ids [0, 1] ==================== Login/Logout Snippet ==================== The class LoginLogout: >>> from zope.app.security.browser.auth import LoginLogout is used as a view to generate an HTML snippet suitable for logging in or logging out based on whether or not the current principal is authenticated. When the current principal is unauthenticated, it provides IUnauthenticatedPrincipal: >>> from zope.authentication.interfaces import IUnauthenticatedPrincipal >>> from zope.principalregistry.principalregistry import UnauthenticatedPrincipal >>> anonymous = UnauthenticatedPrincipal('anon', '', '') >>> IUnauthenticatedPrincipal.providedBy(anonymous) True When LoginLogout is used for a request that has an unauthenticated principal, it provides the user with a link to 'Login': >>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> request.setPrincipal(anonymous) >>> LoginLogout(None, request)() u'[Login]' Logout, however, behaves differently. Not all authentication protocols (i.e. credentials extractors/challengers) support 'logout'. Furthermore, we don't know how an admin may have configured Zope's authentication. Our solution is to rely on the admin to tell us explicitly that the site supports logout. By default, the LoginLogout snippet will not provide a logout link for an unauthenticated principal. To illustrate, we'll first setup a request with an unauthenticated principal: >>> from zope.security.interfaces import IPrincipal >>> from zope.interface import implements >>> class Bob: ... implements(IPrincipal) ... id = 'bob' ... title = description = '' >>> bob = Bob() >>> IUnauthenticatedPrincipal.providedBy(bob) False >>> request.setPrincipal(bob) In this case, the default behavior is to return None for the snippet: >>> print LoginLogout(None, request)() None To show a logout prompt, an admin must register a marker adapter that provides the interface: >>> from zope.authentication.interfaces import ILogoutSupported This flags to LoginLogout that the site supports logout. There is a 'no-op' adapter that can be registered for this: >>> from zope.authentication.logout import LogoutSupported >>> from zope.component import provideAdapter >>> provideAdapter(LogoutSupported, (None,), ILogoutSupported) Now when we use LoginLogout with an unauthenticated principal, we get a logout prompt: >>> LoginLogout(None, request)() u'[Logout]' ======= CHANGES ======= 3.7.5 (2010-01-08) ------------------ - Move 'zope.ManageApplication' permission to zope.app.applicationcontrol - Fix tests using a newer zope.publisher that requires zope.login. 3.7.3 (2009-11-29) ------------------ - provide a clean zope setup and move zope.app.testing to a test dependency - removed unused dependencies like ZODB3 etc. from install_requires 3.7.2 (2009-09-10) ------------------ - Added data attribute to '_protections.zcml' for PersistentList and PersistentDict to accomodate UserList and UserDict behavior when they are proxied. 3.7.1 (2009-08-15) ------------------ - Changed globalmodules.zcml to avoid making declarations for deprecated standard modules, to avoid deprecation warnings. Note that globalmodules.zcml should be avoided. It's better to make declarations for only what you actually need to use. 3.7.0 (2009-03-14) ------------------ - All interfaces, as well as some authentication-related helper classes and functions (checkPrincipal, PrincipalSource, PrincipalTerms, etc.) were moved into the new ``zope.authentication`` package. Backward-compatibility imports are provided. - The "global principal registry" along with its zcml directives was moved into new "zope.principalregistry" package. Backward-compatibility imports are provided. - The IPrincipal -> zope.publisher.interfaces.logginginfo.ILoggingInfo adapter was moved to ``zope.publisher``. Backward-compatibility import is provided. - The PermissionsVocabulary and PermissionIdsVocabulary has been moved to the ``zope.security`` package. Backward-compatibility imports are provided. - The registration of the "zope.Public" permission as well as some other common permissions, like "zope.View" have been moved to ``zope.security``. Its configure.zcml is now included by this package. - The "protect" function is now a no-op and is not needed anymore, because zope.security now knows about i18n messages and __name__ and __parent__ attributes and won't protect them by default. - The addCheckerPublic was moved from zope.app.security.tests to zope.security.testing. Backward-compatibility import is provided. - The ``LocalPermission`` class is now moved to new ``zope.app.localpermission`` package. This package now only has backward-compatibility imports and zcml includes. - Cleanup dependencies after refactorings. Also, don't depend on zope.app.testing for tests anymore. - Update package's description to point about refactorings done. 3.6.2 (2009-03-10) ------------------ - The `Allow`, `Deny` and `Unset` permission settings was preferred to be imported from ``zope.securitypolicy.interfaces`` for a long time and now they are completely moved there from ``zope.app.security.settings`` as well as the ``PermissionSetting`` class. The only thing left for backward compatibility is the import of Allow/Unset/Deny constants if ``zope.securitypolicy`` is installed to allow unpickling of security settings. 3.6.1 (2009-03-09) ------------------ - Depend on new ``zope.password`` package instead of ``zope.app.authentication`` to get password managers for the authentication utility, thus remove dependency on ``zope.app.authentication``. - Use template for AuthUtilitySearchView instead of ugly HTML constructing in the python code. - Bug: The `sha` and `md5` modules has been deprecated in Python 2.6. Whenever the ZCML of this package was included when using Python 2.6, a deprecation warning had been raised stating that `md5` and `sha` have been deprecated. Provided a simple condition to check whether Python 2.6 or later is installed by checking for the presense of `json` module thas was added only in Python 2.6 and thus optionally load the security declaration for `md5` and `sha`. - Remove deprecated code, thus removing explicit dependency on zope.deprecation and zope.deferredimport. - Cleanup code a bit, replace old __used_for__ statements by ``adapts`` calls. 3.6.0 (2009-01-31) ------------------ - Changed mailing list address to zope-dev at zope.org, because zope3-dev is retired now. Changed "cheeseshop" to "pypi" in the package homepage. - Moved the `protectclass` module to `zope.security` leaving only a compatibility module here that imports from the new location. - Moved the directive implementation to `zope.security`. - Use `zope.container` instead of `zope.app.container`;. 3.5.3 (2008-12-11) ------------------ - use zope.browser.interfaces.ITerms instead of `zope.app.form.browser.interfaces`. 3.5.2 (2008-07-31) ------------------ - Bug: It turned out that checking for regex was not much better of an idea, since it causes deprecation warnings in Python 2.4. Thus let's look for a library that was added in Python 2.5. 3.5.1 (2008-06-24) ------------------ - Bug: The `gopherlib` module has been deprecated in Python 2.5. Whenever the ZCML of this package was included when using Python 2.5, a deprecation warning had been raised stating that `gopherlib` has been deprecated. Provided a simple condition to check whether Python 2.5 or later is installed by checking for the deleted `regex` module and thus optionally load the security declaration for `gopherlib`. 3.5.0 (2008-02-05) ------------------ - Feature: `zope.app.security.principalregistry.PrincipalRegistry.getPrincipal` returns `zope.security.management.system_user` when its id is used for the search key. 3.4.0 (2007-10-27) ------------------ - Initial release independent of the main Zope tree. Keywords: zope security authentication principal ftp http Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.security-3.7.5/setup.py0000644000175000017500000000603511321726135016471 0ustar faassenfaassen############################################################################## # # Copyright (c) Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (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. # ############################################################################## # This package is developed by the Zope Toolkit project, documented here: # http://docs.zope.org/zopetoolkit # When developing and releasing this package, please follow the documented # Zope Toolkit policies as described by this documentation. ############################################################################## version = '3.7.5' import os from setuptools import setup, find_packages def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup(name='zope.app.security', version = version, author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', description='ZMI Views For Zope3 Security Components', long_description=( read('README.txt') + '\n\n' + 'Detailed Documentation\n' + '======================\n' + '\n\n' + read('src', 'zope', 'app', 'security', 'browser', 'authutilitysearchview.txt') + '\n\n' + read('src', 'zope', 'app', 'security', 'browser', 'loginlogout.txt') + '\n\n' + read('CHANGES.txt') ), keywords = "zope security authentication principal ftp http", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope3'], url='http://pypi.python.org/pypi/zope.app.security', license='ZPL 2.1', packages=find_packages('src'), package_dir = {'': 'src'}, namespace_packages=['zope', 'zope.app'], extras_require=dict( test=[ 'zope.app.testing', 'zope.testing', ]), install_requires = [ 'setuptools', 'zope.app.localpermission', 'zope.app.pagetemplate', 'zope.app.publisher', 'zope.authentication', 'zope.i18n', 'zope.i18nmessageid', 'zope.interface', 'zope.principalregistry', 'zope.publisher >= 3.12', 'zope.security', 'zope.securitypolicy', 'zope.login', ], include_package_data = True, zip_safe = False, ) zope.app.security-3.7.5/CHANGES.txt0000644000175000017500000001271511321726135016572 0ustar faassenfaassen======= CHANGES ======= 3.7.5 (2010-01-08) ------------------ - Move 'zope.ManageApplication' permission to zope.app.applicationcontrol - Fix tests using a newer zope.publisher that requires zope.login. 3.7.3 (2009-11-29) ------------------ - provide a clean zope setup and move zope.app.testing to a test dependency - removed unused dependencies like ZODB3 etc. from install_requires 3.7.2 (2009-09-10) ------------------ - Added data attribute to '_protections.zcml' for PersistentList and PersistentDict to accomodate UserList and UserDict behavior when they are proxied. 3.7.1 (2009-08-15) ------------------ - Changed globalmodules.zcml to avoid making declarations for deprecated standard modules, to avoid deprecation warnings. Note that globalmodules.zcml should be avoided. It's better to make declarations for only what you actually need to use. 3.7.0 (2009-03-14) ------------------ - All interfaces, as well as some authentication-related helper classes and functions (checkPrincipal, PrincipalSource, PrincipalTerms, etc.) were moved into the new ``zope.authentication`` package. Backward-compatibility imports are provided. - The "global principal registry" along with its zcml directives was moved into new "zope.principalregistry" package. Backward-compatibility imports are provided. - The IPrincipal -> zope.publisher.interfaces.logginginfo.ILoggingInfo adapter was moved to ``zope.publisher``. Backward-compatibility import is provided. - The PermissionsVocabulary and PermissionIdsVocabulary has been moved to the ``zope.security`` package. Backward-compatibility imports are provided. - The registration of the "zope.Public" permission as well as some other common permissions, like "zope.View" have been moved to ``zope.security``. Its configure.zcml is now included by this package. - The "protect" function is now a no-op and is not needed anymore, because zope.security now knows about i18n messages and __name__ and __parent__ attributes and won't protect them by default. - The addCheckerPublic was moved from zope.app.security.tests to zope.security.testing. Backward-compatibility import is provided. - The ``LocalPermission`` class is now moved to new ``zope.app.localpermission`` package. This package now only has backward-compatibility imports and zcml includes. - Cleanup dependencies after refactorings. Also, don't depend on zope.app.testing for tests anymore. - Update package's description to point about refactorings done. 3.6.2 (2009-03-10) ------------------ - The `Allow`, `Deny` and `Unset` permission settings was preferred to be imported from ``zope.securitypolicy.interfaces`` for a long time and now they are completely moved there from ``zope.app.security.settings`` as well as the ``PermissionSetting`` class. The only thing left for backward compatibility is the import of Allow/Unset/Deny constants if ``zope.securitypolicy`` is installed to allow unpickling of security settings. 3.6.1 (2009-03-09) ------------------ - Depend on new ``zope.password`` package instead of ``zope.app.authentication`` to get password managers for the authentication utility, thus remove dependency on ``zope.app.authentication``. - Use template for AuthUtilitySearchView instead of ugly HTML constructing in the python code. - Bug: The `sha` and `md5` modules has been deprecated in Python 2.6. Whenever the ZCML of this package was included when using Python 2.6, a deprecation warning had been raised stating that `md5` and `sha` have been deprecated. Provided a simple condition to check whether Python 2.6 or later is installed by checking for the presense of `json` module thas was added only in Python 2.6 and thus optionally load the security declaration for `md5` and `sha`. - Remove deprecated code, thus removing explicit dependency on zope.deprecation and zope.deferredimport. - Cleanup code a bit, replace old __used_for__ statements by ``adapts`` calls. 3.6.0 (2009-01-31) ------------------ - Changed mailing list address to zope-dev at zope.org, because zope3-dev is retired now. Changed "cheeseshop" to "pypi" in the package homepage. - Moved the `protectclass` module to `zope.security` leaving only a compatibility module here that imports from the new location. - Moved the directive implementation to `zope.security`. - Use `zope.container` instead of `zope.app.container`;. 3.5.3 (2008-12-11) ------------------ - use zope.browser.interfaces.ITerms instead of `zope.app.form.browser.interfaces`. 3.5.2 (2008-07-31) ------------------ - Bug: It turned out that checking for regex was not much better of an idea, since it causes deprecation warnings in Python 2.4. Thus let's look for a library that was added in Python 2.5. 3.5.1 (2008-06-24) ------------------ - Bug: The `gopherlib` module has been deprecated in Python 2.5. Whenever the ZCML of this package was included when using Python 2.5, a deprecation warning had been raised stating that `gopherlib` has been deprecated. Provided a simple condition to check whether Python 2.5 or later is installed by checking for the deleted `regex` module and thus optionally load the security declaration for `gopherlib`. 3.5.0 (2008-02-05) ------------------ - Feature: `zope.app.security.principalregistry.PrincipalRegistry.getPrincipal` returns `zope.security.management.system_user` when its id is used for the search key. 3.4.0 (2007-10-27) ------------------ - Initial release independent of the main Zope tree. zope.app.security-3.7.5/README.txt0000644000175000017500000000145311321726135016454 0ustar faassenfaassenThis package provides ZMI browser views for Zope security components. It used to provide a large part of security functionality for Zope 3, but it was factored out from this package to several little packages to reduce dependencies and improve reusability. The functionality was splitted into these new packages: * zope.authentication - the IAuthentication interface and related utilities. * zope.principalregistry - the global principal registry and its zcml directives. * zope.app.localpermission - the LocalPermission class that implements persistent permissions. The rest of functionality that were provided by this package is merged into ``zope.security`` and ``zope.publisher``. Backward-compatibility imports are provided to ensure that older applications work. See CHANGES.txt for more info.