1. 14 Apr, 2020 38 commits
  2. 13 Apr, 2020 2 commits
    • Jérome Perrin's avatar
      testAuthenticationPolicy: install erp5_crm · 468da0e3
      Jérome Perrin authored
      This is a dependency of erp5_credential, it should be installed in the
      test.
      
      This fixes a test failure,
      portal_notification.sendNotification(store_as_event=True) is now an
      error when erp5_crm is not installed.
      468da0e3
    • Jérome Perrin's avatar
      Restricted: bug fixes, support generator and collections module · 12032013
      Jérome Perrin authored
      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 )
      
      See merge request !1090
      12032013