diff --git a/CHANGES.rst b/CHANGES.rst index eee704a..ad40982 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,5 +5,8 @@ Changelog 1.0a1 (unreleased) ------------------ +- rejectanonymous (usato ad esempio per /admin nel buildout, vedi anche desing.plone.policy) + [mamico] + - Initial release. [] diff --git a/setup.py b/setup.py index 35a6df9..a593a83 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ "collective.volto.enhancedlinks", "collective.feedback", "collective.volto.slimheader", + "iw.rejectanonymous", ], extras_require={ "test": [ diff --git a/src/iosanita/policy/configure.zcml b/src/iosanita/policy/configure.zcml index 615ed7e..342d771 100644 --- a/src/iosanita/policy/configure.zcml +++ b/src/iosanita/policy/configure.zcml @@ -45,4 +45,11 @@ + + + diff --git a/src/iosanita/policy/rejectanonymous.py b/src/iosanita/policy/rejectanonymous.py new file mode 100644 index 0000000..ead07a6 --- /dev/null +++ b/src/iosanita/policy/rejectanonymous.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from iw.rejectanonymous import rejectAnonymous + + +def insertRejectAnonymousHook(portal, event): + """force authentication for request with X-ForceAuth header""" + if event.request.getHeader("X-ForceAuth"): + event.request.post_traverse(rejectAnonymous, (portal, event.request)) diff --git a/test_plone60.cfg b/test_plone60.cfg index 69ea625..bf7eed7 100644 --- a/test_plone60.cfg +++ b/test_plone60.cfg @@ -16,7 +16,6 @@ build = 1.2.1 cmarkgfm = 2024.1.14 collective.geolocationbehavior = 1.7.2 collective.honeypot = 2.1 -collective.venue = 4.1 coverage = 7.5.4 flake8 = 6.1.0 geographiclib = 2.0 @@ -54,10 +53,6 @@ backports.tarfile = 1.2.0 # plone.recipe.codeanalysis==3.0.1 check-manifest = 0.49 -# Required by: -# collective.venue==4.1 -collective.address = 1.6 - # Required by: # iosanita.policy==1.0.0.dev0 collective.feedback = 1.1.3 @@ -136,26 +131,4 @@ souper.plone = 1.3.1 # iosanita.contenttypes==2.0.0.dev0 # iosanita.policy==1.0.0.dev0 # redturtle.volto==5.5.0 -z3c.jbot = 2.0 - -# Added by buildout at 2024-07-31 13:03:47.206767 - -# Required by: -# redturtle.bandi==1.4.5 -collective.tiles.collection = 2.1.1 - -# Required by: -# iosanita.policy==1.0.0.dev0 -collective.volto.slimheader = 1.0.1 - -# Required by: -# collective.tiles.collection==2.1.1 -plone.app.tiles = 4.0.1 - -# Required by: -# iosanita.contenttypes==2.0.0.dev0 -redturtle.bandi = 1.4.5 - -# Required by: -# check-manifest==0.49 -tomli = 2.0.1 +z3c.jbot = 2.0 \ No newline at end of file