Hello community,

here is the log from the commit of package python-matrix-synapse-ldap3 for 
openSUSE:Factory checked in at 2019-11-27 13:51:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-matrix-synapse-ldap3 (Old)
 and      /work/SRC/openSUSE:Factory/.python-matrix-synapse-ldap3.new.26869 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-matrix-synapse-ldap3"

Wed Nov 27 13:51:38 2019 rev:2 rq:745364 version:0.1.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-matrix-synapse-ldap3/python-matrix-synapse-ldap3.changes
  2017-08-12 20:24:48.800116935 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-matrix-synapse-ldap3.new.26869/python-matrix-synapse-ldap3.changes
       2019-11-27 13:51:44.452449835 +0100
@@ -1,0 +2,14 @@
+Tue Nov  5 09:09:25 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Add patch to fix py3 testsuite execution:
+  * py3compat.patch
+- Disable python3 package as the thing can't work with py3
+
+-------------------------------------------------------------------
+Wed Sep 11 13:22:08 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.1.3:
+  * various bugfixes
+- Enable tests (fail with py3)
+
+-------------------------------------------------------------------

Old:
----
  _service
  python-matrix-synapse-ldap3-0.1.2.tar.gz

New:
----
  py3compat.patch
  python-matrix-synapse-ldap3-0.1.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-matrix-synapse-ldap3.spec ++++++
--- /var/tmp/diff_new_pack.ub2ikY/_old  2019-11-27 13:51:45.376449068 +0100
+++ /var/tmp/diff_new_pack.ub2ikY/_new  2019-11-27 13:51:45.380449065 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-matrix-synapse-ldap3
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,34 +12,37 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
+#
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-
+%define skip_python3 1
 %define         github_user matrix-org
 %define         short_name matrix-synapse-ldap3
 Name:           python-%{short_name}
-Version:        0.1.2
+Version:        0.1.3
 Release:        0
-License:        Apache-2.0
 Summary:        An LDAP3 auth provider for Synapse
-Url:            https://github.com/%{github_user}/%{short_name}
-Group:          Development/Languages/Python
+License:        Apache-2.0
+URL:            https://github.com/matrix-org/matrix-synapse-ldap3
 Source:         
https://github.com/%{github_user}/%{short_name}/archive/v%{version}/%{name}-%{version}.tar.gz
-BuildRequires:  %{python_module base}
+# https://github.com/matrix-org/matrix-synapse-ldap3/issues/73
+Patch0:         py3compat.patch
+BuildRequires:  %{python_module Twisted >= 15.1}
+BuildRequires:  %{python_module ldap3 >= 0.9.5}
+BuildRequires:  %{python_module ldaptor}
+BuildRequires:  %{python_module mock}
+BuildRequires:  %{python_module pydenticon}
+BuildRequires:  %{python_module service_identity}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-BuildRequires:  %{python_module Twisted}
-BuildRequires:  %{python_module ldap3}
-BuildRequires:  %{python_module pydenticon}
-Requires:       python-Twisted
-Requires:       python-ldap3
+Requires:       python-Twisted >= 15.1
+Requires:       python-ldap3 >= 0.9.5
 Requires:       python-pydenticon
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+Requires:       python-service_identity
 BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -49,17 +52,21 @@
 
 %prep
 %setup -q -n %{short_name}-%{version}
+%patch0 -p1
 
 %build
 %python_build
 
 %install
 %python_install
-%fdupes %{buildroot}%{_prefix}
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+
+%check
+%python_exec setup.py test
 
 %files %{python_files}
