Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-axes for openSUSE:Factory checked in at 2024-01-15 22:17:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-axes (Old) and /work/SRC/openSUSE:Factory/.python-django-axes.new.21961 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-axes" Mon Jan 15 22:17:41 2024 rev:7 rq:1138693 version:6.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-axes/python-django-axes.changes 2023-12-28 23:02:51.361496270 +0100 +++ /work/SRC/openSUSE:Factory/.python-django-axes.new.21961/python-django-axes.changes 2024-01-15 22:19:08.834663709 +0100 @@ -1,0 +2,6 @@ +Sun Jan 14 17:32:47 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 6.3.0: + * Add async support to middleware. [Taikono-Himazin] + +------------------------------------------------------------------- Old: ---- django-axes-6.2.0.tar.gz New: ---- django-axes-6.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-axes.spec ++++++ --- /var/tmp/diff_new_pack.7aPmQe/_old 2024-01-15 22:19:09.378683703 +0100 +++ /var/tmp/diff_new_pack.7aPmQe/_new 2024-01-15 22:19:09.378683703 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-django-axes # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-django-axes -Version: 6.2.0 +Version: 6.3.0 Release: 0 License: MIT Summary: Keep track of failed login attempts in Django-powered sites ++++++ django-axes-6.2.0.tar.gz -> django-axes-6.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/.github/workflows/codeql.yml new/django-axes-6.3.0/.github/workflows/codeql.yml --- old/django-axes-6.2.0/.github/workflows/codeql.yml 2023-12-08 18:59:34.000000000 +0100 +++ new/django-axes-6.3.0/.github/workflows/codeql.yml 2023-12-27 11:45:51.000000000 +0100 @@ -18,7 +18,7 @@ # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java @@ -26,7 +26,7 @@ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # â¹ï¸ Command-line programs to run using the OS shell. # ð See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -40,4 +40,4 @@ # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/CHANGES.rst new/django-axes-6.3.0/CHANGES.rst --- old/django-axes-6.2.0/CHANGES.rst 2023-12-08 18:59:34.000000000 +0100 +++ new/django-axes-6.3.0/CHANGES.rst 2023-12-27 11:45:51.000000000 +0100 @@ -3,6 +3,13 @@ ======= +6.3.0 (2023-12-27) +------------------ + +- Add async support to middleware. + [Taikono-Himazin] + + 6.2.0 (2023-12-08) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/PKG-INFO new/django-axes-6.3.0/PKG-INFO --- old/django-axes-6.2.0/PKG-INFO 2023-12-08 18:59:48.553557400 +0100 +++ new/django-axes-6.3.0/PKG-INFO 2023-12-27 11:46:02.171593200 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-axes -Version: 6.2.0 +Version: 6.3.0 Summary: Keep track of failed login attempts in Django-powered sites. Home-page: https://github.com/jazzband/django-axes Author: Josh VanderLinden, Philip Neustrom, Michael Blume, Alex Clark, Camilo Nova, Aleksi Hakli @@ -130,6 +130,13 @@ ======= +6.3.0 (2023-12-27) +------------------ + +- Add async support to middleware. + [Taikono-Himazin] + + 6.2.0 (2023-12-08) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/axes/middleware.py new/django-axes-6.3.0/axes/middleware.py --- old/django-axes-6.2.0/axes/middleware.py 2023-12-08 18:59:34.000000000 +0100 +++ new/django-axes-6.3.0/axes/middleware.py 2023-12-27 11:45:51.000000000 +0100 @@ -1,5 +1,6 @@ from typing import Callable +from asgiref.sync import iscoroutinefunction, markcoroutinefunction, sync_to_async from django.conf import settings from django.http import HttpRequest, HttpResponse @@ -30,15 +31,37 @@ - ``AXES_PERMALOCK_MESSAGE``. """ + async_capable = True + sync_capable = True + def __init__(self, get_response: Callable) -> None: self.get_response = get_response + if iscoroutinefunction(self.get_response): + markcoroutinefunction(self) def __call__(self, request: HttpRequest) -> HttpResponse: - response = self.get_response(request) + # Exit out to async mode, if needed + if iscoroutinefunction(self): + return self.__acall__(request) + response = self.get_response(request) if settings.AXES_ENABLED: if getattr(request, "axes_locked_out", None): credentials = getattr(request, "axes_credentials", None) response = get_lockout_response(request, credentials) # type: ignore return response + + async def __acall__(self, request: HttpRequest) -> HttpResponse: + response = await self.get_response(request) + + if settings.AXES_ENABLED: + if getattr(request, "axes_locked_out", None): + credentials = getattr(request, "axes_credentials", None) + response = await sync_to_async( + get_lockout_response, thread_sensitive=True + )( + request, credentials + ) # type: ignore + + return response diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/django_axes.egg-info/PKG-INFO new/django-axes-6.3.0/django_axes.egg-info/PKG-INFO --- old/django-axes-6.2.0/django_axes.egg-info/PKG-INFO 2023-12-08 18:59:48.000000000 +0100 +++ new/django-axes-6.3.0/django_axes.egg-info/PKG-INFO 2023-12-27 11:46:02.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-axes -Version: 6.2.0 +Version: 6.3.0 Summary: Keep track of failed login attempts in Django-powered sites. Home-page: https://github.com/jazzband/django-axes Author: Josh VanderLinden, Philip Neustrom, Michael Blume, Alex Clark, Camilo Nova, Aleksi Hakli @@ -130,6 +130,13 @@ ======= +6.3.0 (2023-12-27) +------------------ + +- Add async support to middleware. + [Taikono-Himazin] + + 6.2.0 (2023-12-08) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/requirements-qa.txt new/django-axes-6.3.0/requirements-qa.txt --- old/django-axes-6.2.0/requirements-qa.txt 2023-12-08 18:59:34.000000000 +0100 +++ new/django-axes-6.3.0/requirements-qa.txt 2023-12-27 11:45:51.000000000 +0100 @@ -1,4 +1,4 @@ -black==23.11.0 -mypy==1.7.1 +black==23.12.1 +mypy==1.8.0 prospector==1.10.3 types-pkg_resources # Type stub diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-axes-6.2.0/requirements-test.txt new/django-axes-6.3.0/requirements-test.txt --- old/django-axes-6.2.0/requirements-test.txt 2023-12-08 18:59:34.000000000 +0100 +++ new/django-axes-6.3.0/requirements-test.txt 2023-12-27 11:45:51.000000000 +0100 @@ -1,6 +1,6 @@ -e . django-ipware>=3 -coverage==7.3.2 +coverage==7.3.4 pytest==7.4.3 pytest-cov==4.1.0 pytest-django==4.7.0