[Python-modules-commits] [django-auth-ldap] 01/08: Import django-auth-ldap_1.2.7+dfsg.orig.tar.gz

Michael Fladischer fladi at moszumanska.debian.org
Sat Jan 2 15:45:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch master
in repository django-auth-ldap.

commit 534a9e62260d353455ce5051cccd39d293ffc277
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Sat Jan 2 16:04:56 2016 +0100

    Import django-auth-ldap_1.2.7+dfsg.orig.tar.gz
---
 CHANGES                            |  6 ++++++
 PKG-INFO                           | 27 +++++++++++----------------
 README                             | 25 ++++++++++---------------
 django_auth_ldap.egg-info/PKG-INFO | 27 +++++++++++----------------
 django_auth_ldap/__init__.py       |  2 +-
 django_auth_ldap/models.py         |  3 ++-
 django_auth_ldap/tests.py          |  8 +++++++-
 docs/source/conf.py                |  2 +-
 docs/source/index.rst              | 14 ++++----------
 docs/source/multiconfig.rst        |  2 +-
 docs/source/reference.rst          |  6 ++++++
 docs/source/users.rst              |  5 +++++
 setup.py                           | 12 +++++++++---
 test/settings.py                   |  2 ++
 tox.ini                            | 18 ++++++++++++++----
 15 files changed, 90 insertions(+), 69 deletions(-)

diff --git a/CHANGES b/CHANGES
index a759d00..968a1cc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+v1.2.7 - 2015-09-29
+-------------------
+
+- Support Python 3 with `pyldap <https://pypi.python.org/pypi/pyldap>`_.
+
+
 v1.2.6 - 2015-03-29
 -------------------
 
diff --git a/PKG-INFO b/PKG-INFO
index e6fc65e..c482b3e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,21 +1,24 @@
 Metadata-Version: 1.1
 Name: django-auth-ldap
-Version: 1.2.6
+Version: 1.2.7
 Summary: Django LDAP authentication backend
 Home-page: http://bitbucket.org/psagers/django-auth-ldap/
 Author: Peter Sagerson
 Author-email: psagers.pypi at ignorare.net
 License: BSD
 Description: This is a Django authentication backend that authenticates against an LDAP
-        service. Configuration can be as simple as a single distinguished name
-        template, but there are many rich configuration options for working with users,
-        groups, and permissions.
+        service. Configuration can be as simple as a single distinguished name template,
+        but there are many rich configuration options for working with users, groups,
+        and permissions.
         
-        This version is tested on Python 2.6 to 2.7, Django >= 1.3, and python-ldap
-        2.4.13.
+        This version is supported on Python 2.6, 2.7, 3.3, and 3.4; and Django >= 1.3.
+        Under Python 2, it requires `python-ldap
+        <https://pypi.python.org/pypi/python-ldap>`_ >= 2.0; under Python 3, it uses
+        `pyldap <https://pypi.python.org/pypi/pyldap>`_.
         
-        Full documentation can be found at http://pythonhosted.org/django-auth-ldap/;
-        following is an example configuration, just to whet your appetite::
+        Full documentation can be found at
+        http://pythonhosted.org/django-auth-ldap/; following is an example
+        configuration, just to whet your appetite::
         
             import ldap
             from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
@@ -48,20 +51,12 @@ Description: This is a Django authentication backend that authenticates against
                 "email": "mail"
             }
         
-            AUTH_LDAP_PROFILE_ATTR_MAP = {
-                "employee_number": "employeeNumber"
-            }
-        
             AUTH_LDAP_USER_FLAGS_BY_GROUP = {
                 "is_active": "cn=active,ou=django,ou=groups,dc=example,dc=com",
                 "is_staff": "cn=staff,ou=django,ou=groups,dc=example,dc=com",
                 "is_superuser": "cn=superuser,ou=django,ou=groups,dc=example,dc=com"
             }
         
-            AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = {
-                "is_awesome": "cn=awesome,ou=django,ou=groups,dc=example,dc=com",
-            }
-        
             # Use LDAP group membership to calculate group permissions.
             AUTH_LDAP_FIND_GROUP_PERMS = True
         
diff --git a/README b/README
index bf19c70..4fe162f 100644
--- a/README
+++ b/README
@@ -1,13 +1,16 @@
 This is a Django authentication backend that authenticates against an LDAP
