Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 141
    • Merge requests 141
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !1090

Merged
Created Mar 30, 2020 by Jérome Perrin@jeromeOwner

Restricted: bug fixes, support generator and collections module

  • Overview 17
  • Commits 11
  • Pipelines 6
  • Changes 5

Add some features to restricted python and fix problems revealed by running Zope's test suites.

Bug fixes

  • Disallow access to old style classes without security declarations. This is not allowed in vanilla zope, but we allowed this accidentally about two years ago. This branch includes some fixes for cases where we accessed not protected classes in a way that should not have been allowed - ERP5 test suite pass, but there might be more cases in code not covered by ERP5 test suite.
  • Fix iterating on reversed(iterable) which was unauthorized, maybe since python 2.7
  • Disallow new style classes in container access (iteration, {}.get etc). Only classes had this problem, not instances, so this probably has no impact for us, but it allows running AccessControl test suite.
  • Disallow attribute names ending in __roles__ in class name. This probably does not impact us either, but also for AccessControl tests suite.

New features

  • Allow iterating on a generator. It's still not possible to use yield statement in restricted python, but iterating is now possible
  • Allow cStringIO.StringIO("initial value"), only cStringIO.StringIO() was allowed
  • Enable collections.namedtuple and add a few tests for other members of collections ( not collections.deque because we never used it so far )
Edited Apr 03, 2020 by Jérome Perrin
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: feat/restricted_collections
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7