plone.batching 2.0.7__tar.gz → 2.0.8__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 (34) hide show
  1. {plone_batching-2.0.7 → plone_batching-2.0.8}/CHANGES.rst +10 -0
  2. {plone_batching-2.0.7/src/plone.batching.egg-info → plone_batching-2.0.8}/PKG-INFO +12 -2
  3. {plone_batching-2.0.7 → plone_batching-2.0.8}/pyproject.toml +1 -1
  4. {plone_batching-2.0.7 → plone_batching-2.0.8}/setup.py +1 -1
  5. plone_batching-2.0.8/src/plone/batching/__init__.py +10 -0
  6. plone_batching-2.0.8/src/plone/batching/tests/test_security.py +50 -0
  7. {plone_batching-2.0.7 → plone_batching-2.0.8/src/plone.batching.egg-info}/PKG-INFO +12 -2
  8. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone.batching.egg-info/SOURCES.txt +2 -1
  9. plone_batching-2.0.7/src/plone/batching/__init__.py +0 -7
  10. {plone_batching-2.0.7 → plone_batching-2.0.8}/CONTRIBUTING.rst +0 -0
  11. {plone_batching-2.0.7 → plone_batching-2.0.8}/MANIFEST.in +0 -0
  12. {plone_batching-2.0.7 → plone_batching-2.0.8}/README.rst +0 -0
  13. {plone_batching-2.0.7 → plone_batching-2.0.8}/docs/LICENSE.txt +0 -0
  14. {plone_batching-2.0.7 → plone_batching-2.0.8}/docs/index.rst +0 -0
  15. {plone_batching-2.0.7 → plone_batching-2.0.8}/docs/usage.rst +0 -0
  16. {plone_batching-2.0.7 → plone_batching-2.0.8}/setup.cfg +0 -0
  17. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/__init__.py +0 -0
  18. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/batch.py +0 -0
  19. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/batch_macros.pt +0 -0
  20. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/batching.rst +0 -0
  21. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/batchnavigation.pt +0 -0
  22. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/batchnavigation_bootstrap.pt +0 -0
  23. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/browser.py +0 -0
  24. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/configure.zcml +0 -0
  25. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/interfaces.py +0 -0
  26. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/tests/__init__.py +0 -0
  27. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/tests/test_batching.py +0 -0
  28. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone/batching/utils.py +0 -0
  29. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone.batching.egg-info/dependency_links.txt +0 -0
  30. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone.batching.egg-info/entry_points.txt +0 -0
  31. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone.batching.egg-info/namespace_packages.txt +0 -0
  32. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone.batching.egg-info/not-zip-safe +0 -0
  33. {plone_batching-2.0.7 → plone_batching-2.0.8}/src/plone.batching.egg-info/requires.txt +0 -0
  34. {plone_batching-2.0.7 → plone_batching-2.0.8}/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
+ 2.0.8 (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
  2.0.7 (2025-09-10)
12
22
  ------------------
13
23
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: plone.batching
3
- Version: 2.0.7
3
+ Version: 2.0.8
4
4
  Summary: Batching facilities used in Plone
5
5
  Home-page: https://pypi.org/project/plone.batching
6
6
  Author: Plone Foundation
@@ -61,6 +61,16 @@ Changelog
61
61
 
62
62
  .. towncrier release notes start
63
63
 
64
+ 2.0.8 (2026-11-10)
65
+ ------------------
66
+
67
+ Bug fixes:
68
+
69
+
70
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
71
+ [maurits]
72
+
73
+
64
74
  2.0.7 (2025-09-10)
65
75
  ------------------
66
76
 
@@ -2,7 +2,7 @@
2
2
  # https://github.com/plone/meta/tree/main/src/plone/meta/default
3
3
  # See the inline comments on how to expand/tweak this configuration file
4
4
  [build-system]
5
- requires = ["setuptools>=68.2,<77", "wheel"]
5
+ requires = ["setuptools>=68.2,<80", "wheel"]
6
6
 
7
7
  [tool.towncrier]
8
8
  directory = "news/"
@@ -3,7 +3,7 @@ from setuptools import find_packages
3
3
  from setuptools import setup
4
4
 
5
5
 
6
- version = "2.0.7"
6
+ version = "2.0.8"
7
7
 
8
8
  long_description = (
9
9
  f"{Path('README.rst').read_text()}\n"
@@ -0,0 +1,10 @@
1
+ from AccessControl import allow_class
2
+ from AccessControl import ModuleSecurityInfo
3
+ from plone.batching.batch import Batch
4
+
5
+
6
+ # Only declare Batch public. Do not use allow_module here: that would make
7
+ # every name in this module available to restricted code, including
8
+ # imported names like allow_class.
9
+ ModuleSecurityInfo("plone.batching").declarePublic("Batch")
10
+ 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
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: plone.batching
3
- Version: 2.0.7
3
+ Version: 2.0.8
4
4
  Summary: Batching facilities used in Plone
5
5
  Home-page: https://pypi.org/project/plone.batching
6
6
  Author: Plone Foundation
@@ -61,6 +61,16 @@ Changelog
61
61
 
62
62
  .. towncrier release notes start
63
63
 
64
+ 2.0.8 (2026-11-10)
65
+ ------------------
66
+
67
+ Bug fixes:
68
+
69
+
70
+ - Declare only ``Batch`` public in the ``plone.batching`` module instead of opening the whole module to Restricted Python with ``allow_module``.
71
+ [maurits]
72
+
73
+
64
74
  2.0.7 (2025-09-10)
65
75
  ------------------
66
76
 
@@ -27,4 +27,5 @@ src/plone/batching/configure.zcml
27
27
  src/plone/batching/interfaces.py
28
28
  src/plone/batching/utils.py
29
29
  src/plone/batching/tests/__init__.py
30
- src/plone/batching/tests/test_batching.py
30
+ src/plone/batching/tests/test_batching.py
31
+ src/plone/batching/tests/test_security.py
@@ -1,7 +0,0 @@
1
- from AccessControl import allow_class
2
- from AccessControl import allow_module
3
- from plone.batching.batch import Batch
4
-
5
-
6
- allow_module("plone.batching")
7
- allow_class(Batch)
File without changes