-%defattr(-,root,root,-)
-%doc LICENSE README.rst
+%license LICENSE
+%doc README.rst
 %{python_sitelib}/*
 
 %changelog

++++++ py3compat.patch ++++++
Index: matrix-synapse-ldap3-0.1.3/tests/__init__.py
===================================================================
--- matrix-synapse-ldap3-0.1.3.orig/tests/__init__.py
+++ matrix-synapse-ldap3-0.1.3/tests/__init__.py
@@ -5,7 +5,10 @@ from twisted.python.components import re
 from ldaptor.inmemory import fromLDIFFile
 from ldaptor.interfaces import IConnectedLDAPEntry
 from ldaptor.protocols.ldap.ldapserver import LDAPServer
-from cStringIO import StringIO
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from io import StringIO
 
 from ldap_auth_provider import LdapAuthProvider
 
++++++ python-matrix-synapse-ldap3-0.1.2.tar.gz -> 
python-matrix-synapse-ldap3-0.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matrix-synapse-ldap3-0.1.2/README.rst 
new/matrix-synapse-ldap3-0.1.3/README.rst
--- old/matrix-synapse-ldap3-0.1.2/README.rst   2017-02-02 01:27:33.000000000 
+0100
+++ new/matrix-synapse-ldap3-0.1.3/README.rst   2017-08-01 23:37:40.000000000 
+0200
@@ -29,3 +29,37 @@
         #bind_dn:
         #bind_password:
         #filter: "(objectClass=posixAccount)"
+
+Troubleshooting and Debugging
+-----------------------------
+
+``matrix-synapse-ldap3`` logging is included in the Synapse homeserver log
+(typically ``homeserver.log``). The LDAP plugin log level can be increased to
+``DEBUG`` for troubleshooting and debugging by making the following 
modifications
+to your Synapse server's logging configuration file:
+
+- Set the value for `handlers.file.level` to `DEBUG`:
+
+.. code:: yaml
+
+   handlers:
+     file:
+       # [...]
+       level: DEBUG
+
+- Add the following to the `loggers` section:
+
+.. code:: yaml
+
+   loggers:
+      # [...]
+      ldap3:
+        level: DEBUG
+      ldap_auth_provider:
+        level: DEBUG
+
+Finally, restart your Synapse server for the changes to take effect:
+
+.. code:: sh
+
+   synctl restart
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matrix-synapse-ldap3-0.1.2/ldap_auth_provider.py 
new/matrix-synapse-ldap3-0.1.3/ldap_auth_provider.py
--- old/matrix-synapse-ldap3-0.1.2/ldap_auth_provider.py        2017-02-02 
01:27:33.000000000 +0100
+++ new/matrix-synapse-ldap3-0.1.3/ldap_auth_provider.py        2017-08-01 
23:37:40.000000000 +0200
@@ -22,7 +22,7 @@
 import logging
 
 
-__version__ = "0.1.2"
+__version__ = "0.1.3"
 
 
 try:
@@ -173,10 +173,20 @@
                     ]
                 )
 
-                if len(conn.response) == 1:
-                    attrs = conn.response[0]['attributes']
-                    mail = attrs[self.ldap_attributes['mail']][0]
+                responses = [
+                    response
+                    for response
+                    in conn.response
+                    if response['type'] == 'searchResEntry'
+                ]
+
+                if len(responses) == 1:
+                    attrs = responses[0]['attributes']
                     name = attrs[self.ldap_attributes['name']][0]
+                    try:
+                        mail = attrs[self.ldap_attributes['mail']][0]
+                    except KeyError:
+                        mail = None
 
                     # create account
                     user_id, access_token = (
@@ -194,12 +204,12 @@
 
                     defer.returnValue(True)
                 else:
-                    if len(conn.response) == 0:
+                    if len(responses) == 0:
                         logger.warning("LDAP registration failed, no result.")
                     else:
                         logger.warning(
                             "LDAP registration failed, too many results (%s)",
-                            len(conn.response)
+                            len(responses)
                         )
 
                     defer.returnValue(False)
@@ -370,9 +380,16 @@
                 search_filter=query
             )
 
-            if len(conn.response) == 1:
+            responses = [
+                response
+                for response
+                in conn.response
+                if response['type'] == 'searchResEntry'
+            ]
+
+            if len(responses) == 1:
                 # GOOD: found exactly one result
-                user_dn = conn.response[0]['dn']
+                user_dn = responses[0]['dn']
                 logger.debug('LDAP search found dn: %s', user_dn)
 
                 # unbind and simple bind with user_dn to verify the password
@@ -386,7 +403,7 @@
                 defer.returnValue(result)
             else:
                 # BAD: found 0 or > 1 results, abort!
-                if len(conn.response) == 0:
+                if len(responses) == 0:
                     logger.info(
                         "LDAP search returned no results for '%s'",
                         localpart
@@ -394,7 +411,7 @@
                 else:
                     logger.info(
                         "LDAP search returned too many (%s) results for '%s'",
-                        len(conn.response), localpart
+                        len(responses), localpart
                     )
                 yield threads.deferToThread(conn.unbind)
                 defer.returnValue((False, None))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matrix-synapse-ldap3-0.1.2/setup.py 
new/matrix-synapse-ldap3-0.1.3/setup.py
--- old/matrix-synapse-ldap3-0.1.2/setup.py     2017-02-02 01:27:33.000000000 
+0100
+++ new/matrix-synapse-ldap3-0.1.3/setup.py     2017-08-01 23:37:40.000000000 
+0200
@@ -46,7 +46,7 @@
     description="An LDAP3 auth provider for Synapse",
     install_requires=[
         "Twisted>=15.1.0",
-        "ldap3",
+        "ldap3>=0.9.5",
         "service_identity",
     ],
     long_description=read_file(("README.rst",)),


Reply via email to