-service. Configuration can be as simple as a single distinguished name
-template, but there are many rich configuration options for working with users,
-groups, and permissions.
+service. Configuration can be as simple as a single distinguished name template,
+but there are many rich configuration options for working with users, groups,
+and permissions.
 
-This version is tested on Python 2.6 to 2.7, Django >= 1.3, and python-ldap
-2.4.13.
+This version is supported on Python 2.6, 2.7, 3.3, and 3.4; and Django >= 1.3.
+Under Python 2, it requires `python-ldap
+<https://pypi.python.org/pypi/python-ldap>`_ >= 2.0; under Python 3, it uses
+`pyldap <https://pypi.python.org/pypi/pyldap>`_.
 
-Full documentation can be found at http://pythonhosted.org/django-auth-ldap/;
-following is an example configuration, just to whet your appetite::
+Full documentation can be found at
+http://pythonhosted.org/django-auth-ldap/; following is an example
+configuration, just to whet your appetite::
 
     import ldap
     from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
@@ -40,20 +43,12 @@ following is an example configuration, just to whet your appetite::
         "email": "mail"
     }
 
-    AUTH_LDAP_PROFILE_ATTR_MAP = {
-        "employee_number": "employeeNumber"
-    }
-
     AUTH_LDAP_USER_FLAGS_BY_GROUP = {
         "is_active": "cn=active,ou=django,ou=groups,dc=example,dc=com",
         "is_staff": "cn=staff,ou=django,ou=groups,dc=example,dc=com",
         "is_superuser": "cn=superuser,ou=django,ou=groups,dc=example,dc=com"
     }
 
-    AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = {
-        "is_awesome": "cn=awesome,ou=django,ou=groups,dc=example,dc=com",
-    }
-
     # Use LDAP group membership to calculate group permissions.
     AUTH_LDAP_FIND_GROUP_PERMS = True
 
diff --git a/django_auth_ldap.egg-info/PKG-INFO b/django_auth_ldap.egg-info/PKG-INFO
index e6fc65e..c482b3e 100644
--- a/django_auth_ldap.egg-info/PKG-INFO
+++ b/django_auth_ldap.egg-info/PKG-INFO
@@ -1,21 +1,24 @@
 Metadata-Version: 1.1
 Name: django-auth-ldap
-Version: 1.2.6
+Version: 1.2.7
 Summary: Django LDAP authentication backend
 Home-page: http://bitbucket.org/psagers/django-auth-ldap/
 Author: Peter Sagerson
 Author-email: psagers.pypi at ignorare.net
 License: BSD
 Description: This is a Django authentication backend that authenticates against an LDAP
-        service. Configuration can be as simple as a single distinguished name
-        template, but there are many rich configuration options for working with users,
-        groups, and permissions.
+        service. Configuration can be as simple as a single distinguished name template,
+        but there are many rich configuration options for working with users, groups,
+        and permissions.
         
-        This version is tested on Python 2.6 to 2.7, Django >= 1.3, and python-ldap
-        2.4.13.
+        This version is supported on Python 2.6, 2.7, 3.3, and 3.4; and Django >= 1.3.
+        Under Python 2, it requires `python-ldap
+        <https://pypi.python.org/pypi/python-ldap>`_ >= 2.0; under Python 3, it uses
+        `pyldap <https://pypi.python.org/pypi/pyldap>`_.
         
-        Full documentation can be found at http://pythonhosted.org/django-auth-ldap/;
-        following is an example configuration, just to whet your appetite::
+        Full documentation can be found at
+        http://pythonhosted.org/django-auth-ldap/; following is an example
+        configuration, just to whet your appetite::
         
             import ldap
             from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
@@ -48,20 +51,12 @@ Description: This is a Django authentication backend that authenticates against
                 "email": "mail"
             }
         
-            AUTH_LDAP_PROFILE_ATTR_MAP = {
-                "employee_number": "employeeNumber"
-            }
-        
             AUTH_LDAP_USER_FLAGS_BY_GROUP = {
                 "is_active": "cn=active,ou=django,ou=groups,dc=example,dc=com",
                 "is_staff": "cn=staff,ou=django,ou=groups,dc=example,dc=com",
                 "is_superuser": "cn=superuser,ou=django,ou=groups,dc=example,dc=com"
             }
         
-            AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = {
-                "is_awesome": "cn=awesome,ou=django,ou=groups,dc=example,dc=com",
-            }
-        
             # Use LDAP group membership to calculate group permissions.
             AUTH_LDAP_FIND_GROUP_PERMS = True
         
diff --git a/django_auth_ldap/__init__.py b/django_auth_ldap/__init__.py
index c186393..065d66c 100644
--- a/django_auth_ldap/__init__.py
+++ b/django_auth_ldap/__init__.py
@@ -1,2 +1,2 @@
-version = (1, 2, 6)
+version = (1, 2, 7)
 version_string = '.'.join(map(str, version))
diff --git a/django_auth_ldap/models.py b/django_auth_ldap/models.py
index b48d7a3..010d2fb 100644
--- a/django_auth_ldap/models.py
+++ b/django_auth_ldap/models.py
@@ -1,3 +1,4 @@
+from django.conf import settings
 from django.db import models
 
 
@@ -26,6 +27,6 @@ class TestProfile(models.Model):
     A user profile model for use by unit tests. This has nothing to do with the
     authentication backend itself.
     """
-    user = models.OneToOneField('auth.User')
+    user = models.OneToOneField(settings.AUTH_USER_MODEL)
     is_special = models.BooleanField(default=False)
     populated = models.BooleanField(default=False)
diff --git a/django_auth_ldap/tests.py b/django_auth_ldap/tests.py
index 2193af4..8d3ecbc 100644
--- a/django_auth_ldap/tests.py
+++ b/django_auth_ldap/tests.py
@@ -41,11 +41,17 @@ from django.conf import settings
 import django.db.models.signals
 from django.contrib.auth.models import User, Permission, Group
 from django.test import TestCase
+
 try:
     from django.utils.encoding import force_str
 except ImportError:  # Django < 1.5
     from django.utils.encoding import smart_str as force_str
-from django.utils import unittest
+
+try:
+    from django.utils import unittest
+except ImportError:
+    import unittest
+
 try:
     from django.test.utils import override_settings
 except ImportError:
diff --git a/docs/source/conf.py b/docs/source/conf.py
index edb38cf..c0ddf1c 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -59,7 +59,7 @@ copyright = u'2009, Peter Sagerson'
 # The short X.Y version.
 version = '1.1'
 # The full version, including alpha/beta/rc tags.
-release = '1.2.6'
+release = '1.2.7'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 0df1bf1..c84096b 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -7,16 +7,10 @@ service. Configuration can be as simple as a single distinguished name template,
 but there are many rich configuration options for working with users, groups,
 and permissions.
 
-This version is officially supported on Python >= 2.6 and < 3, Django >= 1.3,
-and python-ldap >= 2.0. It is known to work on earlier versions (especially of
-Django) and backwards-compatibility is not broken needlessly, however users of
-older dependencies are urged to test their deployments carefully and be wary of
-updates.
-
-Support for Python >= 3.3 is considered experimental at this time. Since
-python-ldap doesn't support Python 3 yet, you have to install a fork::
-
-    $ pip install git+https://github.com/rbarrois/python-ldap.git@py3
+This version is supported on Python 2.6, 2.7, 3.3, and 3.4; and Django >= 1.3.
+Under Python 2, it requires `python-ldap
+<https://pypi.python.org/pypi/python-ldap>`_ >= 2.0; under Python 3, it uses
+`pyldap <https://pypi.python.org/pypi/pyldap>`_.
 
 .. toctree::
     :maxdepth: 2
diff --git a/docs/source/multiconfig.rst b/docs/source/multiconfig.rst
index a3822ef..863d150 100644
--- a/docs/source/multiconfig.rst
+++ b/docs/source/multiconfig.rst
@@ -21,7 +21,7 @@ example should demonstrate this:
         settings_prefix = "AUTH_LDAP_1_"
 
     class LDAPBackend2(LDAPBackend):
-        settings_prefix = "AUTH_LDAP_2_" 
+        settings_prefix = "AUTH_LDAP_2_"
 
 
 .. code-block:: python
diff --git a/docs/source/reference.rst b/docs/source/reference.rst
index ec5dec7..734a55f 100644
--- a/docs/source/reference.rst
+++ b/docs/source/reference.rst
@@ -209,6 +209,8 @@ Default: ``{}``
 A mapping from user profile field names to LDAP attribute names. A user's
 profile will be populated from his LDAP attributes at login.
 
+This is ignored in Django 1.7 and later.
+
 
 .. setting:: AUTH_LDAP_PROFILE_FLAGS_BY_GROUP
 
@@ -221,6 +223,8 @@ A mapping from boolean profile field names to distinguished names of LDAP
 groups. The corresponding field in a user's profile is set to ``True`` or
 ``False`` according to whether the user is a member of the group.
 
+This is ignored in Django 1.7 and later.
+
 
 .. setting:: AUTH_LDAP_REQUIRE_GROUP
 
@@ -499,6 +503,8 @@ Backend
     ``ldap_user`` is the same as ``user.ldap_user``. The sender is the
     :class:`~django_auth_ldap.backend.LDAPBackend` class.
 
+    This is not sent in Django 1.7 and later.
+
 .. data:: ldap_error
 
     This is a Django signal that is sent when we receive an
diff --git a/docs/source/users.rst b/docs/source/users.rst
index 42a5565..c5cc902 100644
--- a/docs/source/users.rst
+++ b/docs/source/users.rst
@@ -75,6 +75,11 @@ group membership::
 If a list of groups is given, the flag will be set if the user is a member of
 any group.
 
+.. note::
+
+    Django 1.7 and later do not directly support user profiles. In these
+    versions, LDAPBackend will ignore the profile-related settings.
+
 
 Updating Users
 --------------
diff --git a/setup.py b/setup.py
index a72a8aa..e033246 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,16 @@
 #!/usr/bin/env python
 
+import sys
+
 from setuptools import setup
 
+
+PY3 = (sys.version_info[0] == 3)
+
+
 setup(
     name="django-auth-ldap",
-    version="1.2.6",
+    version="1.2.7",
     description="Django LDAP authentication backend",
     long_description=open('README').read(),
     url="http://bitbucket.org/psagers/django-auth-ldap/",
@@ -33,12 +39,12 @@ setup(
     keywords=["django", "ldap", "authentication", "auth"],
     install_requires=[
         "django",
-        "python-ldap >= 2.0",
+        "pyldap" if PY3 else "python-ldap >= 2.0",
     ],
     setup_requires=[
         "setuptools >= 0.6c11",
     ],
     tests_require=[
-        "mockldap >= 0.2",
+        "mockldap >= 0.2.6",
     ]
 )
diff --git a/test/settings.py b/test/settings.py
index af6abb1..43b5801 100644
--- a/test/settings.py
+++ b/test/settings.py
@@ -29,3 +29,5 @@ INSTALLED_APPS = (
 )
 
 MIDDLEWARE_CLASSES = []
+
+AUTH_USER_MODEL = 'auth.User'
diff --git a/tox.ini b/tox.ini
index 0914154..e6ac844 100644
--- a/tox.ini
+++ b/tox.ini
@@ -8,13 +8,15 @@ envlist = py26-django13,
           py27-django15,
           py27-django16,
           py27-django17,
+          py27-django18,
           py33-django16,
-          py34-django17
+          py34-django17,
+          py34-django18
 
 [testenv]
 changedir = test
 commands = {envpython} manage.py test django_auth_ldap
-deps = mockldap
+deps = mockldap >= 0.2.6
 
 [testenv:py26-django13]
 basepython = python2.6
@@ -41,14 +43,22 @@ basepython = python2.7
 deps = {[testenv]deps}
        django<1.8
 
+[testenv:py27-django18]
+basepython = python2.7
+deps = {[testenv]deps}
+       django<1.9
+
 [testenv:py33-django16]
 basepython = python3.3
 deps = {[testenv]deps}
        django<1.7
-       git+https://github.com/rbarrois/python-ldap.git@py3
 
 [testenv:py34-django17]
 basepython = python3.4
 deps = {[testenv]deps}
        django<1.8
-       git+https://github.com/rbarrois/python-ldap.git@py3
+
+[testenv:py34-django18]
+basepython = python3.4
+deps = {[testenv]deps}
+       django<1.9

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-auth-ldap.git



More information about the Python-modules-commits mailing list