From 498298c12d063cbfb6120309eda941896cb83bf6 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 5 Jul 2020 15:57:28 +0200 Subject: [PATCH 01/18] [auth] Allow to use user attributes if auth by ldap bind --- README.rst | 16 +++++++++------- cas_server/auth.py | 5 +++-- cas_server/default_settings.py | 9 ++++++++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 87b663f..d582721 100644 --- a/README.rst +++ b/README.rst @@ -423,16 +423,18 @@ Only useful if you are using the ldap authentication backend: The hashed password in the database is compared to the hexadecimal digest of the clear password hashed with the corresponding algorithm. * ``"plain"``, the password in the database must be in clear. - * ``"bind``, the user credentials are used to bind to the ldap database and retreive the user + * ``"bind"``, the user credentials are used to bind to the ldap database and retreive the user attribute. In this mode, the settings ``CAS_LDAP_PASSWORD_ATTR`` and ``CAS_LDAP_PASSWORD_CHARSET`` - are ignored, and it is the ldap server that performs the password check. The counterpart is that - the user attributes are only available upon user password check and so are cached for later - use. All the other modes directly fetch the user attributes from the database whenever they - are needed. This mean that is you use this mode, there can be some differences between the - attributes in database and the cached ones if changes happen in the database after the user - authentiates. See the parameter ``CAS_TGT_VALIDITY`` to force user to reauthenticate periodically. + are ignored, and it is the ldap server that performs the password check. The default is ``"ldap"``. +* ``CAS_LDAP_ATTRS_VIEW``: This parameter is only used then ``CAS_LDAP_PASSWORD_CHECK`` is set to + ``"bind"``. If ``0`` the user attributes are retrieved by connecting to the ldap as ``CAS_LDAP_USER``. + If ``1`` the user attributes are retrieve then the user authenticate using the user credentials and + are cached for later use. It means there can be some differences between the attributes in database + and the cached ones. See the parameter ``CAS_TGT_VALIDITY`` to force user to reauthenticate + periodically. + The default is ``0``. * ``CAS_LDAP_PASSWORD_CHARSET``: Charset the LDAP users passwords was hashed with. This is needed to encode the user submitted password before hashing it for comparison. The default is ``"utf-8"``. diff --git a/cas_server/auth.py b/cas_server/auth.py index 0e07d74..24f3881 100644 --- a/cas_server/auth.py +++ b/cas_server/auth.py @@ -394,8 +394,9 @@ class LdapAuthUser(DBAuthUser): # pragma: no cover :raises NotImplementedError: if the password check method in `CAS_LDAP_PASSWORD_CHECK` do not allow to fetch the attributes without the user credentials. """ - if settings.CAS_LDAP_PASSWORD_CHECK == "bind": - raise NotImplementedError() + if settings.CAS_LDAP_PASSWORD_CHECK == "bind" and settings.CAS_LDAP_ATTRS_VIEW == 1: + user = UserAttributes.objects.get(username=self.username) + return user.attributs else: return super(LdapAuthUser, self).attributs() diff --git a/cas_server/default_settings.py b/cas_server/default_settings.py index 744a6f7..8cd092c 100644 --- a/cas_server/default_settings.py +++ b/cas_server/default_settings.py @@ -165,10 +165,17 @@ CAS_LDAP_USERNAME_ATTR = "uid" CAS_LDAP_PASSWORD_ATTR = "userPassword" #: The method used to check the user password. Must be one of ``"crypt"``, ``"ldap"``, #: ``"hex_md5"``, ``"hex_sha1"``, ``"hex_sha224"``, ``"hex_sha256"``, ``"hex_sha384"``, -#: ``"hex_sha512"``, ``"plain"``. +#: ``"hex_sha512"``, ``"plain"``, ``"bind"``. CAS_LDAP_PASSWORD_CHECK = "ldap" #: charset the LDAP users passwords was hash with CAS_LDAP_PASSWORD_CHARSET = "utf-8" +#: This parameter is only used then ``CAS_LDAP_PASSWORD_CHECK`` is set to ``"bind"``. +#: * if ``0`` the user attributes are retrieved by connecting to the ldap as +#: ``CAS_LDAP_USER``. +#: * if ``1`` the user attributes are retrieve then the user authenticate using +#: the user credentials. These attributes are then cached for the session. +#: The default is ``0``. +CAS_LDAP_ATTRS_VIEW = 0 #: Username of the test user. From 85426ded17955934c9f5752d9d9bde157877a9ab Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 5 Jul 2020 16:06:04 +0200 Subject: [PATCH 02/18] Fix spelling mistakes in french translation --- cas_server/locale/fr/LC_MESSAGES/django.mo | Bin 10151 -> 10113 bytes cas_server/locale/fr/LC_MESSAGES/django.po | 16 ++++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cas_server/locale/fr/LC_MESSAGES/django.mo b/cas_server/locale/fr/LC_MESSAGES/django.mo index 74d9ce92820483153aad3f48ad41d21e07c589ce..078033d213f84aa391e9544705c3dd24e84e070f 100644 GIT binary patch delta 748 zcmXZaKWGzS9LDkI(ncdKO^v3hwMou2Hi)LZo{1$<5o=RKh1Q}-!9_GeP+DqAJ06A7 z#i7bYTm+q};-GNWNl{Sz109_0;wT78L2%UXOEX+P@9(|$e(#&-?(z8I_=}~Gciobf zc1y#Oe#WH^>b@>%joM8}tM~(-;!3x~EtU32&v62Op?aiI_>JeWuvZ$vWju;skVh5n zl`@#ZeR#50o(?g%$^_5q4zib?;cn zBS!Hnj^TGS{c>rK%^6%vO9$~YnuGkoB1Y}4MitCa-$Zlr26o~rjNvDo#c!A)!E-D! ziOg_Xlf+AWfPb+K8+}{*J@Ob_VqzU_%x0x_tf2WvlUTslXb!fC5p3Ttl`)Q{oHO%GxoX*V9oNY_!+ED@ z4;?8x#ULDySYda-9T*B?T{l`o)mwqrbD+f<^Y11T{=4KLGyZ0B)nCZPf+wlOHme@I N&0Yvub$?f`@gEAsVF&;K delta 784 zcmZ|N-)~EC7{~EX&pPHuHj|>JU5}YDbDDEHwzVb_TV}RN5kV#rB^4!GgN6`ECz-n? zF4}|(*JD=`CxoREi3|G!TsCf82}*F`j`ufu>!RoNeV+3@&-Xb`&)xLn^wU|Zct0S` zhNON;p^Z{A@dQ36KC?-h$JVg4fG?3-I=@+3#9LUy?lx%{!&{_dcoq-hBJRT<$fJr! zqz*iUTkMeSxWM}iu9g`BDPxF5e@6nAkM#8ET_?xETD1c&eq<}lbUoyKYG!gsg| zYuJLnaRi%U|LUbGITAhi9Ze$Cu6mt1#XE;;HrtF04^*L_R z@dj+qOC^#$Zo+j}A5A;Qvo~_r|F^H#^{b(#K%*BQh$sC|8?FScw+sHsw(f?&#nMc4 dgs8L}o%i$YJ6BkCrc{gC{!(YcDt+xL{{;ZCZ+-v( diff --git a/cas_server/locale/fr/LC_MESSAGES/django.po b/cas_server/locale/fr/LC_MESSAGES/django.po index 406da03..8be90da 100644 --- a/cas_server/locale/fr/LC_MESSAGES/django.po +++ b/cas_server/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: cas_server\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-09-18 11:29+0200\n" -"PO-Revision-Date: 2016-09-18 11:30+0200\n" +"PO-Revision-Date: 2020-07-05 16:05+0200\n" "Last-Translator: Valentin Samir \n" "Language-Team: django \n" "Language: fr\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Poedit 1.8.9\n" +"X-Generator: Poedit 2.2.1\n" #: apps.py:25 templates/cas_server/base.html:7 #: templates/cas_server/base.html:26 @@ -36,7 +36,7 @@ msgstr "" #: forms.py:85 msgid "Identity provider" -msgstr "fournisseur d'identité" +msgstr "Fournisseur d'identité" #: forms.py:89 forms.py:111 msgid "Warn me before logging me into other sites." @@ -112,7 +112,7 @@ msgstr "Version du protocole CAS" msgid "" "Version of the CAS protocol to use when sending requests the the backend CAS." msgstr "" -"Version du protocole CAS à utiliser lorsque l'on envoie des requête au CAS " +"Version du protocole CAS à utiliser lorsque l'on envoie des requêtes au CAS " "du fournisseur d'identité." #: models.py:106 @@ -158,7 +158,7 @@ msgstr "Motifs de services" #: models.py:447 msgid "service patterns are sorted using the position attribute" -msgstr "Les motifs de service sont trié selon l'attribut position" +msgstr "Les motifs de service sont triés selon l'attribut position" #: models.py:455 models.py:620 msgid "name" @@ -179,7 +179,7 @@ msgid "" "character must be escaped with a '\\'." msgstr "" "Une expression rationnelle reconnaissant un service. Devrait généralement " -"ressemblé à '^https://un\\.serveur\\.fr/chemin/.*$'. Comme il s'agit d'une " +"ressembler à '^https://un\\.serveur\\.fr/chemin/.*$'. Comme il s'agit d'une " "expression rationnelle, les caractères spéciaux doivent être échappés avec " "un '\\'." @@ -200,7 +200,7 @@ msgstr "limiter les noms d'utilisateurs" #: models.py:484 msgid "Limit username allowed to connect to the list provided bellow" msgstr "" -"Limiter les noms d'utilisateurs autorisé à se connecter à la liste fournie " +"Limiter les noms d'utilisateurs autorisés à se connecter à la liste fournie " "ci-dessous" #: models.py:489 @@ -376,7 +376,7 @@ msgstr "" #: views.py:500 msgid "Invalid login ticket, please try to log in again" -msgstr "Ticket de connexion invalide, merci de réessayé de vous connecter" +msgstr "Ticket de connexion invalide, merci de réessayer de vous connecter" #: views.py:692 #, python-format From f0f4ec0bdcb22ac46265e0bfd301e456fea708bc Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Thu, 3 Sep 2020 15:41:31 +0200 Subject: [PATCH 03/18] [auth] ldap backup, implement CAS_LDAP_ATTRS_VIEW set to 0 --- cas_server/auth.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cas_server/auth.py b/cas_server/auth.py index 24f3881..2741c97 100644 --- a/cas_server/auth.py +++ b/cas_server/auth.py @@ -391,12 +391,13 @@ class LdapAuthUser(DBAuthUser): # pragma: no cover or :class:`list` of :func:`unicode`. If the user do not exists, the returned :class:`dict` is empty. :rtype: dict - :raises NotImplementedError: if the password check method in `CAS_LDAP_PASSWORD_CHECK` - do not allow to fetch the attributes without the user credentials. """ - if settings.CAS_LDAP_PASSWORD_CHECK == "bind" and settings.CAS_LDAP_ATTRS_VIEW == 1: - user = UserAttributes.objects.get(username=self.username) - return user.attributs + if settings.CAS_LDAP_PASSWORD_CHECK == "bind": + if settings.CAS_LDAP_ATTRS_VIEW == 1: + user = UserAttributes.objects.get(username=self.username) + return user.attributs + else: + return self.user else: return super(LdapAuthUser, self).attributs() From 8cbd1fa789694b277971540542ba18a2e23d3799 Mon Sep 17 00:00:00 2001 From: Benyamin Jafari Date: Sat, 19 Sep 2020 14:35:06 +0430 Subject: [PATCH 04/18] Update README.rst MIDDLEWARE_CLASSES is the old setting, MIDDLEWARE is the new setting --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 87b663f..bd8888f 100644 --- a/README.rst +++ b/README.rst @@ -136,13 +136,13 @@ Quick start ) For internationalization support, add "django.middleware.locale.LocaleMiddleware" - to your MIDDLEWARE_CLASSES setting like this:: + to your MIDDLEWARE setting like this:: - MIDDLEWARE_CLASSES = ( + MIDDLEWARE = [ ... 'django.middleware.locale.LocaleMiddleware', ... - ) + ] 2. Include the cas_server URLconf in your project urls.py like this:: From 40d55012b1b2899763260d69ce1d5718cfeb7e8a Mon Sep 17 00:00:00 2001 From: kishorkunal-raj Date: Thu, 24 Sep 2020 11:12:41 +0000 Subject: [PATCH 05/18] Added ppc64le architecture support on travis-ci --- .travis.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7f0543b..636f1e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,46 @@ matrix: env: TOX_ENV=py38-django30 - python: "3.8" env: TOX_ENV=coverage + - python: "3.8" + env: TOX_ENV=flake8 + arch: ppc64le + - python: "3.8" + env: TOX_ENV=check_rst + arch: ppc64le + - python: "2.7" + env: TOX_ENV=py27-django111 + arch: ppc64le + - python: "3.5" + env: TOX_ENV=py35-django111 + arch: ppc64le + - python: "3.6" + env: TOX_ENV=py36-django111 + arch: ppc64le + - python: "3.5" + env: TOX_ENV=py35-django20 + arch: ppc64le + - python: "3.6" + env: TOX_ENV=py36-django20 + arch: ppc64le + - python: "3.5" + env: TOX_ENV=py35-django21 + arch: ppc64le + - python: "3.6" + env: TOX_ENV=py36-django21 + arch: ppc64le + - python: "3.7" + env: TOX_ENV=py37-django22 + arch: ppc64le + - python: "3.8" + env: TOX_ENV=py38-django22 + arch: ppc64le + - python: "3.8" + env: TOX_ENV=py38-django30 + arch: ppc64le + - python: "3.8" + env: TOX_ENV=coverage + arch: ppc64le + cache: directories: - $HOME/.cache/pip/http/ From a7427ed795b7711af25f86e39114d994ef30bab2 Mon Sep 17 00:00:00 2001 From: Philippe Vivien Date: Wed, 14 Oct 2020 18:11:34 +0200 Subject: [PATCH 06/18] fix bug model datefield Form (Federated User Admin) --- cas_server/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cas_server/models.py b/cas_server/models.py index b8950a6..1b38383 100644 --- a/cas_server/models.py +++ b/cas_server/models.py @@ -180,7 +180,7 @@ class FederatedUser(JsonAttributes): #: The last ticket used to authenticate :attr:`username` against :attr:`provider` ticket = models.CharField(max_length=255) #: Last update timespampt. Usually, the last time :attr:`ticket` has been set. - last_update = models.DateTimeField(auto_now=True) + last_update = models.DateTimeField(default=timezone.now) def __str__(self): return self.federated_username From 802fef95fa1c59a1b5e1715910426268c97f3b6f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 22 Dec 2020 23:07:32 +0100 Subject: [PATCH 07/18] Add Django 3.1 and Python 3.9 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO Signed-off-by: Yohann D'ANELLO --- .travis.yml | 6 +++ README.rst | 4 +- setup.py | 4 +- tox.ini | 112 +++++++++++++++++++++------------------------------- 4 files changed, 55 insertions(+), 71 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f0543b..cf7fa85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,12 @@ matrix: - python: "3.8" env: TOX_ENV=py38-django30 - python: "3.8" + env: TOX_ENV=py38-django31 + - python: "3.9" + env: TOX_ENV=py39-django30 + - python: "3.9" + env: TOX_ENV=py39-django31 + - python: "3.9" env: TOX_ENV=coverage cache: directories: diff --git a/README.rst b/README.rst index 87b663f..afd3fba 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ Features * Possibility to rename/rewrite attributes per service * Possibility to require some attribute values per service * Federated mode between multiple CAS -* Supports Django 1.11, 2.2 and 3.0 +* Supports Django 1.11, 2.2 and 3.1 * Supports Python 2.7, 3.5+ Dependencies @@ -29,7 +29,7 @@ Dependencies ``django-cas-server`` depends on the following python packages: -* Django >= 1.11 < 3.1 +* Django >= 1.11 < 3.2 * requests >= 2.4 * requests_futures >= 0.9.5 * lxml >= 3.4 diff --git a/setup.py b/setup.py index 38cfb70..417892e 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ if __name__ == '__main__': 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', @@ -48,6 +49,7 @@ if __name__ == '__main__': 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', @@ -62,7 +64,7 @@ if __name__ == '__main__': }, keywords=['django', 'cas', 'cas3', 'server', 'sso', 'single sign-on', 'authentication', 'auth'], install_requires=[ - 'Django >= 1.11,<3.1', 'requests >= 2.4', 'requests_futures >= 0.9.5', + 'Django >= 1.11,<3.2', 'requests >= 2.4', 'requests_futures >= 0.9.5', 'lxml >= 3.4', 'six >= 1' ], url="https://github.com/nitmir/django-cas-server", diff --git a/tox.ini b/tox.ini index c398c06..a8a45d5 100644 --- a/tox.ini +++ b/tox.ini @@ -9,9 +9,15 @@ envlist= py36-django22, py37-django22, py38-django22, + py39-django22, py36-django30, py37-django30, py38-django30, + py39-django30, + py36-django31, + py37-django31, + py38-django31, + py39-django31, [flake8] max-line-length=100 @@ -37,54 +43,12 @@ commands= {[post_cmd]commands} whitelist_externals={[post_cmd]whitelist_externals} -[testenv:py27-django17] -basepython=python2.7 -deps = - Django>=1.7,<1.8 - {[base]deps} - -[testenv:py27-django18] -basepython=python2.7 -deps = - Django>=1.8,<1.9 - {[base]deps} - -[testenv:py27-django19] -basepython=python2.7 -deps = - Django>=1.9,<1.10 - {[base]deps} - -[testenv:py27-django110] -basepython=python2.7 -deps = - Django>=1.10,<1.11 - {[base]deps} - [testenv:py27-django111] basepython=python2.7 deps = Django>=1.11,<1.12 {[base]deps} -[testenv:py34-django17] -basepython=python3.4 -deps = - Django>=1.7,<1.8 - {[base]deps} - -[testenv:py34-django18] -basepython=python3.4 -deps = - Django>=1.8,<1.9 - {[base]deps} - -[testenv:py35-django110] -basepython=python3.5 -deps = - Django>=1.10,<1.11 - {[base]deps} - [testenv:py35-django111] basepython=python3.5 deps = @@ -97,34 +61,10 @@ deps = Django>=1.11,<1.12 {[base]deps} -[testenv:py35-django20] -basepython=python3.5 -deps = - Django>=2.0,<2.1 - {[base]deps} - -[testenv:py36-django20] -basepython=python3.6 -deps = - Django>=2.0,<2.1 - {[base]deps} - -[testenv:py35-django21] -basepython=python3.5 -deps = - Django>=2.1,<2.2 - {[base]deps} - -[testenv:py36-django21] -basepython=python3.6 -deps = - Django>=2.1,<2.2 - {[base]deps} - -[testenv:py37-django21] +[testenv:py37-django111] basepython=python3.7 deps = - Django>=2.1,<2.2 + Django>=1.11,<1.12 {[base]deps} [testenv:py36-django22] @@ -145,6 +85,12 @@ deps = Django>=2.2,<3.0 {[base]deps} +[testenv:py39-django22] +basepython=python3.9 +deps = + Django>=2.2,<3.0 + {[base]deps} + [testenv:py36-django30] basepython=python3.6 deps = @@ -163,6 +109,36 @@ deps = Django>=3.0,<3.1 {[base]deps} +[testenv:py39-django30] +basepython=python3.9 +deps = + Django>=3.0,<3.1 + {[base]deps} + +[testenv:py36-django31] +basepython=python3.6 +deps = + Django>=3.1,<3.2 + {[base]deps} + +[testenv:py37-django31] +basepython=python3.7 +deps = + Django>=3.1,<3.2 + {[base]deps} + +[testenv:py38-django31] +basepython=python3.8 +deps = + Django>=3.1,<3.2 + {[base]deps} + +[testenv:py39-django31] +basepython=python3.9 +deps = + Django>=3.1,<3.2 + {[base]deps} + [testenv:flake8] basepython=python3 From 10b389e7bebf5770c9ff7840acc9943eb2474b52 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 22 Dec 2020 23:07:33 +0100 Subject: [PATCH 08/18] With Python 3.9, the crypt function raises an OSError See https://bugs.python.org/issue39289 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO Signed-off-by: Yohann D'ANELLO --- cas_server/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cas_server/utils.py b/cas_server/utils.py index f2bb4db..4ec2333 100644 --- a/cas_server/utils.py +++ b/cas_server/utils.py @@ -409,7 +409,10 @@ def crypt_salt_is_valid(salt): if '$' not in salt[1:]: return False else: - hashed = crypt.crypt("", salt) + try: + hashed = crypt.crypt("", salt) + except OSError: + return False if not hashed or '$' not in hashed[1:]: return False else: From d62def6d6b1b7d94e520567f7b58f2a65e181f71 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 22 Dec 2020 23:07:33 +0100 Subject: [PATCH 09/18] django.conf.urls is deprecated and will be removed in Django 4.0, use django.urls.re_path instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO Signed-off-by: Yohann D'ANELLO --- cas_server/tests/urls.py | 14 ++++++++++++-- cas_server/urls.py | 35 +++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/cas_server/tests/urls.py b/cas_server/tests/urls.py index a9ed25c..b95c228 100644 --- a/cas_server/tests/urls.py +++ b/cas_server/tests/urls.py @@ -13,10 +13,20 @@ Including another URLconf 1. Import the include() function: from django.conf.urls import url, include, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ + +import django + +if django.VERSION < (2,): + from django.conf.urls import url + re_path = url +else: + from django.urls import re_path + + from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ - url(r'^admin/', admin.site.urls), - url(r'^', include('cas_server.urls', namespace='cas_server')), + re_path(r'^admin/', admin.site.urls), + re_path(r'^', include('cas_server.urls', namespace='cas_server')), ] diff --git a/cas_server/urls.py b/cas_server/urls.py index 1e874c0..680c61e 100644 --- a/cas_server/urls.py +++ b/cas_server/urls.py @@ -10,6 +10,16 @@ # # (c) 2015-2016 Valentin Samir """urls for the app""" + +import django + +if django.VERSION < (2,): + from django.conf.urls import url + re_path = url +else: + from django.urls import re_path + + from django.conf.urls import url from django.views.generic import RedirectView from django.views.decorators.debug import sensitive_post_parameters, sensitive_variables @@ -19,42 +29,42 @@ from cas_server import views app_name = "cas_server" urlpatterns = [ - url( + re_path( r'^$', RedirectView.as_view(pattern_name="cas_server:login", permanent=False, query_string=True) ), - url( + re_path( '^login$', sensitive_post_parameters('password')( views.LoginView.as_view() ), name='login' ), - url('^logout$', views.LogoutView.as_view(), name='logout'), - url('^validate$', views.Validate.as_view(), name='validate'), - url( + re_path('^logout$', views.LogoutView.as_view(), name='logout'), + re_path('^validate$', views.Validate.as_view(), name='validate'), + re_path( '^serviceValidate$', views.ValidateService.as_view(allow_proxy_ticket=False), name='serviceValidate' ), - url( + re_path( '^proxyValidate$', views.ValidateService.as_view(allow_proxy_ticket=True), name='proxyValidate' ), - url('^proxy$', views.Proxy.as_view(), name='proxy'), - url( + re_path('^proxy$', views.Proxy.as_view(), name='proxy'), + re_path( '^p3/serviceValidate$', views.ValidateService.as_view(allow_proxy_ticket=False), name='p3_serviceValidate' ), - url( + re_path( '^p3/proxyValidate$', views.ValidateService.as_view(allow_proxy_ticket=True), name='p3_proxyValidate' ), - url('^samlValidate$', views.SamlValidate.as_view(), name='samlValidate'), - url( + re_path('^samlValidate$', views.SamlValidate.as_view(), name='samlValidate'), + re_path( '^auth$', sensitive_variables('password', 'secret')( sensitive_post_parameters('password', 'secret')( @@ -63,5 +73,6 @@ urlpatterns = [ ), name='auth' ), - url("^federate(?:/(?P([^/]+)))?$", views.FederateAuth.as_view(), name='federateAuth'), + re_path("^federate(?:/(?P([^/]+)))?$", + views.FederateAuth.as_view(), name='federateAuth'), ] From 251cfb9b49c3fa2c57d4526399f07339f3324e63 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 22 Dec 2020 23:07:33 +0100 Subject: [PATCH 10/18] Construct a middleware without a get_response function is deprecated and will not work in a future release. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO Signed-off-by: Yohann D'ANELLO --- cas_server/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cas_server/views.py b/cas_server/views.py index a1f2873..bbf5490 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -288,7 +288,8 @@ class FederateAuth(CsrfExemptView): # else, a User is trying to log in using an identity provider except FederatedIendityProvider.DoesNotExist: # Manually checking for csrf to protect the code below - reason = CsrfViewMiddleware().process_view(request, None, (), {}) + reason = CsrfViewMiddleware(lambda request: HttpResponse()) \ + .process_view(request, None, (), {}) if reason is not None: # pragma: no cover (csrf checks are disabled during tests) return reason # Failed the test, stop here. form = forms.FederateSelect(request.POST) From 2a07cca1f1080e9b45a8bd6f735568dc9e8ca1fc Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 22 Dec 2020 23:42:58 +0100 Subject: [PATCH 11/18] Support for Django 2.0 and 2.1 was dropped Signed-off-by: Yohann D'ANELLO --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf7fa85..ca142f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,14 +11,6 @@ matrix: env: TOX_ENV=py35-django111 - python: "3.6" env: TOX_ENV=py36-django111 - - python: "3.5" - env: TOX_ENV=py35-django20 - - python: "3.6" - env: TOX_ENV=py36-django20 - - python: "3.5" - env: TOX_ENV=py35-django21 - - python: "3.6" - env: TOX_ENV=py36-django21 - python: "3.7" env: TOX_ENV=py37-django22 - python: "3.8" From ba9cfaf1dc6d98c66d61869b6b035b413b92bde2 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 26 Jan 2021 14:53:51 +0100 Subject: [PATCH 12/18] Update test environment, don't test anymore with Django 2.0 and Django 2.1 Signed-off-by: Yohann D'ANELLO --- .gitlab-ci.yml | 159 +++++++++++++++++++++++-------------------------- .travis.yml | 6 +- 2 files changed, 79 insertions(+), 86 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cffb395..0394afa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ before_script: - pip install tox setuptools flake8: - image: "python:2.7" + image: "python:3.9" cache: key: flake8 paths: @@ -11,7 +11,7 @@ flake8: - tox -e flake8 check_rst: - image: "python:2.7" + image: "python:3.9" cache: key: check_rst paths: @@ -19,107 +19,98 @@ check_rst: script: - tox -e check_rst -py27-django17: +py27-django111: image: "python:2.7" cache: - key: py27-django17 + key: py27-django111 paths: - - .tox/py27-django17 + - .tox/py27-django111 script: - - tox -e py27-django17 + - tox -e py27-django111 -py27-django18: - image: "python:2.7" - cache: - key: py27-django18 - paths: - - .tox/py27-django18 - script: - - tox -e py27-django18 - -py27-django19: - image: "python:2.7" - cache: - key: py27-django19 - paths: - - .tox/py27-django19 - script: - - tox -e py27-django19 - -py27-django110: - image: "python:2.7" - cache: - key: py27-django110 - paths: - - .tox/py27-django110 - script: - - tox -e py27-django110 - -py34-django17: - image: "python:3.4" - cache: - key: py34-django17 - paths: - - .tox/py34-django17 - script: - - tox -e py34-django17 - -py34-django18: - image: "python:3.4" - cache: - key: py34-django18 - paths: - - .tox/py34-django18 - script: - - tox -e py34-django18 - -py34-django19: - image: "python:3.4" - cache: - key: py34-django19 - paths: - - .tox/py34-django19 - script: - - tox -e py34-django19 - -py34-django110: - image: "python:3.4" - cache: - key: py34-django110 - paths: - - .tox/py34-django110 - script: - - tox -e py34-django110 - -py35-django18: +py35-django111: image: "python:3.5" cache: - key: py35-django18 + key: py35-django111 paths: - - .tox/py35-django18 + - .tox/py35-django111 script: - - tox -e py35-django18 + - tox -e py35-django111 -py35-django19: - image: "python:3.5" +py36-django111: + image: "python:3.6" cache: - key: py35-django19 + key: py36-django111 paths: - - .tox/py35-django19 + - .tox/py36-django111 script: - - tox -e py35-django19 + - tox -e py36-django111 -py35-django110: - image: "python:3.5" +py37-django22: + image: "python:3.7" cache: - key: py35-django110 + key: py37-django22 paths: - - .tox/py35-django110 + - .tox/py37-django22 script: - - tox -e py35-django110 + - tox -e py37-django22 + +py38-django22: + image: "python:3.8" + cache: + key: py38-django22 + paths: + - .tox/py38-django22 + script: + - tox -e py38-django22 + +py38-django30: + image: "python:3.8" + cache: + key: py38-django30 + paths: + - .tox/py38-django30 + script: + - tox -e py38-django30 + +py38-django31: + image: "python:3.8" + cache: + key: py38-django31 + paths: + - .tox/py38-django31 + script: + - tox -e py38-django31 + +py39-django22: + image: "python:3.9" + cache: + key: py39-django22 + paths: + - .tox/py39-django22 + script: + - tox -e py39-django22 + +py39-django30: + image: "python:3.9" + cache: + key: py39-django30 + paths: + - .tox/py39-django30 + script: + - tox -e py39-django30 + +py39-django31: + image: "python:3.9" + cache: + key: py39-django31 + paths: + - .tox/py39-django31 + script: + - tox -e py39-django31 coverage: - image: "python:2.7" + image: "python:3.9" cache: key: coverage paths: diff --git a/.travis.yml b/.travis.yml index ca142f3..cd7a9bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: python matrix: include: - - python: "3.8" + - python: "3.9" env: TOX_ENV=flake8 - - python: "3.8" + - python: "3.9" env: TOX_ENV=check_rst - python: "2.7" env: TOX_ENV=py27-django111 @@ -19,6 +19,8 @@ matrix: env: TOX_ENV=py38-django30 - python: "3.8" env: TOX_ENV=py38-django31 + - python: "3.9" + env: TOX_ENV=py39-django22 - python: "3.9" env: TOX_ENV=py39-django30 - python: "3.9" From 198308031bfc240f73cf3899ab011ac378ede4e6 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 19 Jun 2021 16:17:30 +0200 Subject: [PATCH 13/18] [urls] Import re_path with a more pythonic fallback --- cas_server/tests/urls.py | 9 ++++----- cas_server/urls.py | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cas_server/tests/urls.py b/cas_server/tests/urls.py index b95c228..ac8295f 100644 --- a/cas_server/tests/urls.py +++ b/cas_server/tests/urls.py @@ -16,12 +16,11 @@ Including another URLconf import django -if django.VERSION < (2,): - from django.conf.urls import url - re_path = url -else: +try: from django.urls import re_path - +except ImportError: + # re_path is not available in Django 2 + from django.conf.urls import url as re_pa from django.conf.urls import url, include from django.contrib import admin diff --git a/cas_server/urls.py b/cas_server/urls.py index 680c61e..301157c 100644 --- a/cas_server/urls.py +++ b/cas_server/urls.py @@ -13,12 +13,12 @@ import django -if django.VERSION < (2,): - from django.conf.urls import url - re_path = url -else: - from django.urls import re_path +try: + from django.urls import re_path +except ImportError: + # re_path is not available in Django 2 + from django.conf.urls import url as re_path from django.conf.urls import url from django.views.generic import RedirectView From aeb794fe7434d8217c0fda05318a4f3e3a5ee531 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 19 Jun 2021 17:21:20 +0200 Subject: [PATCH 14/18] [urls] Fix typo and remove unused imports --- cas_server/tests/urls.py | 6 ++---- cas_server/urls.py | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cas_server/tests/urls.py b/cas_server/tests/urls.py index ac8295f..72a5cb2 100644 --- a/cas_server/tests/urls.py +++ b/cas_server/tests/urls.py @@ -14,15 +14,13 @@ Including another URLconf 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ -import django - try: from django.urls import re_path except ImportError: # re_path is not available in Django 2 - from django.conf.urls import url as re_pa + from django.conf.urls import url as re_path -from django.conf.urls import url, include +from django.conf.urls import include from django.contrib import admin urlpatterns = [ diff --git a/cas_server/urls.py b/cas_server/urls.py index 301157c..63a6067 100644 --- a/cas_server/urls.py +++ b/cas_server/urls.py @@ -11,16 +11,12 @@ # (c) 2015-2016 Valentin Samir """urls for the app""" -import django - - try: from django.urls import re_path except ImportError: # re_path is not available in Django 2 from django.conf.urls import url as re_path -from django.conf.urls import url from django.views.generic import RedirectView from django.views.decorators.debug import sensitive_post_parameters, sensitive_variables From 968f4a591fd267d8e13d5f04d436366498e60012 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 19 Jun 2021 17:21:48 +0200 Subject: [PATCH 15/18] Rationalize testing and fix travis Test for couple (python version, django version) found in Debian, Ubuntu and RHEL and if not done, for every supported Django version with the last version of python Configure tox to use the locally available python3 then called without parameters --- .travis.yml | 80 ++++++++---------- Makefile | 18 ++-- tox.ini | 238 ++++++++++++++++++++++++++++------------------------ 3 files changed, 171 insertions(+), 165 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5ed0024..05962df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,71 +1,61 @@ language: python matrix: include: + # generic checks - python: "3.9" env: TOX_ENV=flake8 - python: "3.9" env: TOX_ENV=check_rst + - python: "3.9" + env: TOX_ENV=coverage + # Python 2 support. Not officialy supported but nice to known + # then it will break - python: "2.7" env: TOX_ENV=py27-django111 + - python: "2.7" + env: TOX_ENV=py27-django111 + arch: ppc64le + # Debian strech support - python: "3.5" env: TOX_ENV=py35-django111 + - python: "3.5" + env: TOX_ENV=py35-django111 + arch: ppc64le + # Ubuntu bionic and EPEL 7 support - python: "3.6" env: TOX_ENV=py36-django111 + - python: "3.6" + env: TOX_ENV=py36-django111 + arch: ppc64le + # RHEL 8 support + - python: "3.6" + env: TOX_ENV=py36-django22 + - python: "3.6" + env: TOX_ENV=py36-django22 + arch: ppc64le + # Debian buster support - python: "3.7" - env: TOX_ENV=py37-django22 + env: TOX_ENV=py37-django111 + - python: "3.7" + env: TOX_ENV=py37-django111 + arch: ppc64le + # Ubuntu focal and Ubuntu groovy support - python: "3.8" env: TOX_ENV=py38-django22 - python: "3.8" - env: TOX_ENV=py38-django30 - - python: "3.8" - env: TOX_ENV=py38-django31 + env: TOX_ENV=py38-django22 + arch: ppc64le + # Debian bullseye and Ubuntu hirsute support - python: "3.9" env: TOX_ENV=py39-django22 - python: "3.9" - env: TOX_ENV=py39-django30 + env: TOX_ENV=py39-django22 + arch: ppc64le + # Django additional supported version - python: "3.9" env: TOX_ENV=py39-django31 - python: "3.9" - env: TOX_ENV=coverage - - python: "3.8" - env: TOX_ENV=flake8 - arch: ppc64le - - python: "3.8" - env: TOX_ENV=check_rst - arch: ppc64le - - python: "2.7" - env: TOX_ENV=py27-django111 - arch: ppc64le - - python: "3.5" - env: TOX_ENV=py35-django111 - arch: ppc64le - - python: "3.6" - env: TOX_ENV=py36-django111 - arch: ppc64le - - python: "3.5" - env: TOX_ENV=py35-django20 - arch: ppc64le - - python: "3.6" - env: TOX_ENV=py36-django20 - arch: ppc64le - - python: "3.5" - env: TOX_ENV=py35-django21 - arch: ppc64le - - python: "3.6" - env: TOX_ENV=py36-django21 - arch: ppc64le - - python: "3.7" - env: TOX_ENV=py37-django22 - arch: ppc64le - - python: "3.8" - env: TOX_ENV=py38-django22 - arch: ppc64le - - python: "3.8" - env: TOX_ENV=py38-django30 - arch: ppc64le - - python: "3.8" - env: TOX_ENV=coverage - arch: ppc64le + env: TOX_ENV=py39-django32 cache: directories: diff --git a/Makefile b/Makefile index 62773c5..363f117 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ .PHONY: build dist docs -VERSION=`python setup.py -V` +VERSION=`python3 setup.py -V` build: - python setup.py build + python3 setup.py build install: dist - pip -V - pip install --no-cache-dir --no-deps --upgrade --force-reinstall --find-links ./dist/django-cas-server-${VERSION}.tar.gz django-cas-server + pip3 -V + pip3 install --no-cache-dir --no-deps --upgrade --force-reinstall --find-links ./dist/django-cas-server-${VERSION}.tar.gz django-cas-server uninstall: - pip uninstall django-cas-server || true + pip3 uninstall django-cas-server || true clean_pyc: find ./ -name '*.pyc' -delete @@ -34,11 +34,11 @@ clean: clean_pyc clean_build clean_coverage clean_tild_backup clean_all: clean clean_tox clean_test_venv clean_docs clean_eggs dist: - python setup.py sdist + python3 setup.py sdist test_venv/bin/python: python3 -m venv test_venv - test_venv/bin/pip install -U --requirement requirements-dev.txt 'Django>=2.0,<2.1' + test_venv/bin/pip install -U --requirement requirements-dev.txt 'Django>=3.2,<3.3' test_venv/cas/manage.py: test_venv mkdir -p test_venv/cas @@ -61,7 +61,7 @@ run_server: test_project test_venv/bin/python test_venv/cas/manage.py runserver run_tests: test_venv - python setup.py check --restructuredtext --stric + python3 setup.py check --restructuredtext --stric test_venv/bin/py.test -rw -x --cov=cas_server --cov-report html --cov-report term rm htmlcov/coverage_html.js # I am really pissed off by those keybord shortcuts @@ -72,4 +72,4 @@ docs: test_venv/bin/sphinx-build bash -c "source test_venv/bin/activate; cd docs; make html" publish_pypi_release: - python setup.py sdist bdist_wheel upload --sign + python3 setup.py sdist bdist_wheel upload --sign diff --git a/tox.ini b/tox.ini index a8a45d5..265b4ef 100644 --- a/tox.ini +++ b/tox.ini @@ -3,21 +3,14 @@ envlist= flake8, check_rst, py27-django111, - py35-django111, - py36-django111, - py37-django111, - py36-django22, - py37-django22, - py38-django22, - py39-django22, - py36-django30, - py37-django30, - py38-django30, - py39-django30, - py36-django31, - py37-django31, - py38-django31, - py39-django31, + py3-django111, + py3-django22, + py3-django31, + py3-django32, + +################## +# generic config # +################## [flake8] max-line-length=100 @@ -43,102 +36,9 @@ commands= {[post_cmd]commands} whitelist_externals={[post_cmd]whitelist_externals} -[testenv:py27-django111] -basepython=python2.7 -deps = - Django>=1.11,<1.12 - {[base]deps} - -[testenv:py35-django111] -basepython=python3.5 -deps = - Django>=1.11,<1.12 - {[base]deps} - -[testenv:py36-django111] -basepython=python3.6 -deps = - Django>=1.11,<1.12 - {[base]deps} - -[testenv:py37-django111] -basepython=python3.7 -deps = - Django>=1.11,<1.12 - {[base]deps} - -[testenv:py36-django22] -basepython=python3.6 -deps = - Django>=2.2,<3.0 - {[base]deps} - -[testenv:py37-django22] -basepython=python3.7 -deps = - Django>=2.2,<3.0 - {[base]deps} - -[testenv:py38-django22] -basepython=python3.8 -deps = - Django>=2.2,<3.0 - {[base]deps} - -[testenv:py39-django22] -basepython=python3.9 -deps = - Django>=2.2,<3.0 - {[base]deps} - -[testenv:py36-django30] -basepython=python3.6 -deps = - Django>=3.0,<3.1 - {[base]deps} - -[testenv:py37-django30] -basepython=python3.7 -deps = - Django>=3.0,<3.1 - {[base]deps} - -[testenv:py38-django30] -basepython=python3.8 -deps = - Django>=3.0,<3.1 - {[base]deps} - -[testenv:py39-django30] -basepython=python3.9 -deps = - Django>=3.0,<3.1 - {[base]deps} - -[testenv:py36-django31] -basepython=python3.6 -deps = - Django>=3.1,<3.2 - {[base]deps} - -[testenv:py37-django31] -basepython=python3.7 -deps = - Django>=3.1,<3.2 - {[base]deps} - -[testenv:py38-django31] -basepython=python3.8 -deps = - Django>=3.1,<3.2 - {[base]deps} - -[testenv:py39-django31] -basepython=python3.9 -deps = - Django>=3.1,<3.2 - {[base]deps} - +################### +# genercic checks # +################### [testenv:flake8] basepython=python3 @@ -177,3 +77,119 @@ commands= {toxinidir}/.update_coverage "{toxinidir}" "django-cas-server" {[post_cmd]commands} whitelist_externals={[post_cmd]whitelist_externals} + + +#################### +# Python 2 support # +#################### + +[testenv:py27-django111] +basepython=python2.7 +deps = + Django>=1.11,<1.12 + {[base]deps} + +################################## +# Generic Python 3 for local use # +################################## + +[testenv:py3-django111] +basepython=python3 +deps = + Django>=1.11,<1.12 + {[base]deps} + +[testenv:py3-django22] +basepython=python3 +deps = + Django>=2.2,<2.3 + {[base]deps} + +[testenv:py3-django31] +basepython=python3 +deps = + Django>=3.1,<3.2 + {[base]deps} + +[testenv:py3-django32] +basepython=python3 +deps = + Django>=3.2,<3.3 + {[base]deps} + +######################### +# Debian strech support # +######################### + +[testenv:py35-django111] +basepython=python3.5 +deps = + Django>=1.11,<1.12 + {[base]deps} + +#################################### +# Ubuntu bionic and EPEL 7 support # +#################################### + +[testenv:py36-django111] +basepython=python3.6 +deps = + Django>=1.11,<1.12 + {[base]deps} + +################## +# RHEL 8 support # +################## + +[testenv:py36-django22] +basepython=python3.6 +deps = + Django>=2.2,<3.0 + {[base]deps} + +######################### +# Debian buster support # +######################### + +[testenv:py37-django111] +basepython=python3.7 +deps = + Django>=1.11,<1.12 + {[base]deps} + +########################################## +# Ubuntu focal and Ubuntu groovy support # +########################################## + +[testenv:py38-django22] +basepython=python3.8 +deps = + Django>=2.2,<3.0 + {[base]deps} + +############################################## +# Debian bullseye and Ubuntu hirsute support # +############################################## + +[testenv:py39-django22] +basepython=python3.9 +deps = + Django>=2.2,<3.0 + {[base]deps} + +####################################### +# Django additional supported version # +####################################### + +[testenv:py39-django31] +basepython=python3.9 +deps = + Django>=3.1,<3.2 + {[base]deps} + + +[testenv:py39-django32] +basepython=python3.9 +deps = + Django>=3.2,<3.3 + {[base]deps} From 5b8fc55f78c770fe98c1228510db734b7972aa53 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 19 Jun 2021 17:50:38 +0200 Subject: [PATCH 16/18] Remove python2 tests from travis They are broken and python2 is not longer supported anyway --- .travis.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 05962df..4c39d04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,6 @@ matrix: env: TOX_ENV=check_rst - python: "3.9" env: TOX_ENV=coverage - # Python 2 support. Not officialy supported but nice to known - # then it will break - - python: "2.7" - env: TOX_ENV=py27-django111 - - python: "2.7" - env: TOX_ENV=py27-django111 - arch: ppc64le # Debian strech support - python: "3.5" env: TOX_ENV=py35-django111 @@ -62,8 +55,9 @@ cache: - $HOME/.cache/pip/http/ - $HOME/build/nitmir/django-cas-server/.tox/$TOX_ENV/ install: - - "travis_retry pip install setuptools --upgrade" - - "pip install tox" + - travis_retry pip install setuptools --upgrade + - pip install tox $PKGS + - pip freeze script: - tox -e $TOX_ENV after_script: From fa7789d226eacae40e09bd784a127243cee29657 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 19 Jun 2021 18:10:33 +0200 Subject: [PATCH 17/18] Add support for Django 3.2 --- README.rst | 6 +++--- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 7bcba7e..887ee3c 100644 --- a/README.rst +++ b/README.rst @@ -21,15 +21,15 @@ Features * Possibility to rename/rewrite attributes per service * Possibility to require some attribute values per service * Federated mode between multiple CAS -* Supports Django 1.11, 2.2 and 3.1 -* Supports Python 2.7, 3.5+ +* Supports Django 1.11, 2.2, 3.1 and 3.2 +* Supports Python 3.5+ Dependencies ============ ``django-cas-server`` depends on the following python packages: -* Django >= 1.11 < 3.2 +* Django >= 1.11 < 3.3 * requests >= 2.4 * requests_futures >= 0.9.5 * lxml >= 3.4 diff --git a/requirements.txt b/requirements.txt index 22b409b..ced9200 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django >= 1.11,<3.1 +Django >= 1.11,<3.3 setuptools>=5.5 requests>=2.4 requests_futures>=0.9.5 From 8ca36f6b7a84386ac590359d42efe44c0c9222d3 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 19 Jun 2021 18:11:21 +0200 Subject: [PATCH 18/18] Update to version 1.3.0 --- CHANGELOG.rst | 28 ++++++++++++++++++++++++++++ README.rst | 4 ++-- cas_server/__init__.py | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d493dd9..315506f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,34 @@ All notable changes to this project will be documented in this file. .. contents:: Table of Contents :depth: 2 +v1.3.0 - 2021-06-19 +=================== + +Added +----- + +* Support for Dango 3.1 and 3.2 +* Implement CAS_LDAP_ATTRS_VIEW set to 0: then using ldap bind mode, user + attributes can be retreive either using CAS_LDAP_USER or using the + binded user credentials. +* Added ppc64le architecture support on travis-ci (django-cas-server is + included in the ppc64le versions of RHEL and Ubuntu) +* Python 3.9 support + +Fixes +----- + +* Allow to use user attributes if auth by ldap bind +* Fix spelling mistakes in french translation +* Fix bug model datefield Form (Federated User Admin) +* django.conf.urls is deprecated and will be removed in Django 4.0. + Use django.urls.re_path instead + +Removed +------- + +* Drop support for Django 3.0 as it reached end of life. + v1.2.0 - 2020-07-05 =================== diff --git a/README.rst b/README.rst index 887ee3c..50bc8c7 100644 --- a/README.rst +++ b/README.rst @@ -644,8 +644,8 @@ You could for example do as below:: -.. |travis| image:: https://badges.genua.fr/travis/nitmir/django-cas-server/master.svg - :target: https://travis-ci.org/nitmir/django-cas-server +.. |travis| image:: https://badges.genua.fr/travis/com/nitmir/django-cas-server/master.svg + :target: https://travis-ci.com/nitmir/django-cas-server .. |pypi_version| image:: https://badges.genua.fr/pypi/v/django-cas-server.svg :target: https://pypi.org/project/django-cas-server/ diff --git a/cas_server/__init__.py b/cas_server/__init__.py index 66d4a2c..b8ffce2 100644 --- a/cas_server/__init__.py +++ b/cas_server/__init__.py @@ -11,7 +11,7 @@ """A django CAS server application""" #: version of the application -VERSION = '1.2.0' +VERSION = '1.3.0' #: path the the application configuration class default_app_config = 'cas_server.apps.CasAppConfig'