1. 26 Jun, 2019 2 commits
  2. 25 Jun, 2019 7 commits
  3. 20 Jun, 2019 1 commit
  4. 10 Jun, 2019 1 commit
  5. 13 Jun, 2019 1 commit
  6. 07 Jun, 2019 2 commits
  7. 06 Jun, 2019 1 commit
  8. 23 May, 2019 3 commits
  9. 21 May, 2019 1 commit
  10. 16 May, 2019 1 commit
    • Julien Tayon's avatar
      [ldapfeed] FIX: Unique Key violation when synchronizing with LDAPfeed · 3f125fdbcd70
      Julien Tayon authored
      What was happening
      ==================
      
      The bug appears when ldapfeed tries to insert a user while another user exists
      exists with a different source.
      
      Simple use case to reproduce:
      
      - create a local user in cubicweb (source=system)
      - sync with ldap
      - ldapfeed will stop complaining user already exists.
      
      Without next patch the test MUST fail with message:
      cubicweb/server/sources/native.py:714: UniqueTogetherError
      
      The ldapfeed is thus stopped ignoring any further ldap entries.
      
      
      The proposal
      ============
      
      Prior to this patch, the insertion was trying to create all CWUser with the
      computed login from eeimporter.extid2eid (method process of DataFeedLDAPAdapter).
      
      When a CWUser existed with a different cw_source ("system" for user created
      with cubicweb for instance), it created a conflict.
      
      To avoid collisions, in the extentities_generator method a bypass
      was added at the insertion layer.
      
      Prior to insertion the absence of the computed login is checked on a list of
      all existing login from a different source.
      
      If collision is detected, we skip the ldap record.
      
      By short circuiting at the CWUser entity insertion level we also avoid to treat
      CWGroup and EmailAddress related to this user.
      Hence ensuring a behaviour that will not break existing instances.
      (conservative approach: faced with ambiguity better do nothing than guess).
      
      An error message is added stating explicitly the conflict.
      
      --HG--
      branch : 3.26
      3f125fdbcd70
  11. 15 Mar, 2019 1 commit
    • Denis Laxalde's avatar
      Skip tests for ldapsource with python >= 3.7 · f59439bac0a8
      Denis Laxalde authored
      Until someone works on fixing these, this should make our CI green
      again.
      
      I tried to use setupModule() to check for python version, but
      pre_setup_database() is apparently called even when a SkipTest exception
      is raised there. So handle this in that method.
      (grafted from 4d68d20427de)
      
      --HG--
      branch : 3.26
      f59439bac0a8
  12. 16 May, 2019 2 commits
    • Denis Laxalde's avatar
      Flake8 crypto module · bfab695b740a
      Denis Laxalde authored
      --HG--
      branch : 3.26
      bfab695b740a
    • Denis Laxalde's avatar
      Make crypto module python3-compatible · 7abe23cbfda1
      Denis Laxalde authored
      * Remove usage of unicode() and decode the base64-encoded string in
        encrypt();
      * Encode the string received in decrypt() as (I supposed) it should come
        from the result of encrypt().
      
      Add tests for this module along the way.
      
      --HG--
      branch : 3.26
      7abe23cbfda1
  13. 15 May, 2019 3 commits
  14. 08 Apr, 2019 1 commit
    • Denis Laxalde's avatar
      Account for new psycopg2 exception classes mapping · afafc8fd9a45
      Denis Laxalde authored
      From psycopg2 >= 2.8, specific exceptions are raised corresponding to
      postgresql errors. E.g. a CheckViolation exception is raised instead of
      a generic IntegrityError previously when a constraint violation occurs.
      The way we intercept database errors, especially for constraint
      violation, is not compliant with that because we do not catch subclasses
      of IntegrityError in native source's doexec() method.
      
      We fix this by checking for the presence of IntegrityError error in
      exception class's mro. This is still overcomplicated and clumsy, because
      we still use string comparison, but this is the best we can do as far as
      I know. (A better fix would be 'isinstance(ex, IntegrityError)' but we
      have no engine-independent error classes, so this is not possible.
      Something like sqlalchemy's DBAPI Errors [1] might help:
      https://docs.sqlalchemy.org/en/latest/errors.html#dbapi-errors)
      
      --HG--
      branch : 3.26
      afafc8fd9a45
  15. 16 Apr, 2019 1 commit
    • Philippe Pepiot's avatar
      [devtools/testlib] avoid hidding AttributeError in create_user() · 2508ba96fad2
      Philippe Pepiot authored
      commit() might raise a AttributeError too.
      
      Use getattr(req, 'cnx', req) instead, which is a form already used to get the real cnx
      in some code:
      
      cubicweb/rset.py:577:        cnx = getattr(self.req, 'cnx', self.req)
      cubicweb/schema.py:353:                with getattr(_cw, 'cnx', _cw).security_enabled(read=False):
      
      We could use if hasattr(req, 'commit') here too but it lead to 3 additionals lines.
      Maybe we should have commit() and rollback() on
      cubicweb.web.request.ConnectionCubicWebRequestBase too ?
      
      --HG--
      branch : 3.26
      2508ba96fad2
  16. 05 Apr, 2019 3 commits
  17. 12 Feb, 2019 1 commit
  18. 14 Mar, 2019 3 commits
  19. 13 Mar, 2019 1 commit
  20. 08 Mar, 2019 4 commits