Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
0972d806
Commit
0972d806
authored
Mar 18, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches/Restricted: allow random.SystemRandom
parent
110d9931
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
product/ERP5Type/patches/Restricted.py
product/ERP5Type/patches/Restricted.py
+3
-0
product/ERP5Type/tests/testRestrictedPythonSecurity.py
product/ERP5Type/tests/testRestrictedPythonSecurity.py
+4
-2
No files found.
product/ERP5Type/patches/Restricted.py
View file @
0972d806
...
...
@@ -344,3 +344,6 @@ for member_id in dir(decimal):
if
isinstance
(
member
,
type
)
and
issubclass
(
member
,
decimal
.
DecimalException
):
ContainerAssertions
[
member
]
=
1
del
member_id
,
member
from
random
import
SystemRandom
allow_type
(
SystemRandom
)
product/ERP5Type/tests/testRestrictedPythonSecurity.py
View file @
0972d806
...
...
@@ -25,8 +25,6 @@
#
##############################################################################
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
...
...
@@ -123,3 +121,7 @@ class TestRestrictedPythonSecurity(ERP5TypeTestCase):
'return urlparse.parse_qsl("q=s")'
,
expected
=
[(
'q'
,
's'
)]
)
def
testSystemRandom
(
self
):
self
.
createAndRunScript
(
'import random'
,
'return random.SystemRandom().getrandbits(10)'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment