collective / dexterity.membrane

enables dexterity content items to be used as users and groups in Plone sites
3 stars 14 forks source link

Cannot login when `AuthEncoding` version >= 5 #69

Closed petschki closed 1 year ago

petschki commented 1 year ago

And if you want to do bin/instance adduser admin admin you get a traceback:

Traceback (most recent call last):
  File "/Users/peterm/workspace/fischereiverband/parts/instance/bin/interpreter", line 333, in <module>
    exec(_val)
  File "<string>", line 1, in <module>
  File "/Users/peterm/workspace/fischereiverband/eggs/Products.PlonePAS-7.0.0-py3.11.egg/Products/PlonePAS/pas.py", line 92, in _doAddUser
    retval = _old_doAddUser(login, password, roles, domains)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/peterm/workspace/fischereiverband/eggs/Products.PluggableAuthService-2.8.1-py3.11.egg/Products/PluggableAuthService/PluggableAuthService.py", line 916, in _doAddUser
    if useradder.doAddUser(login, password):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/peterm/workspace/fischereiverband/eggs/Products.PluggableAuthService-2.8.1-py3.11.egg/Products/PluggableAuthService/plugins/ZODBUserManager.py", line 228, in doAddUser
    self.addUser(login, login, password)
  File "/Users/peterm/workspace/fischereiverband/eggs/Products.PluggableAuthService-2.8.1-py3.11.egg/Products/PluggableAuthService/plugins/ZODBUserManager.py", line 286, in addUser
    self._user_passwords[user_id] = self._pw_encrypt(password)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/peterm/workspace/fischereiverband/eggs/Products.PluggableAuthService-2.8.1-py3.11.egg/Products/PluggableAuthService/plugins/ZODBUserManager.py", line 401, in _pw_encrypt
    if AuthEncoding.is_encrypted(password):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/peterm/workspace/fischereiverband/eggs/AuthEncoding-5.0-py3.11.egg/AuthEncoding/AuthEncoding.py", line 287, in is_encrypted
    for id, prefix, scheme in _getSortedSchemes():
                              ^^^^^^^^^^^^^^^^^^^
  File "/Users/peterm/workspace/fischereiverband/eggs/AuthEncoding-5.0-py3.11.egg/AuthEncoding/AuthEncoding.py", line 110, in _getSortedSchemes
    return sorted(_schemes, reverse=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'str' and 'bytes'