Package: zope.security
zope.securityThe Security framework provides a generic mechanism to implement security
policies on Python objects.Documentation is available athttps://zopesecurity.readthedocs.io/Changes6.2 (2023-10-05)Makenext()on C proxies call__next__rather thannext(see
PEP 3114), and drop support for the Python 2nextmethod name from
pure-Python proxies.Drop usingsetup_requiresdue to constant problems on GHA.Add support for Python 3.12.6.1 (2023-01-18)Remove more proxying code for names that no longer exist in Python 3.
(#92)6.0 (2023-01-16)Remove proxying code for names that no longer exist in Python 3.
(#92)Drop support for Python 2.7, 3.5, 3.6.5.8 (2022-11-30)The extrauntrustedpythonnow for Python 3, too, installszope.untrustedpython.5.7 (2022-11-17)Release to rebuild full set of binary wheels.5.6 (2022-11-16)Add support for building arm64 wheels on macOS.5.5 (2022-11-06)Add support for final release of Python 3.11.5.4 (2022-09-15)Disable unsafe math optimizations in C code.  Seepull request 89.5.3 (2022-04-27)Allow calling bound methods of some built-in objects such as().__repr__and{}.__repr__by default. This worked on Python 2, but raisedForbiddenAttributeon Python 3. Seeissue 75.Remove usage ofunittest.makeSuiteas it is deprecated in Python 3.11+.
Seeissue 83.Add support for Python 3.11 (as of 3.11.0a7).5.2 (2022-03-10)Add support for Python 3.9 and 3.10.5.1.1 (2020-03-23)Ensure all objects have consistent interface resolution orders (if
all dependencies are up-to-date). Seeissue 71.5.1.0 (2020-02-14)Let proxied interfaces be iterated on Python 3. This worked on
Python 2, but raisedForbiddenAttributean Python 3. Seezope.interface issue 141.Allow to use a common Sphinx version for Python 2 and 3.5.0.0 (2019-11-11)Drop support for Python 3.4.Add support for Python 3.8.Properly declare dependency on zope.schema >= 4.2.0, introduced in
zope.security 4.2.1.Fix dict item view iteration on PyPy3 7.x.4.3.1 (2019-01-03)Fix the decimal.Decimal checker,__truediv__was missing causingForbiddenAttributeon aProxyFactory(Decimal('1'))/ 1operation4.3.0 (2018-08-24)Add the interfaceISystemPrincipaland makezope.security.management.system_usera regular object that
implements this interface. This facilitates providing adapter
registrations specifically for thesystem_user.4.2.3 (2018-08-09)Add support for Python 3.7.4.2.2 (2018-01-11)Make the pure-Python proxy on Python 2notcheck permissions for__unicode__just like the C implementation. Note that__str__is checked for both implementations on both Python 2 and
3, but if there is no__unicode__method defined, Python 2’s
automatic fallback to__str__isnotchecked whenunicodeis called. Seeissue 10.4.2.1 (2017-11-30)Fix the default values forPermissionfieldstitleanddescriptionunder Python 2. Seeissue 48.Change theIPermission.idfromText(unicode) to aNativeStringLine. This matches what ZCML creates and what is
usually written in source code.4.2.0 (2017-09-20)Fix the extremely rare potential for a crash when the C extensions
are in use. Seeissue 35.Fixissue 7: The
pure-Python proxy didn’t propagateTypeErrorfrom__repr__and__str__like the C implementation did.Fixissue 27:
iteration ofzope.interface.providedBy()is now allowed by
default on all versions of Python. Previously it only worked on
Python 2. Note thatprovidedByreturns unproxied objects for backwards
compatibility.Fix__length_hint__of proxied iterator objects. Previously it
was ignored.Drop support for Python 3.3.Enable coveralls.io for coverage measurement and run doctests on all
supported Python versions.Fixissue 9:
iteration ofitertools.groupbyobjects is now allowed by
default. In addition, iteration of all the custom iterator types
defined in itertools are also allowed by default.Simplify the internal_compat.pymodule now that we only run on
newer Python versions. SeePR 32.RespectPURE_PYTHONat runtime. At build time, always try to
build the C extensions on supported platforms, ignoringPURE_PYTHON. Seeissue 33.Fix watching checkers (ZOPE_WATCH_CHECKERS=1) in pure-Python
mode. Seeissue 8.Remove unused internal files fromtests/.Removezope.security.setup. It was unused and did not work
anyway.Fix the pure-Python proxy on Python 2 letting__getslice__and__setslice__fall through to__getitem__or__setitem__,
respectively, if it raised an error.Fix the pure-Python proxy calling a wrapped__getattr__or__getattribute__more than once in situations where the C
implementation only called it one time (when it raised an
AttributeError).Reach 100% test coverage and maintain it via automated checks.4.1.1 (2017-05-17)Fixissue 23:
iteration ofcollections.OrderedDictand its various views is
now allowed by default on all versions of Python.As a further fix for issue 20, iteration ofBTreeitself is now
allowed by default.4.1.0 (2017-04-24)When testingPURE_PYTHONenvironments undertox, avoid poisoning
the user’s global wheel cache.Drop support for Python 2.6 and 3.2.Add support for Python 3.5 and 3.6.Fixissue 20:
iteration of pure-PythonBTrees.items(), and also creating a list fromBTrees.items()on Python 3. The same applies forkeys()andvalues().4.0.3 (2015-06-02)Fix iteration over security proxies in Python 3 using the pure-Python
implementation.4.0.2 (2015-06-02)Fix compatibility withzope.proxy4.1.5 under PyPy.Fix the very first call toremoveSecurityProxyreturning
incorrect results if given a proxy under PyPy.4.0.1 (2014-03-19)Add support for Python 3.4.4.0.0 (2013-07-09)Updateboostrap.pyto version 2.2.Bugfix: ZOPE_WATCH_CHECKERS=2 used to incorrectly suppress
unauthorized/forbidden warnings.Bugfix: ZOPE_WATCH_CHECKERS=1 used to miss most of the checks.4.0.0b1 (2013-03-11)Add support for PyPy.Fix extension compilation on windows python 3.x4.0.0a5 (2013-02-28)Undo changes from 4.0.0a4. Instead,zope.untrustedpythonis only
included during Python 2 installs.4.0.0a4 (2013-02-28)Removeuntrustedpythonextra again, since we do not want to supportzope.untrustedpythonin ZTK 2.0. If BBB is really needed, we will create
a 3.10.0 release.4.0.0a3 (2013-02-15)Fix test breakage in 4.0.0a2 due to deprecation strategy.4.0.0a2 (2013-02-15)Add back theuntrustedpythonextra:  now pulls inzope.untrustedpython.  Restored deprecated backward-compatible imports
forzope.security.untrustedpython.{builtins,interpreter,rcompile}(the extra and the imports are to be removed in version 4.1).4.0.0a1 (2013-02-14)Add support for Python 3.2 and 3.3.Bring unit test coverage to 100%.zope.security.untrustedpythonmoved to separate project:zope.untrustedpythonConvert use ofassertin non-test code to apprpriate error types:Non-dict’s passed toChecker.__init__.Remove dprecattion ofzope.security.adapter.TrustedAdapterFactory.
Although it has been marked as deprectaed since before Zope3 3.2, current
versions ofzope.compoentstill rely on it.Convert doctests to Sphinx documentation in ‘docs’.Addsetup.py docsalias (installsSphinxand dependencies).Addsetup.py devalias (runssetup.py developplus installsnoseandcoverage).Make non-doctest tests fully independent ofzope.testing.Two modules,zope.security.checkerandzope.security.management,
register cleanups withzope.testingIFF it is importable, but the
tests no longer rely on it.Enable building extensions without thesvn:externalof thezope.proxyheaders into ourincludedir.Bumpzope.proxydependency to “>= 4.1.0” to enable compilation
on Py3k.Replace deprecatedzope.component.adaptsusage with equivalentzope.component.adapterdecorator.Replace deprecatedzope.interface.classProvidesusage with equivalentzope.interface.providerdecorator.Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Drop support for Python 2.4 and 2.5.Add test convenience helpercreate_interactionandwith interaction().3.9.0 (2012-12-21)Pinzope.proxy >= 4.1.0Ship with an includedproxy.hheader which is compatible with the
4.1.x version ovzope.proxy.3.8.5 (2012-12-21)Ship with an includedproxy.hheader which is compatible with the
supported versions ofzope.proxy.3.8.4 (2012-12-20)Pinzope.proxy >= 3.4.2, <4.1dev3.8.3 (2011-09-24)Fix a regression introduced in 3.8.1:zope.location's LocationProxy
did not get a security checker ifzope.security.decoratorwas not
imported manually. Nowzope.security.decoratoris imported inzope.security.proxywithout re-introducing the circular import fixed in
3.8.1.3.8.2 (2011-05-24)Fix a test that failed on Python 2.7.3.8.1 (2011-05-03)Fix circular import beweenzope.security.decoratorandzope.security.proxywhich led to anImportErrorwhen only
importingzope.security.decorator.3.8.0 (2010-12-14)Add tests for our ownconfigure.zcml.Addzcmlextra dependencies;  run related tests only ifzope.configurationis available.Run tests related to theuntrustedpythonfunctionality only ifRestrictedPythonis available.3.7.3 (2010-04-30)Prefer the standard library’sdoctestmodule to the one fromzope.testing.EnsurePermissionIdsVocabularydirectly providesIVocabularyFactory,
even though it might be unnecessary becauseIVocabularyFactoryis
provided in ZCML.Remove the dependency on the zope.exceptions package: zope.security.checker
now importsDuplicationErrorfrom zope.exceptions if available, otherwise
it defines a package-specificDuplicationErrorclass which inherits from
Exception.3.7.2 (2009-11-10)Add compatibility with Python 2.6 abstract base classes.3.7.1 (2009-08-13)Fix for LP bug 181833 (from Gustavo Niemeyer). Before “visiting” a
sub-object, a check should be made to ensure the object is still valid.
Because garbage collection may involve loops, if you garbage collect an
object, it is possible that the actions done on this object may modify the
state of other objects. This may cause another round of garbage collection,
eventually generating a segfault (see LP bug). The Py_VISIT macro does the
necessary checks, so it is used instead of the previous code.3.7.0 (2009-05-13)Makepytza soft dependency:  the checker forpytz.UTCis
created / tested only if the package is already present.  Runbin/test_pytzto run the tests withpytzon the path.3.6.3 (2009-03-23)Ensure that simple zope.schema’sVocabularyRegistryis used forPermissionVocabularytests, because it’s replaced implicitly in
environments withzope.app.schemainstalled that makes that tests
fail.Fix a bug inDecoratedSecurityCheckerDescriptorwhich made
security-wrapping location proxied exception instances throw
exceptions on Python 2.5.
Seehttps://bugs.launchpad.net/zope3/+bug/2518483.6.2 (2009-03-14)Addzope.i18nmessageid.Messageto non-proxied basic types. It’s okay,
because messages are immutable. Done previously byzope.app.security.Add__name__and__parent__attributes to list of available by
default.  Done previously byzope.app.security.MovePermissionsVocabularyandPermissionIdsVocabularyvocabularies
to thezope.security.permissionmodule from thezope.app.securitypackage.Add zcml permission definitions for most common and useful permissions,
likezope.Viewandzope.ManageContent, as well as for the specialzope.Publicpermission. They are placed in a separatepermissions.zcmlfile, so it can be easily excluded/redefined. They are
selected part of permissions moved fromzope.app.securityand used by
manyzope.*packages.AddaddCheckerPublichelper function inzope.security.testingmodule
that registers the “zope.Public” permission as an IPermission utility.Add security declarations for thezope.security.permisson.Permissionclass.Improve test coverage.3.6.1 (2009-03-10)Usefromimports instead ofzope.deferredto avoid circular
import problems, thus drop dependency onzope.deferredimport.RaiseNoInteractionwhenzope.security.checkPermissionis called
without interaction being active (LP #301565).Don’t define security checkers for deprecated set types from the
“sets” module on Python 2.6. It’s discouraged to use them andsetandfrozensetbuilt-in types should be used instead.Change package’s mailng list address to zope-dev at zope.org as
zope3-dev at zope.org is now retired.Remove old zpkg-related files.3.6.0 (2009-01-31)Install decorated security checker support onLocationProxyfrom the
outside.Add support to bootstrap on Jython.Move theprotectclassmodule fromzope.app.securityto this
package to reduce the number of dependencies onzope.app.security.Move the<module>directive implementation fromzope.app.securityto this package.Move the<class>directive implementation fromzope.app.componentto this package.3.5.2 (2008-07-27)Make C code compatible with Python 2.5 on 64bit architectures.3.5.1 (2008-06-04)Addfrozenset,set,reversed, andsortedto the list of
safe builtins.3.5.0 (2008-03-05)Changed title forzope.security.management.system_userto be more
presentable.3.4.3 - (2009/11/26)Backport a fix made by Gary Poster to the 3.4 branch:
Fix for LP bug 181833 (from Gustavo Niemeyer). Before “visiting” a
sub-object, a check should be made to ensure the object is still valid.
Because garbage collection may involve loops, if you garbage collect an
object, it is possible that the actions done on this object may modify the
state of other objects. This may cause another round of garbage collection,
eventually generating a segfault (see LP bug). ThePy_VISITmacro does
the necessary checks, so it is used instead of the previous code.3.4.2 - (2009/03/23)Add dependency onzope.threadto setup.py; without it, the tests were
failing.Backport a fix made by Albertas Agejevas to the 3.4 branch. He
fixed a bug in DecoratedSecurityCheckerDescriptor which made
security-wrapping location proxied exception instances throw
exceptions on Python 2.5.  Seehttps://bugs.launchpad.net/zope3/+bug/2518483.4.1 - 2008/07/27Make C code compatible with Python 2.5 on 64bit architectures.3.4.0 (2007-10-02)Update meta-data.3.4.0b5 (2007-08-15)Fix a circular import in the C implementation.3.4.0b4 (2007-08-14)Improve ugly/brittle ID ofzope.security.management.system_user.3.4.0b3 (2007-08-14)Add support for Python 2.5.Bug:zope.security.management.system_userwasn’t a valid principal
(didn’t provide IPrincipal).Bug: Fix inclusion of doctest to use the doctest module fromzope.testing. Now tests can be run multiple times without
breaking. (#98250)3.4.0b2 (2007-06-15)Bug: Remove stack extraction innewInteraction. When using eggs this is
an extremly expensive function. The publisher is now more than 10 times
faster when using eggs and about twice as fast with a zope trunk checkout.3.4.0b1Temporarily fixed the hidden (and accidental) dependency on zope.testing to
become optional.Note: The releases between 3.2.0 and 3.4.0b1 where not tracked as an
individual package and have been documented in the Zope 3 changelog.3.2.0 (2006-01-05)Corresponds to the verison of thezope.securitypackage shipped as part
of the Zope 3.2.0 release.Remove deprecated helper functions,proxy.trustedRemoveSecurityProxyandproxy.getProxiedObject.Make handling ofmanagement.{end,restore}Interactionmore careful w.r.t.
edge cases.Make behavior ofcanWriteconsistent withcanAccess:
ifcanAccessdoes not raiseForbiddenAttribute, then neither willcanWrite.  See:http://www.zope.org/Collectors/Zope3-dev/506Code style / documentation / test fixes.3.1.0 (2005-10-03)Add support for use of the new Python 2.4 datatypes,setandfrozenset, within checked code.Make the C security proxy depend on theproxy.hheader from thezope.proxypackage.XXX: the spelling of the#includeis bizarre!  It seems to be related tozpkg-based builds, and should likely be revisited.  For the moment, I have
linked in thezope.proxypackage into our ownincludedirectory.  See
the subversion checkin:http://svn.zope.org/Zope3/?rev=37882&view=revUpdate checker to avoid re-proxying objects which have and explicit__Security_checker__assigned.Corresponds to the verison of thezope.securitypackage shipped as part of
the Zope 3.1.0 release.Clarify contract ofICheckerto indicate that itscheck*methods may
raise onlyForbiddenorUnauthorizedexceptions.Add interfaces, (IPrincipal,IGroupAwarePrincipal,IGroup, andIPermission) specifying contracts of components in the security framework.Code style / documentation / test fixes.3.0.0 (2004-11-07)Corresponds to the version of thezope.securitypackage shipped as part
of the Zope X3.0.0 release.