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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ludovic Kiefer
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):
...
@@ -344,3 +344,6 @@ for member_id in dir(decimal):
if
isinstance
(
member
,
type
)
and
issubclass
(
member
,
decimal
.
DecimalException
):
if
isinstance
(
member
,
type
)
and
issubclass
(
member
,
decimal
.
DecimalException
):
ContainerAssertions
[
member
]
=
1
ContainerAssertions
[
member
]
=
1
del
member_id
,
member
del
member_id
,
member
from
random
import
SystemRandom
allow_type
(
SystemRandom
)
product/ERP5Type/tests/testRestrictedPythonSecurity.py
View file @
0972d806
...
@@ -25,8 +25,6 @@
...
@@ -25,8 +25,6 @@
#
#
##############################################################################
##############################################################################
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
...
@@ -123,3 +121,7 @@ class TestRestrictedPythonSecurity(ERP5TypeTestCase):
...
@@ -123,3 +121,7 @@ class TestRestrictedPythonSecurity(ERP5TypeTestCase):
'return urlparse.parse_qsl("q=s")'
,
'return urlparse.parse_qsl("q=s")'
,
expected
=
[(
'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