plone.batching 3.0.2__tar.gz → 3.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {plone_batching-3.0.2 → plone_batching-3.0.3}/CHANGES.rst +10 -0
  2. {plone_batching-3.0.2/src/plone.batching.egg-info → plone_batching-3.0.3}/PKG-INFO +11 -1
  3. {plone_batching-3.0.2 → plone_batching-3.0.3}/pyproject.toml +1 -1
  4. plone_batching-3.0.3/src/plone/batching/__init__.py +9 -0
  5. plone_batching-3.0.3/src/plone/batching/tests/test_security.py +50 -0
  6. {plone_batching-3.0.2 → plone_batching-3.0.3/src/plone.batching.egg-info}/PKG-INFO +11 -1
  7. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone.batching.egg-info/SOURCES.txt +2 -1
  8. plone_batching-3.0.2/src/plone/batching/__init__.py +0 -6
  9. {plone_batching-3.0.2 → plone_batching-3.0.3}/CONTRIBUTING.rst +0 -0
  10. {plone_batching-3.0.2 → plone_batching-3.0.3}/MANIFEST.in +0 -0
  11. {plone_batching-3.0.2 → plone_batching-3.0.3}/README.rst +0 -0
  12. {plone_batching-3.0.2 → plone_batching-3.0.3}/docs/LICENSE.txt +0 -0
  13. {plone_batching-3.0.2 → plone_batching-3.0.3}/docs/index.rst +0 -0
  14. {plone_batching-3.0.2 → plone_batching-3.0.3}/setup.cfg +0 -0
  15. {plone_batching-3.0.2 → plone_batching-3.0.3}/setup.py +0 -0
  16. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/batch.py +0 -0
  17. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/batch_macros.pt +0 -0
  18. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/batching.rst +0 -0
  19. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/batchnavigation.pt +0 -0
  20. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/batchnavigation_bootstrap.pt +0 -0
  21. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/browser.py +0 -0
  22. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/configure.zcml +0 -0
  23. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/interfaces.py +0 -0
  24. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/tests/__init__.py +0 -0
  25. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/tests/test_batching.py +0 -0
  26. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone/batching/utils.py +0 -0
  27. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone.batching.egg-info/dependency_links.txt +0 -0
  28. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone.batching.egg-info/requires.txt +0 -0
  29. {plone_batching-3.0.2 → plone_batching-3.0.3}/src/plone.batching.egg-info/top_level.txt +0 -0
@@ -8,6 +8,16 @@ Changelog
8
8
 
9
9
  .. towncrier release notes start
10
10
 
11
+ 3.0.3 (2026-11-10)
12
+ ------------------
13
+
14
+ Bug fixes:
15
+
16
+
17
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
18
+ [maurits]
19
+
20
+
11
21
  3.0.2 (2026-11-03)
12
22
  ------------------
13
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plone.batching
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: Batching facilities used in Plone
5
5
  Author-email: Plone Foundation <plone-developers@lists.sourceforge.net>
6
6
  Maintainer-email: Plone Foundation and contributors <plone-developers@lists.sourceforge.net>
@@ -163,6 +163,16 @@ Changelog
163
163
 
164
164
  .. towncrier release notes start
165
165
 
166
+ 3.0.3 (2026-11-10)
167
+ ------------------
168
+
169
+ Bug fixes:
170
+
171
+
172
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
173
+ [maurits]
174
+
175
+
166
176
  3.0.2 (2026-11-03)
167
177
  ------------------
168
178
 
@@ -10,7 +10,7 @@ requires = ["setuptools>=68.2,<83", "wheel"]
10
10
 
11
11
  [project]
12
12
  name = "plone.batching"
13
- version = "3.0.2"
13
+ version = "3.0.3"
14
14
  description = "Batching facilities used in Plone"
15
15
  classifiers = [
16
16
  "Development Status :: 5 - Production/Stable",
@@ -0,0 +1,9 @@
1
+ from AccessControl import allow_class
2
+ from AccessControl import ModuleSecurityInfo
3
+ from plone.batching.batch import Batch
4
+
5
+ # Only declare Batch public. Do not use allow_module here: that would make
6
+ # every name in this module available to restricted code, including
7
+ # imported names like allow_class.
8
+ ModuleSecurityInfo("plone.batching").declarePublic("Batch")
9
+ allow_class(Batch)
@@ -0,0 +1,50 @@
1
+ from AccessControl import Unauthorized
2
+ from AccessControl.ZopeGuards import guarded_getattr
3
+ from AccessControl.ZopeGuards import guarded_import
4
+
5
+ import unittest
6
+
7
+
8
+ class TestModuleSecurity(unittest.TestCase):
9
+ def test_batch_is_public(self):
10
+ from plone.batching import Batch
11
+
12
+ module = guarded_import("plone.batching", fromlist=["Batch"])
13
+ self.assertIs(guarded_getattr(module, "Batch"), Batch)
14
+ batch = Batch(range(10), 3)
15
+ self.assertEqual(guarded_getattr(batch, "pagesize"), 3)
16
+
17
+ def test_other_names_are_not_public(self):
18
+ import plone.batching
19
+
20
+ # Make sure the submodules are attributes of the package.
21
+ import plone.batching.batch # noqa: F401
22
+ import plone.batching.browser # noqa: F401
23
+ import plone.batching.utils # noqa: F401
24
+
25
+ for name in (
26
+ "allow_class",
27
+ "allow_module",
28
+ "ModuleSecurityInfo",
29
+ "batch",
30
+ "browser",
31
+ "utils",
32
+ ):
33
+ if not hasattr(plone.batching, name):
34
+ continue
35
+ with self.subTest(name=name):
36
+ self.assertRaises(Unauthorized, guarded_getattr, plone.batching, name)
37
+ self.assertRaises(
38
+ Unauthorized,
39
+ guarded_import,
40
+ "plone.batching",
41
+ fromlist=[name],
42
+ )
43
+
44
+ def test_submodules_not_importable(self):
45
+ # guarded_import may raise the Unauthorized from zExceptions instead.
46
+ for name in ("plone.batching.batch", "plone.batching.utils"):
47
+ with self.subTest(name=name):
48
+ with self.assertRaises(Exception) as cm:
49
+ guarded_import(name)
50
+ self.assertEqual(type(cm.exception).__name__, "Unauthorized")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plone.batching
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: Batching facilities used in Plone
5
5
  Author-email: Plone Foundation <plone-developers@lists.sourceforge.net>
6
6
  Maintainer-email: Plone Foundation and contributors <plone-developers@lists.sourceforge.net>
@@ -163,6 +163,16 @@ Changelog
163
163
 
164
164
  .. towncrier release notes start
165
165
 
166
+ 3.0.3 (2026-11-10)
167
+ ------------------
168
+
169
+ Bug fixes:
170
+
171
+
172
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
173
+ [maurits]
174
+
175
+
166
176
  3.0.2 (2026-11-03)
167
177
  ------------------
168
178
 
@@ -22,4 +22,5 @@ src/plone/batching/configure.zcml
22
22
  src/plone/batching/interfaces.py
23
23
  src/plone/batching/utils.py
24
24
  src/plone/batching/tests/__init__.py
25
- src/plone/batching/tests/test_batching.py
25
+ src/plone/batching/tests/test_batching.py
26
+ src/plone/batching/tests/test_security.py
@@ -1,6 +0,0 @@
1
- from AccessControl import allow_class
2
- from AccessControl import allow_module
3
- from plone.batching.batch import Batch
4
-
5
- allow_module("plone.batching")
6
- allow_class(Batch)
File without changes
File without changes