소스 검색

Hue [py3] Adding django-axes-5.13.0 module in ext-py3

(cherry picked from commit fb9e0e3db9b253c1bbbc2e61cc649d929bbcad90)
Prakash Ranade 3 년 전
부모
커밋
30b35e19c5
91개의 변경된 파일9909개의 추가작업 그리고 0개의 파일을 삭제
  1. 40 0
      desktop/core/ext-py3/django-axes-5.13.0/.github/workflows/release.yml
  2. 65 0
      desktop/core/ext-py3/django-axes-5.13.0/.github/workflows/test.yml
  3. 18 0
      desktop/core/ext-py3/django-axes-5.13.0/.gitignore
  4. 7 0
      desktop/core/ext-py3/django-axes-5.13.0/.prospector.yaml
  5. 1192 0
      desktop/core/ext-py3/django-axes-5.13.0/CHANGES.rst
  6. 23 0
      desktop/core/ext-py3/django-axes-5.13.0/LICENSE
  7. 1330 0
      desktop/core/ext-py3/django-axes-5.13.0/PKG-INFO
  8. 98 0
      desktop/core/ext-py3/django-axes-5.13.0/README.rst
  9. 5 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/__init__.py
  10. 83 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/admin.py
  11. 48 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/apps.py
  12. 99 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/attempts.py
  13. 62 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/backends.py
  14. 144 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/checks.py
  15. 120 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/conf.py
  16. 26 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/decorators.py
  17. 13 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/exceptions.py
  18. 0 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/__init__.py
  19. 193 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/base.py
  20. 172 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/cache.py
  21. 272 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/database.py
  22. 22 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/dummy.py
  23. 124 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/proxy.py
  24. 25 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/test.py
  25. 478 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/helpers.py
  26. BIN
      desktop/core/ext-py3/django-axes-5.13.0/axes/locale/de/LC_MESSAGES/django.mo
  27. 97 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/locale/de/LC_MESSAGES/django.po
  28. BIN
      desktop/core/ext-py3/django-axes-5.13.0/axes/locale/ru/LC_MESSAGES/django.mo
  29. 97 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/locale/ru/LC_MESSAGES/django.po
  30. BIN
      desktop/core/ext-py3/django-axes-5.13.0/axes/locale/tr/LC_MESSAGES/django.mo
  31. 96 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/locale/tr/LC_MESSAGES/django.po
  32. 0 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/__init__.py
  33. 0 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/__init__.py
  34. 13 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_list_attempts.py
  35. 15 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset.py
  36. 21 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_ip.py
  37. 22 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_logs.py
  38. 21 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_user.py
  39. 21 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_username.py
  40. 42 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/middleware.py
  41. 72 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0001_initial.py
  42. 53 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0002_auto_20151217_2044.py
  43. 58 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0003_auto_20160322_0929.py
  44. 68 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0004_auto_20181024_1538.py
  45. 8 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0005_remove_accessattempt_trusted.py
  46. 10 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0006_remove_accesslog_trusted.py
  47. 0 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/__init__.py
  48. 47 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/models.py
  49. 61 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/signals.py
  50. 57 0
      desktop/core/ext-py3/django-axes-5.13.0/axes/utils.py
  51. 9 0
      desktop/core/ext-py3/django-axes-5.13.0/codecov.yml
  52. 3 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/10_changelog.rst
  53. 15 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/1_requirements.rst
  54. 138 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/2_installation.rst
  55. 109 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/3_usage.rst
  56. 246 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/4_configuration.rst
  57. 156 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/5_customization.rst
  58. 275 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/6_integration.rst
  59. 77 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/7_architecture.rst
  60. 18 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/8_reference.rst
  61. 46 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/9_development.rst
  62. 192 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/Makefile
  63. 122 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/conf.py
  64. BIN
      desktop/core/ext-py3/django-axes-5.13.0/docs/images/flow.png
  65. 28 0
      desktop/core/ext-py3/django-axes-5.13.0/docs/index.rst
  66. 11 0
      desktop/core/ext-py3/django-axes-5.13.0/manage.py
  67. 6 0
      desktop/core/ext-py3/django-axes-5.13.0/mypy.ini
  68. 58 0
      desktop/core/ext-py3/django-axes-5.13.0/pyproject.toml
  69. 3 0
      desktop/core/ext-py3/django-axes-5.13.0/requirements-qa.txt
  70. 6 0
      desktop/core/ext-py3/django-axes-5.13.0/requirements-test.txt
  71. 5 0
      desktop/core/ext-py3/django-axes-5.13.0/requirements.txt
  72. 4 0
      desktop/core/ext-py3/django-axes-5.13.0/setup.cfg
  73. 67 0
      desktop/core/ext-py3/django-axes-5.13.0/setup.py
  74. 0 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/__init__.py
  75. 191 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/base.py
  76. 76 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/settings.py
  77. 28 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_admin.py
  78. 155 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_attempts.py
  79. 23 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_backends.py
  80. 110 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_checks.py
  81. 40 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_decorators.py
  82. 499 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_handlers.py
  83. 683 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_helpers.py
  84. 121 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_logging.py
  85. 644 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_login.py
  86. 109 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_management.py
  87. 38 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_middleware.py
  88. 36 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_models.py
  89. 18 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/test_signals.py
  90. 5 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/urls.py
  91. 1 0
      desktop/core/ext-py3/django-axes-5.13.0/tests/urls_empty.py

+ 40 - 0
desktop/core/ext-py3/django-axes-5.13.0/.github/workflows/release.yml

@@ -0,0 +1,40 @@
+name: Release
+
+on:
+  push:
+    tags:
+    - '*'
+
+jobs:
+  build:
+    if: github.repository == 'jazzband/django-axes'
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+
+      - name: Install dependencies
+        run: |
+          python -m pip install -U pip
+          python -m pip install -U setuptools twine wheel
+
+      - name: Build package
+        run: |
+          python setup.py --version
+          python setup.py sdist --format=gztar bdist_wheel
+          twine check dist/*
+
+      - name: Upload packages to Jazzband
+        if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
+        uses: pypa/gh-action-pypi-publish@master
+        with:
+          user: jazzband
+          password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
+          repository_url: https://jazzband.co/projects/django-axes/upload

+ 65 - 0
desktop/core/ext-py3/django-axes-5.13.0/.github/workflows/test.yml

@@ -0,0 +1,65 @@
+name: Test
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy3']
+        django-version: ['2.2', '3.0', '3.1']
+        # Tox configuration for QA environment
+        include:
+          - python-version: '3.8'
+            django-version: 'qa'
+          # Django >= 3.2 only supports >= Python 3.8
+          - python-version: '3.8'
+            django-version: 'dev'
+            experimental: true
+          - python-version: '3.9'
+            django-version: 'dev'
+            experimental: true
+          - python-version: 'pypy3'
+            django-version: 'dev'
+            experimental: true
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+
+    - name: Get pip cache dir
+      id: pip-cache
+      run: |
+        echo "::set-output name=dir::$(pip cache dir)"
+
+    - name: Cache
+      uses: actions/cache@v2
+      with:
+        path: ${{ steps.pip-cache.outputs.dir }}
+        key:
+          ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
+        restore-keys: |
+          ${{ matrix.python-version }}-v1-
+
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        python -m pip install --upgrade tox tox-gh-actions
+
+    - name: Tox tests
+      run: |
+        tox -v
+      env:
+        DJANGO: ${{ matrix.django-version }}
+
+    - name: Upload coverage
+      uses: codecov/codecov-action@v1
+      with:
+        name: Python ${{ matrix.python-version }}

+ 18 - 0
desktop/core/ext-py3/django-axes-5.13.0/.gitignore

@@ -0,0 +1,18 @@
+*.egg-info
+*.pyc
+*.swp
+.coverage
+coverage.xml
+.DS_Store
+.idea
+.mypy_cache/
+.project
+.pydevproject
+.python-version
+.tox
+build/
+dist/
+docs/_build
+test.db
+.eggs
+pip-wheel-metadata

+ 7 - 0
desktop/core/ext-py3/django-axes-5.13.0/.prospector.yaml

@@ -0,0 +1,7 @@
+ignore-paths:
+  - docs
+  - axes/migrations
+
+pep8:
+  options:
+    max-line-length: 142

+ 1192 - 0
desktop/core/ext-py3/django-axes-5.13.0/CHANGES.rst

@@ -0,0 +1,1192 @@
+
+Changes
+=======
+
+
+5.13.0 (2021-02-15)
+-------------------
+
+- Add support for resetting attempts with cache backend.
+  [nattyg93]
+
+
+5.12.0 (2021-01-07)
+-------------------
+
+- Clean up test structure and migrate tests outside
+  the main package for a smaller wheel distributions.
+  [aleksihakli]
+- Move configuration to pyproject.toml for cleaner layout.
+  [aleksihakli]
+- Clean up test settings override configuration.
+  [hramezani]
+
+
+5.11.1 (2021-01-06)
+-------------------
+
+- Fix cache entry creations for None username.
+  [cabarnes]
+
+
+5.11.0 (2021-01-05)
+-------------------
+
+- Add lockout view CORS support with ``AXES_ALLOWED_CORS_ORIGINS`` configuration flag.
+  [vladox]
+- Add missing ``@wraps`` decorator to ``axes.decorators.axes_dispatch``.
+  [aleksihakli]
+
+
+5.10.1 (2021-01-04)
+-------------------
+
+- Add ``DEFAULT_AUTO_FIELD`` to test settings.
+  [hramezani]
+- Fix documentation language.
+  [danielquinn] 
+- Fix Python package version specifiers and remove redundant imports.
+  [aleksihakli]
+
+
+5.10.0 (2020-12-18)
+-------------------
+
+- Deprecate stock DRF support from 5.8.0,
+  require users to set it up per project.
+  Check the documentation for more information.
+  [aleksihakli]
+
+
+5.9.1 (2020-12-02)
+------------------
+
+- Move tests to GitHub Actions
+  [jezdez]
+- Fix running Axes code in middleware when ``AXES_ENABLED`` is ``False``.
+  [ashokdelphia]
+
+
+5.9.0 (2020-11-05)
+------------------
+
+- Add Python 3.9 support.
+  [hramezani]
+- Prevent ``AccessAttempt`` creation with database handler when
+  username is not set and ``AXES_ONLY_USER_FAILURES`` setting is not set.
+  [hramezani]
+
+
+5.8.0 (2020-10-16)
+------------------
+
+- Improve Django REST Framework (DRF) integration.
+  [Anatoly]
+
+
+5.7.1 (2020-09-27)
+------------------
+
+- Adjust settings import and handling chain
+  for cleaner module import and invocation order.
+  [aleksihakli]
+- Adjust the use of ``AXES_ENABLED`` flag so that
+  imports are always done the same way and initial log
+  is written regardless of the setting and it only affects
+  code that is decorated or wrapped with ``toggleable``.
+  [alekshakli]
+
+
+5.7.0 (2020-09-26)
+------------------
+
+- Deprecate ``AXES_LOGGER`` Axes setting and move to ``__name__``
+  based logging and fully qualified Python module name log identifiers.
+  [aleksihakli]
+
+
+5.6.2 (2020-09-20)
+------------------
+
+- Fix regression in ``axes_reset_user`` management command.
+  [aleksihakli]
+
+
+5.6.1 (2020-09-17)
+------------------
+
+- Improve test dependency management and upgrade black code formatter.
+  [smithdc1]
+
+
+5.6.0 (2020-09-12)
+------------------
+
+- Add proper development ``subTest`` support via ``pytest-subtests`` package.
+  [smithdc1]
+- Deprecate ``django-appconf`` and use plain settings for Axes.
+  [aleksihakli]
+
+
+5.5.2 (2020-09-11)
+------------------
+
+- Update deprecating use of the ``request.is_ajax`` method.
+  [smithdc1]
+
+
+5.5.1 (2020-09-10)
+------------------
+
+- Update deprecated uses of Django modules and members.
+  [smithdc1]
+
+
+5.5.0 (2020-08-21)
+------------------
+
+- Add support for locking requests based on
+  username OR IP address with inclusive or
+  using the ``LOCK_OUT_BY_USER_OR_IP`` flag.
+  [PetrDlouhy]
+- Deprecate Signal ``providing_args`` for Django 3.1 support.
+  [coredumperror]
+
+
+5.4.3 (2020-08-06)
+------------------
+
+- Add Django 3.1 support.
+  [hramezani]
+
+
+5.4.2 (2020-07-28)
+------------------
+
+- Add ABC or abstract base class implementation for handlers.
+  [jorlugaqui]
+
+
+5.4.1 (2020-07-03)
+------------------
+
+- Fix code styling for linters.
+  [aleksihakli]
+
+
+5.4.0 (2020-07-03)
+------------------
+
+- Propagate username to lockout view in URL parameters.
+  [PetrDlouhy]
+- Update CAPTCHA examples.
+  [PetrDlouhy]
+- Upgrade django-ipware to version 3.
+  [hramezani,mnislam01]
+
+
+5.3.5 (2020-07-02)
+------------------
+
+- Restrict ipware version for version compatibility.
+  [aleksihakli]
+
+
+5.3.4 (2020-06-09)
+------------------
+
+- Deprecate Django 1.11 LTS support.
+  [aleksihakli]
+
+
+5.3.3 (2020-05-22)
+------------------
+
+- Fix ``AXES_ONLY_ADMIN_SITE`` functionality when
+  no default admin site is defined in the URL configuration.
+  [igor-shevchenko]
+
+
+5.3.2 (2020-05-15)
+------------------
+
+- Fix AppConf settings prefix for Fargate.
+  [marksweb]
+
+
+5.3.1 (2020-03-23)
+------------------
+
+- Fix null byte ValueError bug in ORM.
+  [ddimmich]
+
+
+5.3.0 (2020-03-10)
+------------------
+
+- Improve Django REST Framework compatibility.
+  [I0x4dI]
+
+
+5.2.2 (2020-01-08)
+------------------
+
+- Add missing proxy implementation for
+  ``axes.handlers.proxy.AxesProxyHandler.get_failures``.
+  [aleksihakli]
+
+
+5.2.1 (2020-01-08)
+------------------
+
+- Add django-reversion compatibility notes.
+  [mark-mishyn]
+- Add pluggable lockout responses and the
+  ``AXES_LOCKOUT_CALLABLE`` configuration flag.
+  [aleksihakli]
+
+
+5.2.0 (2020-01-01)
+------------------
+
+- Add a test handler.
+  [aidanlister]
+
+
+5.1.0 (2019-12-29)
+------------------
+
+- Add pluggable user account whitelisting and the
+  ``AXES_WHITELIST_CALLABLE`` configuration flag.
+  [aleksihakli]
+
+
+5.0.20 (2019-12-01)
+-------------------
+
+- Fix django-allauth compatibility issue.
+  [hramezani]
+- Improve tests for login attempt monitoring.
+  [hramezani]
+- Add reverse proxy documentation.
+  [ckcollab]
+- Update OAuth documentation examples.
+  [aleksihakli]
+
+
+5.0.19 (2019-11-06)
+-------------------
+
+- Optimize access attempt fetching in database handler.
+  [hramezani]
+- Optimize request data fetching in proxy handler.
+  [hramezani]
+
+
+5.0.18 (2019-10-17)
+-------------------
+
+- Add ``cooloff_timedelta`` context variable to lockout responses.
+  [jstockwin]
+
+
+5.0.17 (2019-10-15)
+-------------------
+
+- Safer string formatting for user input.
+  [aleksihakli]
+
+
+5.0.16 (2019-10-15)
+-------------------
+
+- Fix string formatting bug in logging.
+  [zerolab]
+
+
+5.0.15 (2019-10-09)
+-------------------
+
+- Add ``AXES_ENABLE_ADMIN`` flag.
+  [flannelhead]
+
+
+5.0.14 (2019-09-28)
+-------------------
+
+- Docs, CI pipeline, and code formatting improvements
+  [aleksihakli]
+
+
+5.0.13 (2019-08-30)
+-------------------
+
+- Python 3.8 and PyPy support.
+  [aleksihakli]
+- Migrate to ``setuptools_scm`` and automatic versioning.
+  [aleksihakli]
+
+
+5.0.12 (2019-08-05)
+-------------------
+
+- Support callables for ``AXES_COOLOFF_TIME`` setting.
+  [DariaPlotnikova]
+
+
+5.0.11 (2019-07-25)
+-------------------
+
+- Fix typo in rST formatting that prevented 5.0.10 release to PyPI.
+  [aleksihakli]
+
+
+5.0.10 (2019-07-25)
+-------------------
+
+- Refactor type checks for ``axes.helpers.get_client_cache_key``
+  for framework compatibility, fixes #471.
+  [aleksihakli]
+
+
+5.0.9 (2019-07-11)
+------------------
+
+- Add better handling for attempt and log resets by moving them
+  into handlers which allows customization and more configurability.
+  Unimplemented handlers raise ``NotImplementedError`` by default.
+  [aleksihakli]
+- Add Python 3.8 dev version and PyPy to the Travis test matrix.
+  [aleksihakli]
+
+
+5.0.8 (2019-07-09)
+------------------
+
+- Add ``AXES_ONLY_ADMIN_SITE`` flag for only running Axes on admin site.
+  [hramezani]
+- Add ``axes_reset_logs`` command for removing old AccessLog records.
+  [tlebrize]
+- Allow ``AxesBackend`` subclasses to pass the ``axes.W003`` system check.
+  [adamchainz]
+
+
+5.0.7 (2019-06-14)
+------------------
+
+- Fix lockout message showing when lockout is disabled
+  with the ``AXES_LOCK_OUT_AT_FAILURE`` setting.
+  [mogzol]
+
+- Add support for callable ``AXES_FAILURE_LIMIT`` setting.
+  [bbayles]
+
+
+5.0.6 (2019-05-25)
+------------------
+
+- Deprecate ``AXES_DISABLE_SUCCESS_ACCESS_LOG`` flag in favour of
+  ``AXES_DISABLE_ACCESS_LOG`` which has mostly the same functionality.
+  Update documentation to better reflect the behaviour of the flag.
+  [aleksihakli]
+
+
+5.0.5 (2019-05-19)
+------------------
+
+- Change the lockout response calculation to request flagging
+  instead of exception throwing in the signal handler and middleware.
+  Move request attribute calculation from middleware to handler layer.
+  Deprecate ``axes.request.AxesHttpRequest`` object type definition.
+  [aleksihakli]
+
+- Deprecate the old version 4.x ``axes.backends.AxesModelBackend`` class.
+  [aleksihakli]
+
+- Improve documentation on attempt tracking, resets, Axes customization,
+  project and component compatibility and integrations, and other things.
+  [aleksihakli]
+
+
+5.0.4 (2019-05-09)
+------------------
+
+- Fix regression with OAuth2 authentication backends not having remote
+  IP addresses set and throwing an exception in cache key calculation.
+  [aleksihakli]
+
+
+5.0.3 (2019-05-08)
+------------------
+
+- Fix ``django.contrib.auth`` module ``login`` and ``logout`` functionality
+  so that they work with the handlers without the an ``AxesHttpRequest``
+  to improve cross compatibility with other Django applications.
+  [aleksihakli]
+
+- Change IP address resolution to allow empty or missing addresses.
+  [aleksihakli]
+
+- Add error logging for missing request attributes in the handler layer
+  so that users get better indicators of misconfigured applications.
+  [aleksihakli]
+
+
+5.0.2 (2019-05-07)
+------------------
+
+- Add ``AXES_ENABLED`` setting for disabling Axes with e.g. tests
+  that use Django test client ``login``, ``logout``, and ``force_login``
+  methods, which do not supply the ``request`` argument to views,
+  preventing Axes from functioning correctly in certain test setups.
+  [aleksihakli]
+
+
+5.0.1 (2019-05-03)
+------------------
+
+- Add changelog to documentation.
+  [aleksihakli]
+
+
+5.0 (2019-05-01)
+----------------
+
+- Deprecate Python 2.7, 3.4 and 3.5 support.
+  [aleksihakli]
+
+- Remove automatic decoration and monkey-patching of Django views and forms.
+  Decorators are available for login function and method decoration as before.
+  [aleksihakli]
+
+- Use backend, middleware, and signal handlers for tracking
+  login attempts and implementing user lockouts.
+  [aleksihakli, jorlugaqui, joshua-s]
+
+- Add ``AxesDatabaseHandler``, ``AxesCacheHandler``, and ``AxesDummyHandler``
+  handler backends for processing user login and logout events and failures.
+  Handlers are configurable with the ``AXES_HANDLER`` setting.
+  [aleksihakli, jorlugaqui, joshua-s]
+
+- Improve management commands and separate commands for resetting
+  all access attempts, attempts by IP, and attempts by username.
+  New command names are ``axes_reset``, ``axes_reset_ip`` and ``axes_reset_username``.
+  [aleksihakli]
+
+- Add support for string import for ``AXES_USERNAME_CALLABLE``
+  that supports dotted paths in addition to the old
+  callable type such as a function or a class method.
+  [aleksihakli]
+
+- Deprecate one argument call signature for ``AXES_USERNAME_CALLABLE``.
+  From now on, the callable needs to accept two arguments,
+  the HttpRequest and credentials that are supplied to the
+  Django ``authenticate`` method in authentication backends.
+  [aleksihakli]
+
+- Move ``axes.attempts.is_already_locked`` function to ``axes.handlers.AxesProxyHandler.is_locked``.
+  Various other previously undocumented methods have been deprecated and moved inside the project.
+  The new documented public APIs can be considered as stable and can be safely utilized by other projects.
+  [aleksihakli]
+
+- Improve documentation layouting and contents. Add public API reference section.
+  [aleksihakli]
+
+
+4.5.4 (2019-01-15)
+------------------
+
+- Improve README and documentation
+  [aleksihakli]
+
+
+4.5.3 (2019-01-14)
+------------------
+
+- Remove the unused ``AccessAttempt.trusted`` flag from models
+  [aleksihakli]
+
+- Improve README and Travis CI setups
+  [aleksihakli]
+
+
+4.5.2 (2019-01-12)
+------------------
+
+- Added Turkish translations
+  [obayhan]
+
+
+4.5.1 (2019-01-11)
+------------------
+
+- Removed duplicated check that was causing issues when using APIs.
+  [camilonova]
+
+- Added Russian translations
+  [lubicz-sielski]
+
+
+4.5.0 (2018-12-25)
+------------------
+
+- Improve support for custom authentication credentials using the
+  ``AXES_USERNAME_FORM_FIELD`` and ``AXES_USERNAME_CALLABLE`` settings.
+  [mastacheata]
+
+- Updated behaviour for fetching username from request or credentials:
+  If no ``AXES_USERNAME_CALLABLE`` is configured, the optional
+  ``credentials`` that are supplied to the axes utility methods
+  are now the default source for client username and the HTTP
+  request POST is the fallback for fetching the user information.
+  ``AXES_USERNAME_CALLABLE`` implements an alternative signature with two
+  arguments ``request, credentials`` in addition to the old ``request``
+  call argument signature in a backwards compatible fashion.
+  [aleksihakli]
+
+- Add official support for the Django 2.1 version and Python 3.7.
+  [aleksihakli]
+
+- Improve the requirements, documentation, tests, and CI setup.
+  [aleksihakli]
+
+
+4.4.3 (2018-12-08)
+------------------
+
+- Fix MANIFEST.in missing German translations
+  [aleksihakli]
+
+- Add `AXES_RESET_ON_SUCCESS` configuration flag
+  [arjenzijlstra]
+
+
+4.4.2 (2018-10-30)
+------------------
+
+- fix missing migration and add check to prevent it happening again.
+  [markddavidoff]
+
+
+4.4.1 (2018-10-24)
+------------------
+
+- Add a German translation
+  [adonig]
+
+- Documentation wording changes
+  [markddavidoff]
+
+- Use `get_client_username` in `log_user_login_failed` instead of credentials
+  [markddavidoff]
+
+- pin prospector to 0.12.11, and pin astroid to 1.6.5
+  [hsiaoyi0504]
+
+
+4.4.0 (2018-05-26)
+------------------
+
+- Added AXES_USERNAME_CALLABLE
+  [jaadus]
+
+
+4.3.1 (2018-04-21)
+------------------
+
+- Change custom authentication backend failures from error to warning log level
+  [aleksihakli]
+
+- Set up strict code linting for CI pipeline that fails builds if linting does not pass
+  [aleksihakli]
+
+- Clean up old code base and tests based on linter errors
+  [aleksihakli]
+
+
+4.3.0 (2018-04-21)
+------------------
+
+- Refactor and clean up code layout
+  [aleksihakli]
+
+- Add prospector linting and code checks to toolchain
+  [aleksihakli]
+
+- Clean up log message formatting and refactor type checks
+  [EvaSDK]
+
+- Fix faulty user locking with user agent when AXES_ONLY_USER_FAILURES is set
+  [EvaSDK]
+
+
+4.2.1 (2018-04-18)
+------------------
+
+- Fix unicode string interpolation on Python 2.7
+  [aleksihakli]
+
+
+4.2.0 (2018-04-13)
+------------------
+
+- Add configuration flags for client IP resolving
+  [aleksihakli]
+
+- Add AxesModelBackend authentication backend
+  [markdaviddoff]
+
+
+4.1.0 (2018-02-18)
+------------------
+
+- Add AXES_CACHE setting for configuring `axes` specific caching.
+  [JWvDronkelaar]
+
+- Add checks and tests for faulty LocMemCache usage in application setup.
+  [aleksihakli]
+
+
+4.0.2 (2018-01-19)
+------------------
+
+- Improve Windows compatibility on Python < 3.4 by utilizing win_inet_pton
+  [hsiaoyi0504]
+
+- Add documentation on django-allauth integration
+  [grucha]
+
+- Add documentation on known AccessAttempt caching configuration problems
+  when using axes with the `django.core.cache.backends.locmem.LocMemCache`
+  [aleksihakli]
+
+- Refactor and improve existing AccessAttempt cache reset utility
+  [aleksihakli]
+
+
+4.0.1 (2017-12-19)
+------------------
+
+- Fixes issue when not using `AXES_USERNAME_FORM_FIELD`
+  [camilonova]
+
+
+4.0.0 (2017-12-18)
+------------------
+
+- *BREAKING CHANGES*. `AXES_BEHIND_REVERSE_PROXY` `AXES_REVERSE_PROXY_HEADER`
+  `AXES_NUM_PROXIES` were removed in order to use `django-ipware` to get
+  the user ip address
+  [camilonova]
+
+- Added support for custom username field
+  [kakulukia]
+
+- Customizing Axes doc updated
+  [pckapps]
+
+- Remove filtering by username
+  [camilonova]
+
+- Fixed logging failed attempts to authenticate using a custom authentication
+  backend.
+  [D3X]
+
+
+3.0.3 (2017-11-23)
+------------------
+
+- Test against Python 2.7.
+  [mbaechtold]
+
+- Test against Python 3.4.
+  [pope1ni]
+
+
+3.0.2 (2017-11-21)
+------------------
+
+- Added form_invalid decorator. Fixes #265
+  [camilonova]
+
+
+3.0.1 (2017-11-17)
+------------------
+
+- Fix DeprecationWarning for logger warning
+  [richardowen]
+
+- Fixes global lockout possibility
+  [joeribekker]
+
+- Changed the way output is handled in the management commands
+  [ataylor32]
+
+
+3.0.0 (2017-11-17)
+------------------
+
+- BREAKING CHANGES. Support for Django >= 1.11 and signals, see issue #215.
+  Drop support for Python < 3.6
+  [camilonova]
+
+
+2.3.3 (2017-07-20)
+------------------
+
+- Many tweaks and handles successful AJAX logins.
+  [Jack Sullivan]
+
+- Add tests for proxy number parametrization
+  [aleksihakli]
+
+- Add AXES_NUM_PROXIES setting
+  [aleksihakli]
+
+- Log failed access attempts regardless of settings
+  [jimr]
+
+- Updated configuration docs to include AXES_IP_WHITELIST
+  [Minkey27]
+
+- Add test for get_cache_key function
+  [jorlugaqui]
+
+- Delete cache key in reset command line
+  [jorlugaqui]
+
+- Add signals for setting/deleting cache keys
+  [jorlugaqui]
+
+
+2.3.2 (2016-11-24)
+------------------
+
+- Only look for lockable users on a POST
+  [schinckel]
+
+- Fix and add tests for IPv4 and IPv6 parsing
+  [aleksihakli]
+
+
+2.3.1 (2016-11-12)
+------------------
+
+- Added settings for disabling success accesslogs
+  [Minkey27]
+
+- Fixed illegal IP address string passed to inet_pton
+  [samkuehn]
+
+
+2.3.0 (2016-11-04)
+------------------
+
+- Fixed ``axes_reset`` management command to skip "ip" prefix to command
+  arguments.
+  [EvaMarques]
+
+- Added ``axes_reset_user`` management command to reset lockouts and failed
+  login records for given users.
+  [vladimirnani]
+
+- Fixed Travis-PyPI release configuration.
+  [jezdez]
+
+- Make IP position argument optional.
+  [aredalen]
+
+- Added possibility to disable access log
+  [svenhertle]
+
+- Fix for IIS used as reverse proxy adding port number
+  [Dmitri-Sintsov]
+
+- Made the signal race condition safe.
+  [Minkey27]
+
+- Added AXES_ONLY_USER_FAILURES to support only looking at the user ID.
+  [lip77us]
+
+
+2.2.0 (2016-07-20)
+------------------
+
+- Improve the logic when using a reverse proxy to avoid possible attacks.
+  [camilonova]
+
+
+2.1.0 (2016-07-14)
+------------------
+
+- Add `default_app_config` so you can just use `axes` in `INSTALLED_APPS`
+  [vdboor]
+
+
+2.0.0 (2016-06-24)
+------------------
+
+- Removed middleware to use app_config
+  [camilonova]
+
+- Lots of cleaning
+  [camilonova]
+
+- Improved test suite and versions
+  [camilonova]
+
+
+1.7.0 (2016-06-10)
+------------------
+
+- Use render shortcut for rendering LOCKOUT_TEMPLATE
+  [Radoslaw Luter]
+
+- Added app_label for RemovedInDjango19Warning
+  [yograterol]
+
+- Add iso8601 translator.
+  [mullakhmetov]
+
+- Edit json response. Context now contains ISO 8601 formatted cooloff time
+  [mullakhmetov]
+
+- Add json response and iso8601 tests.
+  [mullakhmetov]
+
+- Fixes issue 162: UnicodeDecodeError on pip install
+  [joeribekker]
+
+- Added AXES_NEVER_LOCKOUT_WHITELIST option to prevent certain IPs from being locked out.
+  [joeribekker]
+
+
+1.6.1 (2016-05-13)
+------------------
+
+- Fixes whitelist check when BEHIND_REVERSE_PROXY
+  [Patrick Hagemeister]
+
+- Made migrations py3 compatible
+  [mvdwaeter]
+
+- Fixing #126, possibly breaking compatibility with Django<=1.7
+  [int-ua]
+
+- Add note for upgrading users about new migration files
+  [kelseyq]
+
+- Fixes #148
+  [camilonova]
+
+- Decorate auth_views.login only once
+  [teeberg]
+
+- Set IP public/private classifier to be compliant with RFC 1918.
+  [SilasX]
+
+- Issue #155. Lockout response status code changed to 403.
+  [Arthur Mullahmetov]
+
+- BUGFIX: Missing migration
+  [smeinel]
+
+
+1.6.0 (2016-01-07)
+------------------
+
+- Stopped using render_to_response so that other template engines work
+  [tarkatronic]
+
+- Improved performance & DoS prevention on query2str
+  [tarkatronic]
+
+- Immediately return from is_already_locked if the user is not lockable
+  [jdunck]
+
+- Iterate over ip addresses only once
+  [annp89]
+
+- added initial migration files to support django 1.7 &up. Upgrading users should run migrate --fake-initial after update
+  [ibaguio]
+
+- Add db indexes to CommonAccess model
+  [Schweigi]
+
+
+1.5.0 (2015-09-11)
+------------------
+
+- Fix #_get_user_attempts to include username when filtering AccessAttempts if AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP is True
+  [afioca]
+
+
+1.4.0 (2015-08-09)
+------------------
+
+- Send the user_locked_out signal. Fixes #94.
+  [toabi]
+
+
+1.3.9 (2015-02-11)
+------------------
+
+- Python 3 fix (#104)
+
+
+1.3.8 (2014-10-07)
+------------------
+
+- Rename GitHub organization from django-security to django-pci to emphasize focus on providing assistance with building PCI compliant websites with Django.
+  [aclark4life]
+
+
+1.3.7 (2014-10-05)
+------------------
+
+- Explain common issues where Axes fails silently
+  [cericoda]
+
+- Allow for user-defined username field for lookup in POST data
+  [SteveByerly]
+
+- Log out only if user was logged in
+  [zoten]
+
+- Support for floats in cooloff time (i.e: 0.1 == 6 minutes)
+  [marianov]
+
+- Limit amount of POST data logged (#73). Limiting the length of value is not enough, as there could be arbitrary number of them, or very long key names.
+  [peterkuma]
+
+- Improve get_ip to try for real ip address
+  [7wonders]
+
+- Change IPAddressField to GenericIPAddressField. When using a PostgreSQL database and the client does not pass an IP address you get an inet error. This is a known problem with PostgreSQL and the IPAddressField. https://code.djangoproject.com/ticket/5622. It can be fixed by using a GenericIPAddressField instead.
+  [polvoblanco]
+
+- Get first X-Forwarded-For IP
+  [tutumcloud]
+
+- White listing IP addresses behind reverse proxy. Allowing some IP addresses to have direct access to the app even if they are behind a reverse proxy. Those IP addresses must still be on a white list.
+  [ericbulloch]
+
+- Reduce logging of reverse proxy IP lookup and use configured logger. Fixes #76. Instead of logging the notice that django.axes looks for a HTTP header set by a reverse proxy on each attempt, just log it one-time on first module import. Also use the configured logger (by default axes.watch_login) for the message to be more consistent in logging.
+  [eht16]
+
+- Limit the length of the values logged into the database. Refs #73
+  [camilonova]
+
+- Refactored tests to be more stable and faster
+  [camilonova]
+
+- Clean client references
+  [camilonova]
+
+- Fixed admin login url
+  [camilonova]
+
+- Added django 1.7 for testing
+  [camilonova]
+
+- Travis file cleanup
+  [camilonova]
+
+- Remove hardcoded url path
+  [camilonova]
+
+- Fixing tests for django 1.7
+  [Andrew-Crosio]
+
+- Fix for django 1.7 exception not existing
+  [Andrew-Crosio]
+
+- Removed python 2.6 from testing
+  [camilonova]
+
+- Use django built-in six version
+  [camilonova]
+
+- Added six as requirement
+  [camilonova]
+
+- Added python 2.6 for travis testing
+  [camilonova]
+
+- Replaced u string literal prefixes with six.u() calls
+  [amrhassan]
+
+- Fixes object type issue, response is not an string
+  [camilonova]
+
+- Python 3 compatibility fix for db_reset
+  [nicois]
+
+- Added example project and helper scripts
+  [barseghyanartur]
+
+- Admin command to list login attemps
+  [marianov]
+
+- Replaced six imports with django.utils.six ones
+  [amrhassan]
+
+- Replaced u string literal prefixes with six.u() calls to make it compatible with Python 3.2
+  [amrhassan]
+
+- Replaced `assertIn`s and `assertNotIn`s with `assertContains` and `assertNotContains`
+  [fcurella]
+
+- Added py3k to travis
+  [fcurella]
+
+- Update test cases to be python3 compatible
+  [nicois]
+
+- Python 3 compatibility fix for db_reset
+  [nicois]
+
+- Removed trash from example urls
+  [barseghyanartur]
+
+- Added django installer
+  [barseghyanartur]
+
+- Added example project and helper scripts
+  [barseghyanartur]
+
+
+1.3.6 (2013-11-23)
+------------------
+
+- Added AttributeError in case get_profile doesn't exist
+  [camilonova]
+
+- Improved axes_reset command
+  [camilonova]
+
+
+1.3.5 (2013-11-01)
+------------------
+
+- Fix an issue with __version__ loading the wrong version
+  [graingert]
+
+
+1.3.4 (2013-11-01)
+------------------
+
+- Update README.rst for PyPI
+  [marty, camilonova, graingert]
+
+- Add cooloff period
+  [visualspace]
+
+
+1.3.3 (2013-07-05)
+------------------
+
+- Added 'username' field to the Admin table
+  [bkvirendra]
+
+- Removed fallback logging creation since logging cames by default on django 1.4 or later,
+  if you don't have it is because you explicitly wanted. Fixes #45
+  [camilonova]
+
+
+1.3.2 (2013-03-28)
+------------------
+
+- Fix an issue when a user logout
+  [camilonova]
+
+- Match pypi version
+  [camilonova]
+
+- Better User model import method
+  [camilonova]
+
+- Use only one place to get the version number
+  [camilonova]
+
+- Fixed an issue when a user on django 1.4 logout
+  [camilonova]
+
+- Handle exception if there is not user profile model set
+  [camilonova]
+
+- Made some cleanup and remove a pokemon exception handling
+  [camilonova]
+
+- Improved tests so it really looks for the rabbit in the hole
+  [camilonova]
+
+- Match pypi version
+  [camilonova]
+
+
+1.3.1 (2013-03-19)
+------------------
+
+- Add support for Django 1.5
+  [camilonova]
+
+
+1.3.0 (2013-02-27)
+------------------
+
+- Bug fix: get_version() format string
+  [csghormley]
+
+
+1.2.9 (2013-02-20)
+------------------
+
+- Add to and improve test cases
+  [camilonova]
+
+
+1.2.8 (2013-01-23)
+------------------
+
+- Increased http accept header length
+  [jslatts]
+
+
+1.2.7 (2013-01-17)
+------------------
+
+- Reverse proxy support
+  [rmagee]
+
+- Clean up README
+  [martey]
+
+
+1.2.6 (2012-12-04)
+------------------
+
+- Remove unused import
+  [aclark4life]
+
+
+1.2.5 (2012-11-28)
+------------------
+
+- Fix setup.py
+  [aclark4life]
+
+- Added ability to flag user accounts as unlockable.
+  [kencochrane]
+
+- Added ipaddress as a param to the user_locked_out signal.
+  [kencochrane]
+
+- Added a signal receiver for user_logged_out.
+  [kencochrane]
+
+- Added a signal for when a user gets locked out.
+  [kencochrane]
+
+- Added AccessLog model to log all access attempts.
+  [kencochrane]

+ 23 - 0
desktop/core/ext-py3/django-axes-5.13.0/LICENSE

@@ -0,0 +1,23 @@
+The MIT License
+
+Copyright (c) 2008 Josh VanderLinden
+Copyright (c) 2009 Philip Neustrom <philipn@gmail.com>
+Copyright (c) 2016 Jazzband <security@jazzband.co>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 1330 - 0
desktop/core/ext-py3/django-axes-5.13.0/PKG-INFO

@@ -0,0 +1,1330 @@
+Metadata-Version: 1.2
+Name: django-axes
+Version: 5.13.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
+Author-email: security@jazzband.co
+Maintainer: Jazzband
+Maintainer-email: security@jazzband.co
+License: MIT
+Project-URL: Documentation, https://django-axes.readthedocs.io/
+Project-URL: Source, https://github.com/jazzband/django-axes
+Project-URL: Tracker, https://github.com/jazzband/django-axes/issues
+Description: 
+        django-axes
+        ===========
+        
+        .. image:: https://jazzband.co/static/img/badge.svg
+           :target: https://jazzband.co/
+           :alt: Jazzband
+        
+        .. image:: https://img.shields.io/github/stars/jazzband/django-axes.svg?label=Stars&style=socialcA
+           :target: https://github.com/jazzband/django-axes
+           :alt: GitHub
+        
+        .. image:: https://img.shields.io/pypi/v/django-axes.svg
+           :target: https://pypi.org/project/django-axes/
+           :alt: PyPI release
+        
+        .. image:: https://img.shields.io/readthedocs/django-axes.svg
+           :target: https://django-axes.readthedocs.io/
+           :alt: Documentation
+        
+        .. image:: https://github.com/jazzband/django-axes/workflows/Test/badge.svg
+           :target: https://github.com/jazzband/django-axes/actions
+           :alt: GitHub Actions
+        
+        .. image:: https://codecov.io/gh/jazzband/django-axes/branch/master/graph/badge.svg
+           :target: https://codecov.io/gh/jazzband/django-axes
+           :alt: Coverage
+        
+        
+        Axes is a Django plugin for keeping track of suspicious
+        login attempts for your Django based website
+        and implementing simple brute-force attack blocking.
+        
+        The name is sort of a geeky pun, since it can be interpreted as:
+        
+        * ``access``, as in monitoring access attempts, or
+        * ``axes``, as in tools you can use to hack (generally on wood).
+        
+        
+        Functionality
+        -------------
+        
+        Axes records login attempts to your Django powered site and prevents attackers
+        from attempting further logins to your site when they exceed the configured attempt limit.
+        
+        Axes can track the attempts and persist them in the database indefinitely,
+        or alternatively use a fast and DDoS resistant cache implementation.
+        
+        Axes can be configured to monitor login attempts by
+        IP address, username, user agent, or their combinations.
+        
+        Axes supports cool off periods, IP address whitelisting and blacklisting,
+        user account whitelisting, and other features for Django access management.
+        
+        
+        Documentation
+        -------------
+        
+        For more information on installation and configuration see the documentation at:
+        
+        https://django-axes.readthedocs.io/
+        
+        
+        Issues
+        ------
+        
+        If you have questions or have trouble using the app please file a bug report at:
+        
+        https://github.com/jazzband/django-axes/issues
+        
+        
+        Contributions
+        -------------
+        
+        All contributions are welcome!
+        
+        It is best to separate proposed changes and PRs into small, distinct patches
+        by type so that they can be merged faster into upstream and released quicker.
+        
+        One way to organize contributions would be to separate PRs for e.g.
+        
+        * bugfixes,
+        * new features,
+        * code and design improvements,
+        * documentation improvements, or
+        * tooling and CI improvements.
+        
+        Merging contributions requires passing the checks configured
+        with the CI. This includes running tests and linters successfully
+        on the currently officially supported Python and Django versions.
+        
+        The test automation is run automatically with GitHub Actions, but you can
+        run it locally with the ``tox`` command before pushing commits.
+        
+        Please note that this is a `Jazzband <https://jazzband.co>`_ project.
+        By contributing you agree to abide by the
+        `Contributor Code of Conduct <https://jazzband.co/about/conduct>`_
+        and follow the `guidelines <https://jazzband.co/about/guidelines>`_.
+        
+        
+        Changes
+        =======
+        
+        
+        5.13.0 (2021-02-15)
+        -------------------
+        
+        - Add support for resetting attempts with cache backend.
+          [nattyg93]
+        
+        
+        5.12.0 (2021-01-07)
+        -------------------
+        
+        - Clean up test structure and migrate tests outside
+          the main package for a smaller wheel distributions.
+          [aleksihakli]
+        - Move configuration to pyproject.toml for cleaner layout.
+          [aleksihakli]
+        - Clean up test settings override configuration.
+          [hramezani]
+        
+        
+        5.11.1 (2021-01-06)
+        -------------------
+        
+        - Fix cache entry creations for None username.
+          [cabarnes]
+        
+        
+        5.11.0 (2021-01-05)
+        -------------------
+        
+        - Add lockout view CORS support with ``AXES_ALLOWED_CORS_ORIGINS`` configuration flag.
+          [vladox]
+        - Add missing ``@wraps`` decorator to ``axes.decorators.axes_dispatch``.
+          [aleksihakli]
+        
+        
+        5.10.1 (2021-01-04)
+        -------------------
+        
+        - Add ``DEFAULT_AUTO_FIELD`` to test settings.
+          [hramezani]
+        - Fix documentation language.
+          [danielquinn] 
+        - Fix Python package version specifiers and remove redundant imports.
+          [aleksihakli]
+        
+        
+        5.10.0 (2020-12-18)
+        -------------------
+        
+        - Deprecate stock DRF support from 5.8.0,
+          require users to set it up per project.
+          Check the documentation for more information.
+          [aleksihakli]
+        
+        
+        5.9.1 (2020-12-02)
+        ------------------
+        
+        - Move tests to GitHub Actions
+          [jezdez]
+        - Fix running Axes code in middleware when ``AXES_ENABLED`` is ``False``.
+          [ashokdelphia]
+        
+        
+        5.9.0 (2020-11-05)
+        ------------------
+        
+        - Add Python 3.9 support.
+          [hramezani]
+        - Prevent ``AccessAttempt`` creation with database handler when
+          username is not set and ``AXES_ONLY_USER_FAILURES`` setting is not set.
+          [hramezani]
+        
+        
+        5.8.0 (2020-10-16)
+        ------------------
+        
+        - Improve Django REST Framework (DRF) integration.
+          [Anatoly]
+        
+        
+        5.7.1 (2020-09-27)
+        ------------------
+        
+        - Adjust settings import and handling chain
+          for cleaner module import and invocation order.
+          [aleksihakli]
+        - Adjust the use of ``AXES_ENABLED`` flag so that
+          imports are always done the same way and initial log
+          is written regardless of the setting and it only affects
+          code that is decorated or wrapped with ``toggleable``.
+          [alekshakli]
+        
+        
+        5.7.0 (2020-09-26)
+        ------------------
+        
+        - Deprecate ``AXES_LOGGER`` Axes setting and move to ``__name__``
+          based logging and fully qualified Python module name log identifiers.
+          [aleksihakli]
+        
+        
+        5.6.2 (2020-09-20)
+        ------------------
+        
+        - Fix regression in ``axes_reset_user`` management command.
+          [aleksihakli]
+        
+        
+        5.6.1 (2020-09-17)
+        ------------------
+        
+        - Improve test dependency management and upgrade black code formatter.
+          [smithdc1]
+        
+        
+        5.6.0 (2020-09-12)
+        ------------------
+        
+        - Add proper development ``subTest`` support via ``pytest-subtests`` package.
+          [smithdc1]
+        - Deprecate ``django-appconf`` and use plain settings for Axes.
+          [aleksihakli]
+        
+        
+        5.5.2 (2020-09-11)
+        ------------------
+        
+        - Update deprecating use of the ``request.is_ajax`` method.
+          [smithdc1]
+        
+        
+        5.5.1 (2020-09-10)
+        ------------------
+        
+        - Update deprecated uses of Django modules and members.
+          [smithdc1]
+        
+        
+        5.5.0 (2020-08-21)
+        ------------------
+        
+        - Add support for locking requests based on
+          username OR IP address with inclusive or
+          using the ``LOCK_OUT_BY_USER_OR_IP`` flag.
+          [PetrDlouhy]
+        - Deprecate Signal ``providing_args`` for Django 3.1 support.
+          [coredumperror]
+        
+        
+        5.4.3 (2020-08-06)
+        ------------------
+        
+        - Add Django 3.1 support.
+          [hramezani]
+        
+        
+        5.4.2 (2020-07-28)
+        ------------------
+        
+        - Add ABC or abstract base class implementation for handlers.
+          [jorlugaqui]
+        
+        
+        5.4.1 (2020-07-03)
+        ------------------
+        
+        - Fix code styling for linters.
+          [aleksihakli]
+        
+        
+        5.4.0 (2020-07-03)
+        ------------------
+        
+        - Propagate username to lockout view in URL parameters.
+          [PetrDlouhy]
+        - Update CAPTCHA examples.
+          [PetrDlouhy]
+        - Upgrade django-ipware to version 3.
+          [hramezani,mnislam01]
+        
+        
+        5.3.5 (2020-07-02)
+        ------------------
+        
+        - Restrict ipware version for version compatibility.
+          [aleksihakli]
+        
+        
+        5.3.4 (2020-06-09)
+        ------------------
+        
+        - Deprecate Django 1.11 LTS support.
+          [aleksihakli]
+        
+        
+        5.3.3 (2020-05-22)
+        ------------------
+        
+        - Fix ``AXES_ONLY_ADMIN_SITE`` functionality when
+          no default admin site is defined in the URL configuration.
+          [igor-shevchenko]
+        
+        
+        5.3.2 (2020-05-15)
+        ------------------
+        
+        - Fix AppConf settings prefix for Fargate.
+          [marksweb]
+        
+        
+        5.3.1 (2020-03-23)
+        ------------------
+        
+        - Fix null byte ValueError bug in ORM.
+          [ddimmich]
+        
+        
+        5.3.0 (2020-03-10)
+        ------------------
+        
+        - Improve Django REST Framework compatibility.
+          [I0x4dI]
+        
+        
+        5.2.2 (2020-01-08)
+        ------------------
+        
+        - Add missing proxy implementation for
+          ``axes.handlers.proxy.AxesProxyHandler.get_failures``.
+          [aleksihakli]
+        
+        
+        5.2.1 (2020-01-08)
+        ------------------
+        
+        - Add django-reversion compatibility notes.
+          [mark-mishyn]
+        - Add pluggable lockout responses and the
+          ``AXES_LOCKOUT_CALLABLE`` configuration flag.
+          [aleksihakli]
+        
+        
+        5.2.0 (2020-01-01)
+        ------------------
+        
+        - Add a test handler.
+          [aidanlister]
+        
+        
+        5.1.0 (2019-12-29)
+        ------------------
+        
+        - Add pluggable user account whitelisting and the
+          ``AXES_WHITELIST_CALLABLE`` configuration flag.
+          [aleksihakli]
+        
+        
+        5.0.20 (2019-12-01)
+        -------------------
+        
+        - Fix django-allauth compatibility issue.
+          [hramezani]
+        - Improve tests for login attempt monitoring.
+          [hramezani]
+        - Add reverse proxy documentation.
+          [ckcollab]
+        - Update OAuth documentation examples.
+          [aleksihakli]
+        
+        
+        5.0.19 (2019-11-06)
+        -------------------
+        
+        - Optimize access attempt fetching in database handler.
+          [hramezani]
+        - Optimize request data fetching in proxy handler.
+          [hramezani]
+        
+        
+        5.0.18 (2019-10-17)
+        -------------------
+        
+        - Add ``cooloff_timedelta`` context variable to lockout responses.
+          [jstockwin]
+        
+        
+        5.0.17 (2019-10-15)
+        -------------------
+        
+        - Safer string formatting for user input.
+          [aleksihakli]
+        
+        
+        5.0.16 (2019-10-15)
+        -------------------
+        
+        - Fix string formatting bug in logging.
+          [zerolab]
+        
+        
+        5.0.15 (2019-10-09)
+        -------------------
+        
+        - Add ``AXES_ENABLE_ADMIN`` flag.
+          [flannelhead]
+        
+        
+        5.0.14 (2019-09-28)
+        -------------------
+        
+        - Docs, CI pipeline, and code formatting improvements
+          [aleksihakli]
+        
+        
+        5.0.13 (2019-08-30)
+        -------------------
+        
+        - Python 3.8 and PyPy support.
+          [aleksihakli]
+        - Migrate to ``setuptools_scm`` and automatic versioning.
+          [aleksihakli]
+        
+        
+        5.0.12 (2019-08-05)
+        -------------------
+        
+        - Support callables for ``AXES_COOLOFF_TIME`` setting.
+          [DariaPlotnikova]
+        
+        
+        5.0.11 (2019-07-25)
+        -------------------
+        
+        - Fix typo in rST formatting that prevented 5.0.10 release to PyPI.
+          [aleksihakli]
+        
+        
+        5.0.10 (2019-07-25)
+        -------------------
+        
+        - Refactor type checks for ``axes.helpers.get_client_cache_key``
+          for framework compatibility, fixes #471.
+          [aleksihakli]
+        
+        
+        5.0.9 (2019-07-11)
+        ------------------
+        
+        - Add better handling for attempt and log resets by moving them
+          into handlers which allows customization and more configurability.
+          Unimplemented handlers raise ``NotImplementedError`` by default.
+          [aleksihakli]
+        - Add Python 3.8 dev version and PyPy to the Travis test matrix.
+          [aleksihakli]
+        
+        
+        5.0.8 (2019-07-09)
+        ------------------
+        
+        - Add ``AXES_ONLY_ADMIN_SITE`` flag for only running Axes on admin site.
+          [hramezani]
+        - Add ``axes_reset_logs`` command for removing old AccessLog records.
+          [tlebrize]
+        - Allow ``AxesBackend`` subclasses to pass the ``axes.W003`` system check.
+          [adamchainz]
+        
+        
+        5.0.7 (2019-06-14)
+        ------------------
+        
+        - Fix lockout message showing when lockout is disabled
+          with the ``AXES_LOCK_OUT_AT_FAILURE`` setting.
+          [mogzol]
+        
+        - Add support for callable ``AXES_FAILURE_LIMIT`` setting.
+          [bbayles]
+        
+        
+        5.0.6 (2019-05-25)
+        ------------------
+        
+        - Deprecate ``AXES_DISABLE_SUCCESS_ACCESS_LOG`` flag in favour of
+          ``AXES_DISABLE_ACCESS_LOG`` which has mostly the same functionality.
+          Update documentation to better reflect the behaviour of the flag.
+          [aleksihakli]
+        
+        
+        5.0.5 (2019-05-19)
+        ------------------
+        
+        - Change the lockout response calculation to request flagging
+          instead of exception throwing in the signal handler and middleware.
+          Move request attribute calculation from middleware to handler layer.
+          Deprecate ``axes.request.AxesHttpRequest`` object type definition.
+          [aleksihakli]
+        
+        - Deprecate the old version 4.x ``axes.backends.AxesModelBackend`` class.
+          [aleksihakli]
+        
+        - Improve documentation on attempt tracking, resets, Axes customization,
+          project and component compatibility and integrations, and other things.
+          [aleksihakli]
+        
+        
+        5.0.4 (2019-05-09)
+        ------------------
+        
+        - Fix regression with OAuth2 authentication backends not having remote
+          IP addresses set and throwing an exception in cache key calculation.
+          [aleksihakli]
+        
+        
+        5.0.3 (2019-05-08)
+        ------------------
+        
+        - Fix ``django.contrib.auth`` module ``login`` and ``logout`` functionality
+          so that they work with the handlers without the an ``AxesHttpRequest``
+          to improve cross compatibility with other Django applications.
+          [aleksihakli]
+        
+        - Change IP address resolution to allow empty or missing addresses.
+          [aleksihakli]
+        
+        - Add error logging for missing request attributes in the handler layer
+          so that users get better indicators of misconfigured applications.
+          [aleksihakli]
+        
+        
+        5.0.2 (2019-05-07)
+        ------------------
+        
+        - Add ``AXES_ENABLED`` setting for disabling Axes with e.g. tests
+          that use Django test client ``login``, ``logout``, and ``force_login``
+          methods, which do not supply the ``request`` argument to views,
+          preventing Axes from functioning correctly in certain test setups.
+          [aleksihakli]
+        
+        
+        5.0.1 (2019-05-03)
+        ------------------
+        
+        - Add changelog to documentation.
+          [aleksihakli]
+        
+        
+        5.0 (2019-05-01)
+        ----------------
+        
+        - Deprecate Python 2.7, 3.4 and 3.5 support.
+          [aleksihakli]
+        
+        - Remove automatic decoration and monkey-patching of Django views and forms.
+          Decorators are available for login function and method decoration as before.
+          [aleksihakli]
+        
+        - Use backend, middleware, and signal handlers for tracking
+          login attempts and implementing user lockouts.
+          [aleksihakli, jorlugaqui, joshua-s]
+        
+        - Add ``AxesDatabaseHandler``, ``AxesCacheHandler``, and ``AxesDummyHandler``
+          handler backends for processing user login and logout events and failures.
+          Handlers are configurable with the ``AXES_HANDLER`` setting.
+          [aleksihakli, jorlugaqui, joshua-s]
+        
+        - Improve management commands and separate commands for resetting
+          all access attempts, attempts by IP, and attempts by username.
+          New command names are ``axes_reset``, ``axes_reset_ip`` and ``axes_reset_username``.
+          [aleksihakli]
+        
+        - Add support for string import for ``AXES_USERNAME_CALLABLE``
+          that supports dotted paths in addition to the old
+          callable type such as a function or a class method.
+          [aleksihakli]
+        
+        - Deprecate one argument call signature for ``AXES_USERNAME_CALLABLE``.
+          From now on, the callable needs to accept two arguments,
+          the HttpRequest and credentials that are supplied to the
+          Django ``authenticate`` method in authentication backends.
+          [aleksihakli]
+        
+        - Move ``axes.attempts.is_already_locked`` function to ``axes.handlers.AxesProxyHandler.is_locked``.
+          Various other previously undocumented methods have been deprecated and moved inside the project.
+          The new documented public APIs can be considered as stable and can be safely utilized by other projects.
+          [aleksihakli]
+        
+        - Improve documentation layouting and contents. Add public API reference section.
+          [aleksihakli]
+        
+        
+        4.5.4 (2019-01-15)
+        ------------------
+        
+        - Improve README and documentation
+          [aleksihakli]
+        
+        
+        4.5.3 (2019-01-14)
+        ------------------
+        
+        - Remove the unused ``AccessAttempt.trusted`` flag from models
+          [aleksihakli]
+        
+        - Improve README and Travis CI setups
+          [aleksihakli]
+        
+        
+        4.5.2 (2019-01-12)
+        ------------------
+        
+        - Added Turkish translations
+          [obayhan]
+        
+        
+        4.5.1 (2019-01-11)
+        ------------------
+        
+        - Removed duplicated check that was causing issues when using APIs.
+          [camilonova]
+        
+        - Added Russian translations
+          [lubicz-sielski]
+        
+        
+        4.5.0 (2018-12-25)
+        ------------------
+        
+        - Improve support for custom authentication credentials using the
+          ``AXES_USERNAME_FORM_FIELD`` and ``AXES_USERNAME_CALLABLE`` settings.
+          [mastacheata]
+        
+        - Updated behaviour for fetching username from request or credentials:
+          If no ``AXES_USERNAME_CALLABLE`` is configured, the optional
+          ``credentials`` that are supplied to the axes utility methods
+          are now the default source for client username and the HTTP
+          request POST is the fallback for fetching the user information.
+          ``AXES_USERNAME_CALLABLE`` implements an alternative signature with two
+          arguments ``request, credentials`` in addition to the old ``request``
+          call argument signature in a backwards compatible fashion.
+          [aleksihakli]
+        
+        - Add official support for the Django 2.1 version and Python 3.7.
+          [aleksihakli]
+        
+        - Improve the requirements, documentation, tests, and CI setup.
+          [aleksihakli]
+        
+        
+        4.4.3 (2018-12-08)
+        ------------------
+        
+        - Fix MANIFEST.in missing German translations
+          [aleksihakli]
+        
+        - Add `AXES_RESET_ON_SUCCESS` configuration flag
+          [arjenzijlstra]
+        
+        
+        4.4.2 (2018-10-30)
+        ------------------
+        
+        - fix missing migration and add check to prevent it happening again.
+          [markddavidoff]
+        
+        
+        4.4.1 (2018-10-24)
+        ------------------
+        
+        - Add a German translation
+          [adonig]
+        
+        - Documentation wording changes
+          [markddavidoff]
+        
+        - Use `get_client_username` in `log_user_login_failed` instead of credentials
+          [markddavidoff]
+        
+        - pin prospector to 0.12.11, and pin astroid to 1.6.5
+          [hsiaoyi0504]
+        
+        
+        4.4.0 (2018-05-26)
+        ------------------
+        
+        - Added AXES_USERNAME_CALLABLE
+          [jaadus]
+        
+        
+        4.3.1 (2018-04-21)
+        ------------------
+        
+        - Change custom authentication backend failures from error to warning log level
+          [aleksihakli]
+        
+        - Set up strict code linting for CI pipeline that fails builds if linting does not pass
+          [aleksihakli]
+        
+        - Clean up old code base and tests based on linter errors
+          [aleksihakli]
+        
+        
+        4.3.0 (2018-04-21)
+        ------------------
+        
+        - Refactor and clean up code layout
+          [aleksihakli]
+        
+        - Add prospector linting and code checks to toolchain
+          [aleksihakli]
+        
+        - Clean up log message formatting and refactor type checks
+          [EvaSDK]
+        
+        - Fix faulty user locking with user agent when AXES_ONLY_USER_FAILURES is set
+          [EvaSDK]
+        
+        
+        4.2.1 (2018-04-18)
+        ------------------
+        
+        - Fix unicode string interpolation on Python 2.7
+          [aleksihakli]
+        
+        
+        4.2.0 (2018-04-13)
+        ------------------
+        
+        - Add configuration flags for client IP resolving
+          [aleksihakli]
+        
+        - Add AxesModelBackend authentication backend
+          [markdaviddoff]
+        
+        
+        4.1.0 (2018-02-18)
+        ------------------
+        
+        - Add AXES_CACHE setting for configuring `axes` specific caching.
+          [JWvDronkelaar]
+        
+        - Add checks and tests for faulty LocMemCache usage in application setup.
+          [aleksihakli]
+        
+        
+        4.0.2 (2018-01-19)
+        ------------------
+        
+        - Improve Windows compatibility on Python < 3.4 by utilizing win_inet_pton
+          [hsiaoyi0504]
+        
+        - Add documentation on django-allauth integration
+          [grucha]
+        
+        - Add documentation on known AccessAttempt caching configuration problems
+          when using axes with the `django.core.cache.backends.locmem.LocMemCache`
+          [aleksihakli]
+        
+        - Refactor and improve existing AccessAttempt cache reset utility
+          [aleksihakli]
+        
+        
+        4.0.1 (2017-12-19)
+        ------------------
+        
+        - Fixes issue when not using `AXES_USERNAME_FORM_FIELD`
+          [camilonova]
+        
+        
+        4.0.0 (2017-12-18)
+        ------------------
+        
+        - *BREAKING CHANGES*. `AXES_BEHIND_REVERSE_PROXY` `AXES_REVERSE_PROXY_HEADER`
+          `AXES_NUM_PROXIES` were removed in order to use `django-ipware` to get
+          the user ip address
+          [camilonova]
+        
+        - Added support for custom username field
+          [kakulukia]
+        
+        - Customizing Axes doc updated
+          [pckapps]
+        
+        - Remove filtering by username
+          [camilonova]
+        
+        - Fixed logging failed attempts to authenticate using a custom authentication
+          backend.
+          [D3X]
+        
+        
+        3.0.3 (2017-11-23)
+        ------------------
+        
+        - Test against Python 2.7.
+          [mbaechtold]
+        
+        - Test against Python 3.4.
+          [pope1ni]
+        
+        
+        3.0.2 (2017-11-21)
+        ------------------
+        
+        - Added form_invalid decorator. Fixes #265
+          [camilonova]
+        
+        
+        3.0.1 (2017-11-17)
+        ------------------
+        
+        - Fix DeprecationWarning for logger warning
+          [richardowen]
+        
+        - Fixes global lockout possibility
+          [joeribekker]
+        
+        - Changed the way output is handled in the management commands
+          [ataylor32]
+        
+        
+        3.0.0 (2017-11-17)
+        ------------------
+        
+        - BREAKING CHANGES. Support for Django >= 1.11 and signals, see issue #215.
+          Drop support for Python < 3.6
+          [camilonova]
+        
+        
+        2.3.3 (2017-07-20)
+        ------------------
+        
+        - Many tweaks and handles successful AJAX logins.
+          [Jack Sullivan]
+        
+        - Add tests for proxy number parametrization
+          [aleksihakli]
+        
+        - Add AXES_NUM_PROXIES setting
+          [aleksihakli]
+        
+        - Log failed access attempts regardless of settings
+          [jimr]
+        
+        - Updated configuration docs to include AXES_IP_WHITELIST
+          [Minkey27]
+        
+        - Add test for get_cache_key function
+          [jorlugaqui]
+        
+        - Delete cache key in reset command line
+          [jorlugaqui]
+        
+        - Add signals for setting/deleting cache keys
+          [jorlugaqui]
+        
+        
+        2.3.2 (2016-11-24)
+        ------------------
+        
+        - Only look for lockable users on a POST
+          [schinckel]
+        
+        - Fix and add tests for IPv4 and IPv6 parsing
+          [aleksihakli]
+        
+        
+        2.3.1 (2016-11-12)
+        ------------------
+        
+        - Added settings for disabling success accesslogs
+          [Minkey27]
+        
+        - Fixed illegal IP address string passed to inet_pton
+          [samkuehn]
+        
+        
+        2.3.0 (2016-11-04)
+        ------------------
+        
+        - Fixed ``axes_reset`` management command to skip "ip" prefix to command
+          arguments.
+          [EvaMarques]
+        
+        - Added ``axes_reset_user`` management command to reset lockouts and failed
+          login records for given users.
+          [vladimirnani]
+        
+        - Fixed Travis-PyPI release configuration.
+          [jezdez]
+        
+        - Make IP position argument optional.
+          [aredalen]
+        
+        - Added possibility to disable access log
+          [svenhertle]
+        
+        - Fix for IIS used as reverse proxy adding port number
+          [Dmitri-Sintsov]
+        
+        - Made the signal race condition safe.
+          [Minkey27]
+        
+        - Added AXES_ONLY_USER_FAILURES to support only looking at the user ID.
+          [lip77us]
+        
+        
+        2.2.0 (2016-07-20)
+        ------------------
+        
+        - Improve the logic when using a reverse proxy to avoid possible attacks.
+          [camilonova]
+        
+        
+        2.1.0 (2016-07-14)
+        ------------------
+        
+        - Add `default_app_config` so you can just use `axes` in `INSTALLED_APPS`
+          [vdboor]
+        
+        
+        2.0.0 (2016-06-24)
+        ------------------
+        
+        - Removed middleware to use app_config
+          [camilonova]
+        
+        - Lots of cleaning
+          [camilonova]
+        
+        - Improved test suite and versions
+          [camilonova]
+        
+        
+        1.7.0 (2016-06-10)
+        ------------------
+        
+        - Use render shortcut for rendering LOCKOUT_TEMPLATE
+          [Radoslaw Luter]
+        
+        - Added app_label for RemovedInDjango19Warning
+          [yograterol]
+        
+        - Add iso8601 translator.
+          [mullakhmetov]
+        
+        - Edit json response. Context now contains ISO 8601 formatted cooloff time
+          [mullakhmetov]
+        
+        - Add json response and iso8601 tests.
+          [mullakhmetov]
+        
+        - Fixes issue 162: UnicodeDecodeError on pip install
+          [joeribekker]
+        
+        - Added AXES_NEVER_LOCKOUT_WHITELIST option to prevent certain IPs from being locked out.
+          [joeribekker]
+        
+        
+        1.6.1 (2016-05-13)
+        ------------------
+        
+        - Fixes whitelist check when BEHIND_REVERSE_PROXY
+          [Patrick Hagemeister]
+        
+        - Made migrations py3 compatible
+          [mvdwaeter]
+        
+        - Fixing #126, possibly breaking compatibility with Django<=1.7
+          [int-ua]
+        
+        - Add note for upgrading users about new migration files
+          [kelseyq]
+        
+        - Fixes #148
+          [camilonova]
+        
+        - Decorate auth_views.login only once
+          [teeberg]
+        
+        - Set IP public/private classifier to be compliant with RFC 1918.
+          [SilasX]
+        
+        - Issue #155. Lockout response status code changed to 403.
+          [Arthur Mullahmetov]
+        
+        - BUGFIX: Missing migration
+          [smeinel]
+        
+        
+        1.6.0 (2016-01-07)
+        ------------------
+        
+        - Stopped using render_to_response so that other template engines work
+          [tarkatronic]
+        
+        - Improved performance & DoS prevention on query2str
+          [tarkatronic]
+        
+        - Immediately return from is_already_locked if the user is not lockable
+          [jdunck]
+        
+        - Iterate over ip addresses only once
+          [annp89]
+        
+        - added initial migration files to support django 1.7 &up. Upgrading users should run migrate --fake-initial after update
+          [ibaguio]
+        
+        - Add db indexes to CommonAccess model
+          [Schweigi]
+        
+        
+        1.5.0 (2015-09-11)
+        ------------------
+        
+        - Fix #_get_user_attempts to include username when filtering AccessAttempts if AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP is True
+          [afioca]
+        
+        
+        1.4.0 (2015-08-09)
+        ------------------
+        
+        - Send the user_locked_out signal. Fixes #94.
+          [toabi]
+        
+        
+        1.3.9 (2015-02-11)
+        ------------------
+        
+        - Python 3 fix (#104)
+        
+        
+        1.3.8 (2014-10-07)
+        ------------------
+        
+        - Rename GitHub organization from django-security to django-pci to emphasize focus on providing assistance with building PCI compliant websites with Django.
+          [aclark4life]
+        
+        
+        1.3.7 (2014-10-05)
+        ------------------
+        
+        - Explain common issues where Axes fails silently
+          [cericoda]
+        
+        - Allow for user-defined username field for lookup in POST data
+          [SteveByerly]
+        
+        - Log out only if user was logged in
+          [zoten]
+        
+        - Support for floats in cooloff time (i.e: 0.1 == 6 minutes)
+          [marianov]
+        
+        - Limit amount of POST data logged (#73). Limiting the length of value is not enough, as there could be arbitrary number of them, or very long key names.
+          [peterkuma]
+        
+        - Improve get_ip to try for real ip address
+          [7wonders]
+        
+        - Change IPAddressField to GenericIPAddressField. When using a PostgreSQL database and the client does not pass an IP address you get an inet error. This is a known problem with PostgreSQL and the IPAddressField. https://code.djangoproject.com/ticket/5622. It can be fixed by using a GenericIPAddressField instead.
+          [polvoblanco]
+        
+        - Get first X-Forwarded-For IP
+          [tutumcloud]
+        
+        - White listing IP addresses behind reverse proxy. Allowing some IP addresses to have direct access to the app even if they are behind a reverse proxy. Those IP addresses must still be on a white list.
+          [ericbulloch]
+        
+        - Reduce logging of reverse proxy IP lookup and use configured logger. Fixes #76. Instead of logging the notice that django.axes looks for a HTTP header set by a reverse proxy on each attempt, just log it one-time on first module import. Also use the configured logger (by default axes.watch_login) for the message to be more consistent in logging.
+          [eht16]
+        
+        - Limit the length of the values logged into the database. Refs #73
+          [camilonova]
+        
+        - Refactored tests to be more stable and faster
+          [camilonova]
+        
+        - Clean client references
+          [camilonova]
+        
+        - Fixed admin login url
+          [camilonova]
+        
+        - Added django 1.7 for testing
+          [camilonova]
+        
+        - Travis file cleanup
+          [camilonova]
+        
+        - Remove hardcoded url path
+          [camilonova]
+        
+        - Fixing tests for django 1.7
+          [Andrew-Crosio]
+        
+        - Fix for django 1.7 exception not existing
+          [Andrew-Crosio]
+        
+        - Removed python 2.6 from testing
+          [camilonova]
+        
+        - Use django built-in six version
+          [camilonova]
+        
+        - Added six as requirement
+          [camilonova]
+        
+        - Added python 2.6 for travis testing
+          [camilonova]
+        
+        - Replaced u string literal prefixes with six.u() calls
+          [amrhassan]
+        
+        - Fixes object type issue, response is not an string
+          [camilonova]
+        
+        - Python 3 compatibility fix for db_reset
+          [nicois]
+        
+        - Added example project and helper scripts
+          [barseghyanartur]
+        
+        - Admin command to list login attemps
+          [marianov]
+        
+        - Replaced six imports with django.utils.six ones
+          [amrhassan]
+        
+        - Replaced u string literal prefixes with six.u() calls to make it compatible with Python 3.2
+          [amrhassan]
+        
+        - Replaced `assertIn`s and `assertNotIn`s with `assertContains` and `assertNotContains`
+          [fcurella]
+        
+        - Added py3k to travis
+          [fcurella]
+        
+        - Update test cases to be python3 compatible
+          [nicois]
+        
+        - Python 3 compatibility fix for db_reset
+          [nicois]
+        
+        - Removed trash from example urls
+          [barseghyanartur]
+        
+        - Added django installer
+          [barseghyanartur]
+        
+        - Added example project and helper scripts
+          [barseghyanartur]
+        
+        
+        1.3.6 (2013-11-23)
+        ------------------
+        
+        - Added AttributeError in case get_profile doesn't exist
+          [camilonova]
+        
+        - Improved axes_reset command
+          [camilonova]
+        
+        
+        1.3.5 (2013-11-01)
+        ------------------
+        
+        - Fix an issue with __version__ loading the wrong version
+          [graingert]
+        
+        
+        1.3.4 (2013-11-01)
+        ------------------
+        
+        - Update README.rst for PyPI
+          [marty, camilonova, graingert]
+        
+        - Add cooloff period
+          [visualspace]
+        
+        
+        1.3.3 (2013-07-05)
+        ------------------
+        
+        - Added 'username' field to the Admin table
+          [bkvirendra]
+        
+        - Removed fallback logging creation since logging cames by default on django 1.4 or later,
+          if you don't have it is because you explicitly wanted. Fixes #45
+          [camilonova]
+        
+        
+        1.3.2 (2013-03-28)
+        ------------------
+        
+        - Fix an issue when a user logout
+          [camilonova]
+        
+        - Match pypi version
+          [camilonova]
+        
+        - Better User model import method
+          [camilonova]
+        
+        - Use only one place to get the version number
+          [camilonova]
+        
+        - Fixed an issue when a user on django 1.4 logout
+          [camilonova]
+        
+        - Handle exception if there is not user profile model set
+          [camilonova]
+        
+        - Made some cleanup and remove a pokemon exception handling
+          [camilonova]
+        
+        - Improved tests so it really looks for the rabbit in the hole
+          [camilonova]
+        
+        - Match pypi version
+          [camilonova]
+        
+        
+        1.3.1 (2013-03-19)
+        ------------------
+        
+        - Add support for Django 1.5
+          [camilonova]
+        
+        
+        1.3.0 (2013-02-27)
+        ------------------
+        
+        - Bug fix: get_version() format string
+          [csghormley]
+        
+        
+        1.2.9 (2013-02-20)
+        ------------------
+        
+        - Add to and improve test cases
+          [camilonova]
+        
+        
+        1.2.8 (2013-01-23)
+        ------------------
+        
+        - Increased http accept header length
+          [jslatts]
+        
+        
+        1.2.7 (2013-01-17)
+        ------------------
+        
+        - Reverse proxy support
+          [rmagee]
+        
+        - Clean up README
+          [martey]
+        
+        
+        1.2.6 (2012-12-04)
+        ------------------
+        
+        - Remove unused import
+          [aclark4life]
+        
+        
+        1.2.5 (2012-11-28)
+        ------------------
+        
+        - Fix setup.py
+          [aclark4life]
+        
+        - Added ability to flag user accounts as unlockable.
+          [kencochrane]
+        
+        - Added ipaddress as a param to the user_locked_out signal.
+          [kencochrane]
+        
+        - Added a signal receiver for user_logged_out.
+          [kencochrane]
+        
+        - Added a signal for when a user gets locked out.
+          [kencochrane]
+        
+        - Added AccessLog model to log all access attempts.
+          [kencochrane]
+        
+Keywords: authentication django pci security
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Web Environment
+Classifier: Environment :: Plugins
+Classifier: Framework :: Django
+Classifier: Framework :: Django :: 2.2
+Classifier: Framework :: Django :: 3.0
+Classifier: Framework :: Django :: 3.1
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: System Administrators
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Topic :: Internet :: Log Analysis
+Classifier: Topic :: Security
+Classifier: Topic :: System :: Logging
+Requires-Python: ~=3.6

+ 98 - 0
desktop/core/ext-py3/django-axes-5.13.0/README.rst

@@ -0,0 +1,98 @@
+
+django-axes
+===========
+
+.. image:: https://jazzband.co/static/img/badge.svg
+   :target: https://jazzband.co/
+   :alt: Jazzband
+
+.. image:: https://img.shields.io/github/stars/jazzband/django-axes.svg?label=Stars&style=socialcA
+   :target: https://github.com/jazzband/django-axes
+   :alt: GitHub
+
+.. image:: https://img.shields.io/pypi/v/django-axes.svg
+   :target: https://pypi.org/project/django-axes/
+   :alt: PyPI release
+
+.. image:: https://img.shields.io/readthedocs/django-axes.svg
+   :target: https://django-axes.readthedocs.io/
+   :alt: Documentation
+
+.. image:: https://github.com/jazzband/django-axes/workflows/Test/badge.svg
+   :target: https://github.com/jazzband/django-axes/actions
+   :alt: GitHub Actions
+
+.. image:: https://codecov.io/gh/jazzband/django-axes/branch/master/graph/badge.svg
+   :target: https://codecov.io/gh/jazzband/django-axes
+   :alt: Coverage
+
+
+Axes is a Django plugin for keeping track of suspicious
+login attempts for your Django based website
+and implementing simple brute-force attack blocking.
+
+The name is sort of a geeky pun, since it can be interpreted as:
+
+* ``access``, as in monitoring access attempts, or
+* ``axes``, as in tools you can use to hack (generally on wood).
+
+
+Functionality
+-------------
+
+Axes records login attempts to your Django powered site and prevents attackers
+from attempting further logins to your site when they exceed the configured attempt limit.
+
+Axes can track the attempts and persist them in the database indefinitely,
+or alternatively use a fast and DDoS resistant cache implementation.
+
+Axes can be configured to monitor login attempts by
+IP address, username, user agent, or their combinations.
+
+Axes supports cool off periods, IP address whitelisting and blacklisting,
+user account whitelisting, and other features for Django access management.
+
+
+Documentation
+-------------
+
+For more information on installation and configuration see the documentation at:
+
+https://django-axes.readthedocs.io/
+
+
+Issues
+------
+
+If you have questions or have trouble using the app please file a bug report at:
+
+https://github.com/jazzband/django-axes/issues
+
+
+Contributions
+-------------
+
+All contributions are welcome!
+
+It is best to separate proposed changes and PRs into small, distinct patches
+by type so that they can be merged faster into upstream and released quicker.
+
+One way to organize contributions would be to separate PRs for e.g.
+
+* bugfixes,
+* new features,
+* code and design improvements,
+* documentation improvements, or
+* tooling and CI improvements.
+
+Merging contributions requires passing the checks configured
+with the CI. This includes running tests and linters successfully
+on the currently officially supported Python and Django versions.
+
+The test automation is run automatically with GitHub Actions, but you can
+run it locally with the ``tox`` command before pushing commits.
+
+Please note that this is a `Jazzband <https://jazzband.co>`_ project.
+By contributing you agree to abide by the
+`Contributor Code of Conduct <https://jazzband.co/about/conduct>`_
+and follow the `guidelines <https://jazzband.co/about/guidelines>`_.

+ 5 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/__init__.py

@@ -0,0 +1,5 @@
+from pkg_resources import get_distribution
+
+default_app_config = "axes.apps.AppConfig"
+
+__version__ = get_distribution("django-axes").version

+ 83 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/admin.py

@@ -0,0 +1,83 @@
+from django.contrib import admin
+from django.utils.translation import gettext_lazy as _
+
+from axes.conf import settings
+from axes.models import AccessAttempt, AccessLog
+
+
+class AccessAttemptAdmin(admin.ModelAdmin):
+    list_display = (
+        "attempt_time",
+        "ip_address",
+        "user_agent",
+        "username",
+        "path_info",
+        "failures_since_start",
+    )
+
+    list_filter = ["attempt_time", "path_info"]
+
+    search_fields = ["ip_address", "username", "user_agent", "path_info"]
+
+    date_hierarchy = "attempt_time"
+
+    fieldsets = (
+        (None, {"fields": ("path_info", "failures_since_start")}),
+        (_("Form Data"), {"fields": ("get_data", "post_data")}),
+        (_("Meta Data"), {"fields": ("user_agent", "ip_address", "http_accept")}),
+    )
+
+    readonly_fields = [
+        "user_agent",
+        "ip_address",
+        "username",
+        "http_accept",
+        "path_info",
+        "attempt_time",
+        "get_data",
+        "post_data",
+        "failures_since_start",
+    ]
+
+    def has_add_permission(self, request):
+        return False
+
+
+class AccessLogAdmin(admin.ModelAdmin):
+    list_display = (
+        "attempt_time",
+        "logout_time",
+        "ip_address",
+        "username",
+        "user_agent",
+        "path_info",
+    )
+
+    list_filter = ["attempt_time", "logout_time", "path_info"]
+
+    search_fields = ["ip_address", "user_agent", "username", "path_info"]
+
+    date_hierarchy = "attempt_time"
+
+    fieldsets = (
+        (None, {"fields": ("path_info",)}),
+        (_("Meta Data"), {"fields": ("user_agent", "ip_address", "http_accept")}),
+    )
+
+    readonly_fields = [
+        "user_agent",
+        "ip_address",
+        "username",
+        "http_accept",
+        "path_info",
+        "attempt_time",
+        "logout_time",
+    ]
+
+    def has_add_permission(self, request):
+        return False
+
+
+if settings.AXES_ENABLE_ADMIN:
+    admin.site.register(AccessAttempt, AccessAttemptAdmin)
+    admin.site.register(AccessLog, AccessLogAdmin)

+ 48 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/apps.py

@@ -0,0 +1,48 @@
+from logging import getLogger
+
+from django import apps
+from pkg_resources import get_distribution
+
+log = getLogger(__name__)
+
+
+class AppConfig(apps.AppConfig):
+    name = "axes"
+    initialized = False
+
+    @classmethod
+    def initialize(cls):
+        """
+        Initialize Axes logging and show version information.
+
+        This method is re-entrant and can be called multiple times.
+        It displays version information exactly once at application startup.
+        """
+
+        if cls.initialized:
+            return
+        cls.initialized = True
+
+        # Only import settings, checks, and signals one time after Django has been initialized
+        from axes.conf import settings  # noqa
+        from axes import checks, signals  # noqa
+
+        # Skip startup log messages if Axes is not set to verbose
+        if settings.AXES_VERBOSE:
+            log.info("AXES: BEGIN LOG")
+            log.info(
+                "AXES: Using django-axes version %s",
+                get_distribution("django-axes").version,
+            )
+
+            if settings.AXES_ONLY_USER_FAILURES:
+                log.info("AXES: blocking by username only.")
+            elif settings.AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP:
+                log.info("AXES: blocking by combination of username and IP.")
+            elif settings.AXES_LOCK_OUT_BY_USER_OR_IP:
+                log.info("AXES: blocking by username or IP.")
+            else:
+                log.info("AXES: blocking by IP only.")
+
+    def ready(self):
+        self.initialize()

+ 99 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/attempts.py

@@ -0,0 +1,99 @@
+from logging import getLogger
+from typing import List
+
+from django.db.models import QuerySet
+from django.utils.timezone import datetime, now
+
+from axes.conf import settings
+from axes.helpers import get_client_username, get_client_parameters, get_cool_off
+from axes.models import AccessAttempt
+
+log = getLogger(__name__)
+
+
+def get_cool_off_threshold(attempt_time: datetime = None) -> datetime:
+    """
+    Get threshold for fetching access attempts from the database.
+    """
+
+    cool_off = get_cool_off()
+    if cool_off is None:
+        raise TypeError(
+            "Cool off threshold can not be calculated with settings.AXES_COOLOFF_TIME set to None"
+        )
+
+    if attempt_time is None:
+        return now() - cool_off
+    return attempt_time - cool_off
+
+
+def filter_user_attempts(request, credentials: dict = None) -> List[QuerySet]:
+    """
+    Return a list querysets of AccessAttempts that match the given request and credentials.
+    """
+
+    username = get_client_username(request, credentials)
+
+    filter_kwargs_list = get_client_parameters(
+        username, request.axes_ip_address, request.axes_user_agent
+    )
+    attempts_list = [
+        AccessAttempt.objects.filter(**filter_kwargs)
+        for filter_kwargs in filter_kwargs_list
+    ]
+    return attempts_list
+
+
+def get_user_attempts(request, credentials: dict = None) -> List[QuerySet]:
+    """
+    Get list of querysets with valid user attempts that match the given request and credentials.
+    """
+
+    attempts_list = filter_user_attempts(request, credentials)
+
+    if settings.AXES_COOLOFF_TIME is None:
+        log.debug(
+            "AXES: Getting all access attempts from database because no AXES_COOLOFF_TIME is configured"
+        )
+        return attempts_list
+
+    threshold = get_cool_off_threshold(request.axes_attempt_time)
+    log.debug("AXES: Getting access attempts that are newer than %s", threshold)
+    return [attempts.filter(attempt_time__gte=threshold) for attempts in attempts_list]
+
+
+def clean_expired_user_attempts(attempt_time: datetime = None) -> int:
+    """
+    Clean expired user attempts from the database.
+    """
+
+    if settings.AXES_COOLOFF_TIME is None:
+        log.debug(
+            "AXES: Skipping clean for expired access attempts because no AXES_COOLOFF_TIME is configured"
+        )
+        return 0
+
+    threshold = get_cool_off_threshold(attempt_time)
+    count, _ = AccessAttempt.objects.filter(attempt_time__lt=threshold).delete()
+    log.info(
+        "AXES: Cleaned up %s expired access attempts from database that were older than %s",
+        count,
+        threshold,
+    )
+    return count
+
+
+def reset_user_attempts(request, credentials: dict = None) -> int:
+    """
+    Reset all user attempts that match the given request and credentials.
+    """
+
+    attempts_list = filter_user_attempts(request, credentials)
+
+    count = 0
+    for attempts in attempts_list:
+        _count, _ = attempts.delete()
+        count += _count
+    log.info("AXES: Reset %s access attempts from database.", count)
+
+    return count

+ 62 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/backends.py

@@ -0,0 +1,62 @@
+from django.contrib.auth.backends import ModelBackend
+
+from axes.exceptions import (
+    AxesBackendPermissionDenied,
+    AxesBackendRequestParameterRequired,
+)
+from axes.handlers.proxy import AxesProxyHandler
+from axes.helpers import get_credentials, get_lockout_message, toggleable
+
+
+class AxesBackend(ModelBackend):
+    """
+    Authentication backend class that forbids login attempts for locked out users.
+
+    Use this class as the first item of ``AUTHENTICATION_BACKENDS`` to
+    prevent locked out users from being logged in by the Django authentication flow.
+
+    .. note:: This backend does not log your user in. It monitors login attempts.
+              Authentication is handled by the following backends that are configured in ``AUTHENTICATION_BACKENDS``.
+    """
+
+    @toggleable
+    def authenticate(
+        self, request, username: str = None, password: str = None, **kwargs: dict
+    ):
+        """
+        Checks user lockout status and raises an exception if user is not allowed to log in.
+
+        This method interrupts the login flow and inserts  error message directly to the
+        ``response_context`` attribute that is supplied as a keyword argument.
+
+        :keyword response_context: kwarg that will be have its ``error`` attribute updated with context.
+        :raises AxesBackendRequestParameterRequired: if request parameter is not passed.
+        :raises AxesBackendPermissionDenied: if user is already locked out.
+        """
+
+        if request is None:
+            raise AxesBackendRequestParameterRequired(
+                "AxesBackend requires a request as an argument to authenticate"
+            )
+
+        credentials = get_credentials(username=username, password=password, **kwargs)
+
+        if AxesProxyHandler.is_allowed(request, credentials):
+            return
+
+        # Locked out, don't try to authenticate, just update response_context and return.
+        # Its a bit weird to pass a context and expect a response value but its nice to get a "why" back.
+
+        error_msg = get_lockout_message()
+        response_context = kwargs.get("response_context", {})
+        response_context["error"] = error_msg
+
+        # Raise an error that stops the authentication flows at django.contrib.auth.authenticate.
+        # This error stops bubbling up at the authenticate call which catches backend PermissionDenied errors.
+        # After this error is caught by authenticate it emits a signal indicating user login failed,
+        # which is processed by axes.signals.log_user_login_failed which logs and flags the failed request.
+        # The axes.middleware.AxesMiddleware further processes the flagged request into a readable response.
+
+        raise AxesBackendPermissionDenied(
+            "AxesBackend detected that the given user is locked out"
+        )

+ 144 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/checks.py

@@ -0,0 +1,144 @@
+from django.core.checks import (  # pylint: disable=redefined-builtin
+    Tags,
+    Warning,
+    register,
+)
+from django.utils.module_loading import import_string
+
+from axes.backends import AxesBackend
+from axes.conf import settings
+
+
+class Messages:
+    CACHE_INVALID = (
+        "You are using the django-axes cache handler for login attempt tracking."
+        " Your cache configuration is however invalid and will not work correctly with django-axes."
+        " This can leave security holes in your login systems as attempts are not tracked correctly."
+        " Reconfigure settings.AXES_CACHE and settings.CACHES per django-axes configuration documentation."
+    )
+    MIDDLEWARE_INVALID = (
+        "You do not have 'axes.middleware.AxesMiddleware' in your settings.MIDDLEWARE."
+    )
+    BACKEND_INVALID = "You do not have 'axes.backends.AxesBackend' or a subclass in your settings.AUTHENTICATION_BACKENDS."
+    SETTING_DEPRECATED = "You have a deprecated setting {deprecated_setting} configured in your project settings"
+
+
+class Hints:
+    CACHE_INVALID = None
+    MIDDLEWARE_INVALID = None
+    BACKEND_INVALID = (
+        "AxesModelBackend was renamed to AxesBackend in django-axes version 5.0."
+    )
+    SETTING_DEPRECATED = None
+
+
+class Codes:
+    CACHE_INVALID = "axes.W001"
+    MIDDLEWARE_INVALID = "axes.W002"
+    BACKEND_INVALID = "axes.W003"
+    SETTING_DEPRECATED = "axes.W004"
+
+
+@register(Tags.security, Tags.caches, Tags.compatibility)
+def axes_cache_check(app_configs, **kwargs):  # pylint: disable=unused-argument
+    axes_handler = getattr(settings, "AXES_HANDLER", "")
+
+    axes_cache_key = getattr(settings, "AXES_CACHE", "default")
+    axes_cache_config = settings.CACHES.get(axes_cache_key, {})
+    axes_cache_backend = axes_cache_config.get("BACKEND", "")
+
+    axes_cache_backend_incompatible = [
+        "django.core.cache.backends.dummy.DummyCache",
+        "django.core.cache.backends.locmem.LocMemCache",
+        "django.core.cache.backends.filebased.FileBasedCache",
+    ]
+
+    warnings = []
+
+    if axes_handler == "axes.handlers.cache.AxesCacheHandler":
+        if axes_cache_backend in axes_cache_backend_incompatible:
+            warnings.append(
+                Warning(
+                    msg=Messages.CACHE_INVALID,
+                    hint=Hints.CACHE_INVALID,
+                    id=Codes.CACHE_INVALID,
+                )
+            )
+
+    return warnings
+
+
+@register(Tags.security, Tags.compatibility)
+def axes_middleware_check(app_configs, **kwargs):  # pylint: disable=unused-argument
+    warnings = []
+
+    if "axes.middleware.AxesMiddleware" not in settings.MIDDLEWARE:
+        warnings.append(
+            Warning(
+                msg=Messages.MIDDLEWARE_INVALID,
+                hint=Hints.MIDDLEWARE_INVALID,
+                id=Codes.MIDDLEWARE_INVALID,
+            )
+        )
+
+    return warnings
+
+
+@register(Tags.security, Tags.compatibility)
+def axes_backend_check(app_configs, **kwargs):  # pylint: disable=unused-argument
+    warnings = []
+
+    found = False
+    for name in settings.AUTHENTICATION_BACKENDS:
+        try:
+            backend = import_string(name)
+        except ModuleNotFoundError as e:
+            raise ModuleNotFoundError(
+                "Can not find module path defined in settings.AUTHENTICATION_BACKENDS"
+            ) from e
+        except ImportError as e:
+            raise ImportError(
+                "Can not import backend class defined in settings.AUTHENTICATION_BACKENDS"
+            ) from e
+
+        if issubclass(backend, AxesBackend):
+            found = True
+            break
+
+    if not found:
+        warnings.append(
+            Warning(
+                msg=Messages.BACKEND_INVALID,
+                hint=Hints.BACKEND_INVALID,
+                id=Codes.BACKEND_INVALID,
+            )
+        )
+
+    return warnings
+
+
+@register(Tags.compatibility)
+def axes_deprecation_check(app_configs, **kwargs):  # pylint: disable=unused-argument
+    warnings = []
+
+    deprecated_settings = [
+        "AXES_DISABLE_SUCCESS_ACCESS_LOG",
+        "AXES_LOGGER",
+    ]
+
+    for deprecated_setting in deprecated_settings:
+        try:
+            getattr(settings, deprecated_setting)
+            warnings.append(
+                Warning(
+                    msg=Messages.SETTING_DEPRECATED.format(
+                        deprecated_setting=deprecated_setting
+                    ),
+                    hint=None,
+                    id=Codes.SETTING_DEPRECATED,
+                )
+            )
+        except AttributeError:
+            pass
+
+    return warnings

+ 120 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/conf.py

@@ -0,0 +1,120 @@
+from django.conf import settings
+from django.utils.translation import gettext_lazy as _
+
+
+# disable plugin when set to False
+settings.AXES_ENABLED = getattr(settings, "AXES_ENABLED", True)
+
+# see if the user has overridden the failure limit
+settings.AXES_FAILURE_LIMIT = getattr(settings, "AXES_FAILURE_LIMIT", 3)
+
+# see if the user has set axes to lock out logins after failure limit
+settings.AXES_LOCK_OUT_AT_FAILURE = getattr(settings, "AXES_LOCK_OUT_AT_FAILURE", True)
+
+# lock out with the combination of username and IP address
+settings.AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP = getattr(
+    settings, "AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP", False
+)
+
+# lock out with the username or IP address
+settings.AXES_LOCK_OUT_BY_USER_OR_IP = getattr(
+    settings, "AXES_LOCK_OUT_BY_USER_OR_IP", False
+)
+
+# lock out with username and never the IP or user agent
+settings.AXES_ONLY_USER_FAILURES = getattr(settings, "AXES_ONLY_USER_FAILURES", False)
+
+# lock out just for admin site
+settings.AXES_ONLY_ADMIN_SITE = getattr(settings, "AXES_ONLY_ADMIN_SITE", False)
+
+# show Axes logs in admin
+settings.AXES_ENABLE_ADMIN = getattr(settings, "AXES_ENABLE_ADMIN", True)
+
+# lock out with the user agent, has no effect when ONLY_USER_FAILURES is set
+settings.AXES_USE_USER_AGENT = getattr(settings, "AXES_USE_USER_AGENT", False)
+
+# use a specific username field to retrieve from login POST data
+settings.AXES_USERNAME_FORM_FIELD = getattr(
+    settings, "AXES_USERNAME_FORM_FIELD", "username"
+)
+
+# use a specific password field to retrieve from login POST data
+settings.AXES_PASSWORD_FORM_FIELD = getattr(
+    settings, "AXES_PASSWORD_FORM_FIELD", "password"
+)  # noqa
+
+# use a provided callable to transform the POSTed username into the one used in credentials
+settings.AXES_USERNAME_CALLABLE = getattr(settings, "AXES_USERNAME_CALLABLE", None)
+
+# determine if given user should be always allowed to attempt authentication
+settings.AXES_WHITELIST_CALLABLE = getattr(settings, "AXES_WHITELIST_CALLABLE", None)
+
+# return custom lockout response if configured
+settings.AXES_LOCKOUT_CALLABLE = getattr(settings, "AXES_LOCKOUT_CALLABLE", None)
+
+# reset the number of failed attempts after one successful attempt
+settings.AXES_RESET_ON_SUCCESS = getattr(settings, "AXES_RESET_ON_SUCCESS", False)
+
+settings.AXES_DISABLE_ACCESS_LOG = getattr(settings, "AXES_DISABLE_ACCESS_LOG", False)
+
+settings.AXES_HANDLER = getattr(
+    settings, "AXES_HANDLER", "axes.handlers.database.AxesDatabaseHandler"
+)
+
+settings.AXES_LOCKOUT_TEMPLATE = getattr(settings, "AXES_LOCKOUT_TEMPLATE", None)
+
+settings.AXES_LOCKOUT_URL = getattr(settings, "AXES_LOCKOUT_URL", None)
+
+settings.AXES_COOLOFF_TIME = getattr(settings, "AXES_COOLOFF_TIME", None)
+
+settings.AXES_VERBOSE = getattr(settings, "AXES_VERBOSE", True)
+
+# whitelist and blacklist
+settings.AXES_NEVER_LOCKOUT_WHITELIST = getattr(
+    settings, "AXES_NEVER_LOCKOUT_WHITELIST", False
+)
+
+settings.AXES_NEVER_LOCKOUT_GET = getattr(settings, "AXES_NEVER_LOCKOUT_GET", False)
+
+settings.AXES_ONLY_WHITELIST = getattr(settings, "AXES_ONLY_WHITELIST", False)
+
+settings.AXES_IP_WHITELIST = getattr(settings, "AXES_IP_WHITELIST", None)
+
+settings.AXES_IP_BLACKLIST = getattr(settings, "AXES_IP_BLACKLIST", None)
+
+# message to show when locked out and have cooloff enabled
+settings.AXES_COOLOFF_MESSAGE = getattr(
+    settings,
+    "AXES_COOLOFF_MESSAGE",
+    _("Account locked: too many login attempts. Please try again later"),
+)
+
+# message to show when locked out and have cooloff disabled
+settings.AXES_PERMALOCK_MESSAGE = getattr(
+    settings,
+    "AXES_PERMALOCK_MESSAGE",
+    _(
+        "Account locked: too many login attempts. Contact an admin to unlock your account."
+    ),
+)
+
+# if your deployment is using reverse proxies, set this value to 'left-most' or 'right-most' per your configuration
+settings.AXES_PROXY_ORDER = getattr(settings, "AXES_PROXY_ORDER", "left-most")
+
+# if your deployment is using reverse proxies, set this value to the number of proxies in front of Django
+settings.AXES_PROXY_COUNT = getattr(settings, "AXES_PROXY_COUNT", None)
+
+# if your deployment is using reverse proxies, set to your trusted proxy IP addresses prefixes if needed
+settings.AXES_PROXY_TRUSTED_IPS = getattr(settings, "AXES_PROXY_TRUSTED_IPS", None)
+
+# set to the names of request.META attributes that should be checked for the IP address of the client
+# if your deployment is using reverse proxies, ensure that the header attributes are securely set by the proxy
+# ensure that the client can not spoof the headers by setting them and sending them through the proxy
+settings.AXES_META_PRECEDENCE_ORDER = getattr(
+    settings,
+    "AXES_META_PRECEDENCE_ORDER",
+    getattr(settings, "IPWARE_META_PRECEDENCE_ORDER", ("REMOTE_ADDR",)),
+)
+
+# set CORS allowed origins when calling authentication over ajax
+settings.AXES_ALLOWED_CORS_ORIGINS = getattr(settings, "AXES_ALLOWED_CORS_ORIGINS", "*")

+ 26 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/decorators.py

@@ -0,0 +1,26 @@
+from functools import wraps
+
+from axes.handlers.proxy import AxesProxyHandler
+from axes.helpers import get_lockout_response
+
+
+def axes_dispatch(func):
+    @wraps(func)
+    def inner(request, *args, **kwargs):
+        if AxesProxyHandler.is_allowed(request):
+            return func(request, *args, **kwargs)
+
+        return get_lockout_response(request)
+
+    return inner
+
+
+def axes_form_invalid(func):
+    @wraps(func)
+    def inner(self, *args, **kwargs):
+        if AxesProxyHandler.is_allowed(self.request):
+            return func(self, *args, **kwargs)
+
+        return get_lockout_response(self.request)
+
+    return inner

+ 13 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/exceptions.py

@@ -0,0 +1,13 @@
+from django.core.exceptions import PermissionDenied
+
+
+class AxesBackendPermissionDenied(PermissionDenied):
+    """
+    Raised by authentication backend on locked out requests to stop the Django authentication flow.
+    """
+
+
+class AxesBackendRequestParameterRequired(ValueError):
+    """
+    Raised by authentication backend on invalid or missing request parameter value.
+    """

+ 0 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/__init__.py


+ 193 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/base.py

@@ -0,0 +1,193 @@
+import re
+from abc import ABC, abstractmethod
+
+from django.urls import reverse
+from django.urls.exceptions import NoReverseMatch
+
+from axes.conf import settings
+from axes.helpers import (
+    get_failure_limit,
+    is_client_ip_address_blacklisted,
+    is_client_ip_address_whitelisted,
+    is_client_method_whitelisted,
+    is_user_attempt_whitelisted,
+)
+
+
+class AbstractAxesHandler(ABC):
+    """
+    Contract that all handlers need to follow
+    """
+
+    @abstractmethod
+    def user_login_failed(self, sender, credentials: dict, request=None, **kwargs):
+        """
+        Handles the Django ``django.contrib.auth.signals.user_login_failed`` authentication signal.
+        """
+        raise NotImplementedError("user_login_failed should be implemented")
+
+    @abstractmethod
+    def user_logged_in(self, sender, request, user, **kwargs):
+        """
+        Handles the Django ``django.contrib.auth.signals.user_logged_in`` authentication signal.
+        """
+        raise NotImplementedError("user_logged_in should be implemented")
+
+    @abstractmethod
+    def user_logged_out(self, sender, request, user, **kwargs):
+        """
+        Handles the Django ``django.contrib.auth.signals.user_logged_out`` authentication signal.
+        """
+        raise NotImplementedError("user_logged_out should be implemented")
+
+    @abstractmethod
+    def get_failures(self, request, credentials: dict = None) -> int:
+        """
+        Checks the number of failures associated to the given request and credentials.
+
+        This is a virtual method that needs an implementation in the handler subclass
+        if the ``settings.AXES_LOCK_OUT_AT_FAILURE`` flag is set to ``True``.
+        """
+        raise NotImplementedError("get_failures should be implemented")
+
+
+class AxesBaseHandler:  # pylint: disable=unused-argument
+    """
+    Handler API definition for implementations that are used by the ``AxesProxyHandler``.
+
+    If you wish to specialize your own handler class, override the necessary methods
+    and configure the class for use by setting ``settings.AXES_HANDLER = 'module.path.to.YourClass'``.
+    Make sure that new the handler is compliant with AbstractAxesHandler and make sure it extends from this mixin.
+    Refer to `AxesHandler` for an example.
+
+    The default implementation that is actually used by Axes is ``axes.handlers.database.AxesDatabaseHandler``.
+
+    .. note:: This is a virtual class and **can not be used without specialization**.
+    """
+
+    def is_allowed(self, request, credentials: dict = None) -> bool:
+        """
+        Checks if the user is allowed to access or use given functionality such as a login view or authentication.
+
+        This method is abstract and other backends can specialize it as needed, but the default implementation
+        checks if the user has attempted to authenticate into the site too many times through the
+        Django authentication backends and returns ``False`` if user exceeds the configured Axes thresholds.
+
+        This checker can implement arbitrary checks such as IP whitelisting or blacklisting,
+        request frequency checking, failed attempt monitoring or similar functions.
+
+        Please refer to the ``axes.handlers.database.AxesDatabaseHandler`` for the default implementation
+        and inspiration on some common checks and access restrictions before writing your own implementation.
+        """
+
+        if self.is_admin_site(request):
+            return True
+
+        if self.is_blacklisted(request, credentials):
+            return False
+
+        if self.is_whitelisted(request, credentials):
+            return True
+
+        if self.is_locked(request, credentials):
+            return False
+
+        return True
+
+    def is_blacklisted(self, request, credentials: dict = None) -> bool:
+        """
+        Checks if the request or given credentials are blacklisted from access.
+        """
+
+        if is_client_ip_address_blacklisted(request):
+            return True
+
+        return False
+
+    def is_whitelisted(self, request, credentials: dict = None) -> bool:
+        """
+        Checks if the request or given credentials are whitelisted for access.
+        """
+
+        if is_user_attempt_whitelisted(request, credentials):
+            return True
+
+        if is_client_ip_address_whitelisted(request):
+            return True
+
+        if is_client_method_whitelisted(request):
+            return True
+
+        return False
+
+    def is_locked(self, request, credentials: dict = None) -> bool:
+        """
+        Checks if the request or given credentials are locked.
+        """
+
+        if settings.AXES_LOCK_OUT_AT_FAILURE:
+            # get_failures will have to be implemented by each specialized handler
+            return self.get_failures(  # type: ignore
+                request, credentials
+            ) >= get_failure_limit(request, credentials)
+
+        return False
+
+    def is_admin_site(self, request) -> bool:
+        """
+        Checks if the request is for admin site.
+        """
+        if settings.AXES_ONLY_ADMIN_SITE and hasattr(request, "path"):
+            try:
+                admin_url = reverse("admin:index")
+            except NoReverseMatch:
+                return True
+            return not re.match("^%s" % admin_url, request.path)
+
+        return False
+
+    def reset_attempts(
+        self,
+        *,
+        ip_address: str = None,
+        username: str = None,
+        ip_or_username: bool = False,
+    ) -> int:
+        """
+        Resets access attempts that match the given IP address or username.
+
+        This method makes more sense for the DB backend, but as it is used by the ProxyHandler
+        (via inherent), it needs to be defined here so we get compliant with all proxy methods.
+
+        Please overwrite it on each specialized handler as needed.
+        """
+        return 0
+
+    def reset_logs(self, *, age_days: int = None) -> int:
+        """
+        Resets access logs that are older than given number of days.
+
+        This method makes more sense for the DB backend, but as it is used by the ProxyHandler
+        (via inherent), it needs to be defined here so we get compliant with all proxy methods.
+
+        Please overwrite it on each specialized handler as needed.
+        """
+        return 0
+
+
+class AxesHandler(AbstractAxesHandler, AxesBaseHandler):
+    """
+    Signal bare handler implementation without any storage backend.
+    """
+
+    def user_login_failed(self, sender, credentials: dict, request=None, **kwargs):
+        pass
+
+    def user_logged_in(self, sender, request, user, **kwargs):
+        pass
+
+    def user_logged_out(self, sender, request, user, **kwargs):
+        pass
+
+    def get_failures(self, request, credentials: dict = None) -> int:
+        return 0

+ 172 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/cache.py

@@ -0,0 +1,172 @@
+from logging import getLogger
+
+from axes.conf import settings
+from axes.handlers.base import AxesBaseHandler, AbstractAxesHandler
+from axes.helpers import (
+    get_cache,
+    get_cache_timeout,
+    get_client_cache_key,
+    get_client_str,
+    get_client_username,
+    get_credentials,
+    get_failure_limit,
+)
+from axes.models import AccessBase
+from axes.signals import user_locked_out
+
+log = getLogger(__name__)
+
+
+class AxesCacheHandler(AbstractAxesHandler, AxesBaseHandler):
+    """
+    Signal handler implementation that records user login attempts to cache and locks users out if necessary.
+    """
+
+    def __init__(self):
+        self.cache = get_cache()
+        self.cache_timeout = get_cache_timeout()
+
+    def reset_attempts(
+        self,
+        *,
+        ip_address: str = None,
+        username: str = None,
+        ip_or_username: bool = False,
+    ) -> int:
+        cache_keys: list = []
+        count = 0
+
+        if ip_address is None and username is None:
+            raise NotImplementedError("Cannot clear all entries from cache")
+        if ip_or_username:
+            raise NotImplementedError(
+                "Due to the cache key ip_or_username=True is not supported"
+            )
+
+        cache_keys.extend(
+            get_client_cache_key(AccessBase(username=username, ip_address=ip_address))
+        )
+
+        for cache_key in cache_keys:
+            deleted = self.cache.delete(cache_key)
+            count += int(deleted) if deleted is not None else 1
+
+        log.info("AXES: Reset %d access attempts from database.", count)
+
+        return count
+
+    def get_failures(self, request, credentials: dict = None) -> int:
+        cache_keys = get_client_cache_key(request, credentials)
+        failure_count = max(
+            self.cache.get(cache_key, default=0) for cache_key in cache_keys
+        )
+        return failure_count
+
+    def user_login_failed(
+        self, sender, credentials: dict, request=None, **kwargs
+    ):  # pylint: disable=too-many-locals
+        """
+        When user login fails, save attempt record in cache and lock user out if necessary.
+
+        :raises AxesSignalPermissionDenied: if user should be locked out.
+        """
+
+        if request is None:
+            log.error(
+                "AXES: AxesCacheHandler.user_login_failed does not function without a request."
+            )
+            return
+
+        username = get_client_username(request, credentials)
+        if settings.AXES_ONLY_USER_FAILURES and username is None:
+            log.warning(
+                "AXES: Username is None and AXES_ONLY_USER_FAILURES is enable, New record won't be created."
+            )
+            return
+
+        client_str = get_client_str(
+            username,
+            request.axes_ip_address,
+            request.axes_user_agent,
+            request.axes_path_info,
+        )
+
+        if self.is_whitelisted(request, credentials):
+            log.info("AXES: Login failed from whitelisted client %s.", client_str)
+            return
+
+        failures_since_start = 1 + self.get_failures(request, credentials)
+
+        if failures_since_start > 1:
+            log.warning(
+                "AXES: Repeated login failure by %s. Count = %d of %d. Updating existing record in the cache.",
+                client_str,
+                failures_since_start,
+                get_failure_limit(request, credentials),
+            )
+        else:
+            log.warning(
+                "AXES: New login failure by %s. Creating new record in the cache.",
+                client_str,
+            )
+
+        cache_keys = get_client_cache_key(request, credentials)
+        for cache_key in cache_keys:
+            failures = self.cache.get(cache_key, default=0)
+            self.cache.set(cache_key, failures + 1, self.cache_timeout)
+
+        if (
+            settings.AXES_LOCK_OUT_AT_FAILURE
+            and failures_since_start >= get_failure_limit(request, credentials)
+        ):
+            log.warning(
+                "AXES: Locking out %s after repeated login failures.", client_str
+            )
+
+            request.axes_locked_out = True
+            user_locked_out.send(
+                "axes",
+                request=request,
+                username=username,
+                ip_address=request.axes_ip_address,
+            )
+
+    def user_logged_in(
+        self, sender, request, user, **kwargs
+    ):  # pylint: disable=unused-argument
+        """
+        When user logs in, update the AccessLog related to the user.
+        """
+
+        username = user.get_username()
+        credentials = get_credentials(username)
+        client_str = get_client_str(
+            username,
+            request.axes_ip_address,
+            request.axes_user_agent,
+            request.axes_path_info,
+        )
+
+        log.info("AXES: Successful login by %s.", client_str)
+
+        if settings.AXES_RESET_ON_SUCCESS:
+            cache_keys = get_client_cache_key(request, credentials)
+            for cache_key in cache_keys:
+                failures_since_start = self.cache.get(cache_key, default=0)
+                self.cache.delete(cache_key)
+                log.info(
+                    "AXES: Deleted %d failed login attempts by %s from cache.",
+                    failures_since_start,
+                    client_str,
+                )
+
+    def user_logged_out(self, sender, request, user, **kwargs):
+        username = user.get_username() if user else None
+        client_str = get_client_str(
+            username,
+            request.axes_ip_address,
+            request.axes_user_agent,
+            request.axes_path_info,
+        )
+
+        log.info("AXES: Successful logout by %s.", client_str)

+ 272 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/database.py

@@ -0,0 +1,272 @@
+from logging import getLogger
+
+from django.db.models import Sum, Value, Q
+from django.db.models.functions import Concat
+from django.utils import timezone
+
+from axes.attempts import (
+    clean_expired_user_attempts,
+    get_user_attempts,
+    reset_user_attempts,
+)
+from axes.conf import settings
+from axes.handlers.base import AxesBaseHandler, AbstractAxesHandler
+from axes.helpers import (
+    get_client_str,
+    get_client_username,
+    get_credentials,
+    get_failure_limit,
+    get_query_str,
+)
+from axes.models import AccessLog, AccessAttempt
+from axes.signals import user_locked_out
+
+log = getLogger(__name__)
+
+
+class AxesDatabaseHandler(AbstractAxesHandler, AxesBaseHandler):
+    """
+    Signal handler implementation that records user login attempts to database and locks users out if necessary.
+
+    .. note:: The get_user_attempts function is called several time during the authentication and lockout
+              process, caching its output can be dangerous.
+    """
+
+    def reset_attempts(
+        self,
+        *,
+        ip_address: str = None,
+        username: str = None,
+        ip_or_username: bool = False,
+    ) -> int:
+        attempts = AccessAttempt.objects.all()
+
+        if ip_or_username:
+            attempts = attempts.filter(Q(ip_address=ip_address) | Q(username=username))
+        else:
+            if ip_address:
+                attempts = attempts.filter(ip_address=ip_address)
+            if username:
+                attempts = attempts.filter(username=username)
+
+        count, _ = attempts.delete()
+        log.info("AXES: Reset %d access attempts from database.", count)
+
+        return count
+
+    def reset_logs(self, *, age_days: int = None) -> int:
+        if age_days is None:
+            count, _ = AccessLog.objects.all().delete()
+            log.info("AXES: Reset all %d access logs from database.", count)
+        else:
+            limit = timezone.now() - timezone.timedelta(days=age_days)
+            count, _ = AccessLog.objects.filter(attempt_time__lte=limit).delete()
+            log.info(
+                "AXES: Reset %d access logs older than %d days from database.",
+                count,
+                age_days,
+            )
+
+        return count
+
+    def get_failures(self, request, credentials: dict = None) -> int:
+        attempts_list = get_user_attempts(request, credentials)
+        attempt_count = max(
+            (
+                attempts.aggregate(Sum("failures_since_start"))[
+                    "failures_since_start__sum"
+                ]
+                or 0
+            )
+            for attempts in attempts_list
+        )
+        return attempt_count
+
+    def user_login_failed(
+        self, sender, credentials: dict, request=None, **kwargs
+    ):  # pylint: disable=too-many-locals
+        """
+        When user login fails, save AccessAttempt record in database and lock user out if necessary.
+
+        :raises AxesSignalPermissionDenied: if user should be locked out.
+        """
+
+        if request is None:
+            log.error(
+                "AXES: AxesDatabaseHandler.user_login_failed does not function without a request."
+            )
+            return
+
+        # 1. database query: Clean up expired user attempts from the database before logging new attempts
+        clean_expired_user_attempts(request.axes_attempt_time)
+
+        username = get_client_username(request, credentials)
+        client_str = get_client_str(
+            username,
+            request.axes_ip_address,
+            request.axes_user_agent,
+            request.axes_path_info,
+        )
+
+        # This replaces null byte chars that crash saving failures, meaning an attacker doesn't get locked out.
+        get_data = get_query_str(request.GET).replace("\0", "0x00")
+        post_data = get_query_str(request.POST).replace("\0", "0x00")
+
+        if self.is_whitelisted(request, credentials):
+            log.info("AXES: Login failed from whitelisted client %s.", client_str)
+            return
+
+        # 2. database query: Calculate the current maximum failure number from the existing attempts
+        failures_since_start = 1 + self.get_failures(request, credentials)
+
+        # 3. database query: Insert or update access records with the new failure data
+        try:
+            attempt = AccessAttempt.objects.get(
+                username=username,
+                ip_address=request.axes_ip_address,
+                user_agent=request.axes_user_agent,
+            )
+            # Update failed attempt information but do not touch the username, IP address, or user agent fields,
+            # because attackers can request the site with multiple different configurations
+            # in order to bypass the defense mechanisms that are used by the site.
+
+            log.warning(
+                "AXES: Repeated login failure by %s. Count = %d of %d. Updating existing record in the database.",
+                client_str,
+                attempt.failures_since_start,
+                get_failure_limit(request, credentials),
+            )
+
+            separator = "\n---------\n"
+
+            attempt.get_data = Concat("get_data", Value(separator + get_data))
+            attempt.post_data = Concat("post_data", Value(separator + post_data))
+            attempt.http_accept = request.axes_http_accept
+            attempt.path_info = request.axes_path_info
+            attempt.failures_since_start += 1
+            attempt.attempt_time = request.axes_attempt_time
+            attempt.save()
+        except AccessAttempt.DoesNotExist:
+            # Record failed attempt with all the relevant information.
+            # Filtering based on username, IP address and user agent handled elsewhere,
+            # and this handler just records the available information for further use.
+
+            if not (settings.AXES_ONLY_USER_FAILURES and username is None):
+                log.warning(
+                    "AXES: New login failure by %s. Creating new record in the database.",
+                    client_str,
+                )
+                AccessAttempt.objects.create(
+                    username=username,
+                    ip_address=request.axes_ip_address,
+                    user_agent=request.axes_user_agent,
+                    get_data=get_data,
+                    post_data=post_data,
+                    http_accept=request.axes_http_accept,
+                    path_info=request.axes_path_info,
+                    failures_since_start=1,
+                    attempt_time=request.axes_attempt_time,
+                )
+            else:
+                log.warning(
+                    "AXES: Username is None and AXES_ONLY_USER_FAILURES is enable, New record won't be created."
+                )
+        if (
+            settings.AXES_LOCK_OUT_AT_FAILURE
+            and failures_since_start >= get_failure_limit(request, credentials)
+        ):
+            log.warning(
+                "AXES: Locking out %s after repeated login failures.", client_str
+            )
+
+            request.axes_locked_out = True
+
+            user_locked_out.send(
+                "axes",
+                request=request,
+                username=username,
+                ip_address=request.axes_ip_address,
+            )
+
+    def user_logged_in(
+        self, sender, request, user, **kwargs
+    ):  # pylint: disable=unused-argument
+        """
+        When user logs in, update the AccessLog related to the user.
+        """
+
+        # 1. database query: Clean up expired user attempts from the database
+        clean_expired_user_attempts(request.axes_attempt_time)
+
+        username = user.get_username()
+        credentials = get_credentials(username)
+        client_str = get_client_str(
+            username,
+            request.axes_ip_address,
+            request.axes_user_agent,
+            request.axes_path_info,
+        )
+
+        log.info("AXES: Successful login by %s.", client_str)
+
+        if not settings.AXES_DISABLE_ACCESS_LOG:
+            # 2. database query: Insert new access logs with login time
+            AccessLog.objects.create(
+                username=username,
+                ip_address=request.axes_ip_address,
+                user_agent=request.axes_user_agent,
+                http_accept=request.axes_http_accept,
+                path_info=request.axes_path_info,
+                attempt_time=request.axes_attempt_time,
+            )
+
+        if settings.AXES_RESET_ON_SUCCESS:
+            # 3. database query: Reset failed attempts for the logging in user
+            count = reset_user_attempts(request, credentials)
+            log.info(
+                "AXES: Deleted %d failed login attempts by %s from database.",
+                count,
+                client_str,
+            )
+
+    def user_logged_out(
+        self, sender, request, user, **kwargs
+    ):  # pylint: disable=unused-argument
+        """
+        When user logs out, update the AccessLog related to the user.
+        """
+
+        # 1. database query: Clean up expired user attempts from the database
+        clean_expired_user_attempts(request.axes_attempt_time)
+
+        username = user.get_username() if user else None
+        client_str = get_client_str(
+            username,
+            request.axes_ip_address,
+            request.axes_user_agent,
+            request.axes_path_info,
+        )
+
+        log.info("AXES: Successful logout by %s.", client_str)
+
+        if username and not settings.AXES_DISABLE_ACCESS_LOG:
+            # 2. database query: Update existing attempt logs with logout time
+            AccessLog.objects.filter(
+                username=username, logout_time__isnull=True
+            ).update(logout_time=request.axes_attempt_time)
+
+    def post_save_access_attempt(self, instance, **kwargs):
+        """
+        Handles the ``axes.models.AccessAttempt`` object post save signal.
+
+        When needed, all post_save actions for this backend should be located
+        here.
+        """
+
+    def post_delete_access_attempt(self, instance, **kwargs):
+        """
+        Handles the ``axes.models.AccessAttempt`` object post delete signal.
+
+        When needed, all post_delete actions for this backend should be located
+        here.
+        """

+ 22 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/dummy.py

@@ -0,0 +1,22 @@
+from axes.handlers.base import AxesBaseHandler, AbstractAxesHandler
+
+
+class AxesDummyHandler(AbstractAxesHandler, AxesBaseHandler):
+    """
+    Signal handler implementation that does nothing and can be used to disable signal processing.
+    """
+
+    def is_allowed(self, request, credentials: dict = None) -> bool:
+        return True
+
+    def user_login_failed(self, sender, credentials: dict, request=None, **kwargs):
+        pass
+
+    def user_logged_in(self, sender, request, user, **kwargs):
+        pass
+
+    def user_logged_out(self, sender, request, user, **kwargs):
+        pass
+
+    def get_failures(self, request, credentials: dict = None) -> int:
+        return 0

+ 124 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/proxy.py

@@ -0,0 +1,124 @@
+from logging import getLogger
+
+from django.utils.module_loading import import_string
+from django.utils.timezone import now
+
+from axes.conf import settings
+from axes.handlers.base import AxesBaseHandler, AbstractAxesHandler, AxesHandler
+from axes.helpers import (
+    get_client_ip_address,
+    get_client_user_agent,
+    get_client_path_info,
+    get_client_http_accept,
+    toggleable,
+)
+
+log = getLogger(__name__)
+
+
+class AxesProxyHandler(AbstractAxesHandler, AxesBaseHandler):
+    """
+    Proxy interface for configurable Axes signal handler class.
+
+    If you wish to implement a custom version of this handler,
+    you can override the settings.AXES_HANDLER configuration string
+    with a class that implements a compatible interface and methods.
+
+    Defaults to using axes.handlers.proxy.AxesProxyHandler if not overridden.
+    Refer to axes.handlers.proxy.AxesProxyHandler for default implementation.
+    """
+
+    implementation = None  # type: AxesHandler
+
+    @classmethod
+    def get_implementation(cls, force: bool = False) -> AxesHandler:
+        """
+        Fetch and initialize configured handler implementation and memoize it to avoid reinitialization.
+
+        This method is re-entrant and can be called multiple times from e.g. Django application loader.
+        """
+
+        if force or not cls.implementation:
+            cls.implementation = import_string(settings.AXES_HANDLER)()
+        return cls.implementation
+
+    @classmethod
+    def reset_attempts(
+        cls,
+        *,
+        ip_address: str = None,
+        username: str = None,
+        ip_or_username: bool = False,
+    ) -> int:
+        return cls.get_implementation().reset_attempts(
+            ip_address=ip_address, username=username, ip_or_username=ip_or_username
+        )
+
+    @classmethod
+    def reset_logs(cls, *, age_days: int = None) -> int:
+        return cls.get_implementation().reset_logs(age_days=age_days)
+
+    @staticmethod
+    def update_request(request):
+        """
+        Update request attributes before passing them into the selected handler class.
+        """
+
+        if request is None:
+            log.error(
+                "AXES: AxesProxyHandler.update_request can not set request attributes to a None request"
+            )
+            return
+        if not hasattr(request, "axes_updated"):
+            request.axes_locked_out = False
+            request.axes_attempt_time = now()
+            request.axes_ip_address = get_client_ip_address(request)
+            request.axes_user_agent = get_client_user_agent(request)
+            request.axes_path_info = get_client_path_info(request)
+            request.axes_http_accept = get_client_http_accept(request)
+            request.axes_updated = True
+
+    @classmethod
+    def is_locked(cls, request, credentials: dict = None) -> bool:
+        cls.update_request(request)
+        return cls.get_implementation().is_locked(request, credentials)
+
+    @classmethod
+    def is_allowed(cls, request, credentials: dict = None) -> bool:
+        cls.update_request(request)
+        return cls.get_implementation().is_allowed(request, credentials)
+
+    @classmethod
+    def get_failures(cls, request, credentials: dict = None) -> int:
+        cls.update_request(request)
+        return cls.get_implementation().get_failures(request, credentials)
+
+    @classmethod
+    @toggleable
+    def user_login_failed(cls, sender, credentials: dict, request=None, **kwargs):
+        cls.update_request(request)
+        return cls.get_implementation().user_login_failed(
+            sender, credentials, request, **kwargs
+        )
+
+    @classmethod
+    @toggleable
+    def user_logged_in(cls, sender, request, user, **kwargs):
+        cls.update_request(request)
+        return cls.get_implementation().user_logged_in(sender, request, user, **kwargs)
+
+    @classmethod
+    @toggleable
+    def user_logged_out(cls, sender, request, user, **kwargs):
+        cls.update_request(request)
+        return cls.get_implementation().user_logged_out(sender, request, user, **kwargs)
+
+    @classmethod
+    @toggleable
+    def post_save_access_attempt(cls, instance, **kwargs):
+        return cls.get_implementation().post_save_access_attempt(instance, **kwargs)
+
+    @classmethod
+    @toggleable
+    def post_delete_access_attempt(cls, instance, **kwargs):
+        return cls.get_implementation().post_delete_access_attempt(instance, **kwargs)

+ 25 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/handlers/test.py

@@ -0,0 +1,25 @@
+from axes.handlers.base import AxesHandler
+
+
+class AxesTestHandler(AxesHandler):  # pylint: disable=unused-argument
+    """
+    Signal handler implementation that does nothing, ideal for a test suite.
+    """
+
+    def reset_attempts(
+        self,
+        *,
+        ip_address: str = None,
+        username: str = None,
+        ip_or_username: bool = False,
+    ) -> int:
+        return 0
+
+    def reset_logs(self, *, age_days: int = None) -> int:
+        return 0
+
+    def is_allowed(self, request, credentials: dict = None) -> bool:
+        return True
+
+    def get_failures(self, request, credentials: dict = None) -> int:
+        return 0

+ 478 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/helpers.py

@@ -0,0 +1,478 @@
+from datetime import timedelta
+from hashlib import md5
+from logging import getLogger
+from string import Template
+from typing import Callable, Optional, Type, Union
+from urllib.parse import urlencode
+
+import ipware.ip
+from django.core.cache import caches, BaseCache
+from django.http import HttpRequest, HttpResponse, JsonResponse, QueryDict
+from django.shortcuts import render, redirect
+from django.utils.module_loading import import_string
+
+from axes.conf import settings
+from axes.models import AccessBase
+
+log = getLogger(__name__)
+
+
+def get_cache() -> BaseCache:
+    """
+    Get the cache instance Axes is configured to use with ``settings.AXES_CACHE`` and use ``'default'`` if not set.
+    """
+
+    return caches[getattr(settings, "AXES_CACHE", "default")]
+
+
+def get_cache_timeout() -> Optional[int]:
+    """
+    Return the cache timeout interpreted from settings.AXES_COOLOFF_TIME.
+
+    The cache timeout can be either None if not configured or integer of seconds if configured.
+
+    Notice that the settings.AXES_COOLOFF_TIME can be None, timedelta, integer, callable, or str path,
+    and this function offers a unified _integer or None_ representation of that configuration
+    for use with the Django cache backends.
+    """
+
+    cool_off = get_cool_off()
+    if cool_off is None:
+        return None
+    return int(cool_off.total_seconds())
+
+
+def get_cool_off() -> Optional[timedelta]:
+    """
+    Return the login cool off time interpreted from settings.AXES_COOLOFF_TIME.
+
+    The return value is either None or timedelta.
+
+    Notice that the settings.AXES_COOLOFF_TIME is either None, timedelta, or integer of hours,
+    and this function offers a unified _timedelta or None_ representation of that configuration
+    for use with the Axes internal implementations.
+
+    :exception TypeError: if settings.AXES_COOLOFF_TIME is of wrong type.
+    """
+
+    cool_off = settings.AXES_COOLOFF_TIME
+
+    if isinstance(cool_off, int):
+        return timedelta(hours=cool_off)
+    if isinstance(cool_off, str):
+        return import_string(cool_off)()
+    if callable(cool_off):
+        return cool_off()
+
+    return cool_off
+
+
+def get_cool_off_iso8601(delta: timedelta) -> str:
+    """
+    Return datetime.timedelta translated to ISO 8601 formatted duration for use in e.g. cool offs.
+    """
+
+    seconds = delta.total_seconds()
+    minutes, seconds = divmod(seconds, 60)
+    hours, minutes = divmod(minutes, 60)
+    days, hours = divmod(hours, 24)
+
+    days_str = f"{days:.0f}D" if days else ""
+
+    time_str = "".join(
+        f"{value:.0f}{designator}"
+        for value, designator in [[hours, "H"], [minutes, "M"], [seconds, "S"]]
+        if value
+    )
+
+    if time_str:
+        return f"P{days_str}T{time_str}"
+    return f"P{days_str}"
+
+
+def get_credentials(username: str = None, **kwargs) -> dict:
+    """
+    Calculate credentials for Axes to use internally from given username and kwargs.
+
+    Axes will set the username value into the key defined with ``settings.AXES_USERNAME_FORM_FIELD``
+    and update the credentials dictionary with the kwargs given on top of that.
+    """
+
+    credentials = {settings.AXES_USERNAME_FORM_FIELD: username}
+    credentials.update(kwargs)
+    return credentials
+
+
+def get_client_username(request, credentials: dict = None) -> str:
+    """
+    Resolve client username from the given request or credentials if supplied.
+
+    The order of preference for fetching the username is as follows:
+
+    1. If configured, use ``AXES_USERNAME_CALLABLE``, and supply ``request, credentials`` as arguments
+    2. If given, use ``credentials`` and fetch username from ``AXES_USERNAME_FORM_FIELD`` (defaults to ``username``)
+    3. Use request.POST and fetch username from ``AXES_USERNAME_FORM_FIELD`` (defaults to ``username``)
+
+    :param request: incoming Django ``HttpRequest`` or similar object from authentication backend or other source
+    :param credentials: incoming credentials ``dict`` or similar object from authentication backend or other source
+    """
+
+    if settings.AXES_USERNAME_CALLABLE:
+        log.debug("Using settings.AXES_USERNAME_CALLABLE to get username")
+
+        if callable(settings.AXES_USERNAME_CALLABLE):
+            return settings.AXES_USERNAME_CALLABLE(request, credentials)
+        if isinstance(settings.AXES_USERNAME_CALLABLE, str):
+            return import_string(settings.AXES_USERNAME_CALLABLE)(request, credentials)
+        raise TypeError(
+            "settings.AXES_USERNAME_CALLABLE needs to be a string, callable, or None."
+        )
+
+    if credentials:
+        log.debug(
+            "Using parameter credentials to get username with key settings.AXES_USERNAME_FORM_FIELD"
+        )
+        return credentials.get(settings.AXES_USERNAME_FORM_FIELD, None)
+
+    log.debug(
+        "Using parameter request.POST to get username with key settings.AXES_USERNAME_FORM_FIELD"
+    )
+
+    request_data = getattr(request, "data", request.POST)
+    return request_data.get(settings.AXES_USERNAME_FORM_FIELD, None)
+
+
+def get_client_ip_address(request) -> str:
+    """
+    Get client IP address as configured by the user.
+
+    The django-ipware package is used for address resolution
+    and parameters can be configured in the Axes package.
+    """
+
+    client_ip_address, _ = ipware.ip.get_client_ip(
+        request,
+        proxy_order=settings.AXES_PROXY_ORDER,
+        proxy_count=settings.AXES_PROXY_COUNT,
+        proxy_trusted_ips=settings.AXES_PROXY_TRUSTED_IPS,
+        request_header_order=settings.AXES_META_PRECEDENCE_ORDER,
+    )
+
+    return client_ip_address
+
+
+def get_client_user_agent(request) -> str:
+    return request.META.get("HTTP_USER_AGENT", "<unknown>")[:255]
+
+
+def get_client_path_info(request) -> str:
+    return request.META.get("PATH_INFO", "<unknown>")[:255]
+
+
+def get_client_http_accept(request) -> str:
+    return request.META.get("HTTP_ACCEPT", "<unknown>")[:1025]
+
+
+def get_client_parameters(username: str, ip_address: str, user_agent: str) -> list:
+    """
+    Get query parameters for filtering AccessAttempt queryset.
+
+    This method returns a dict that guarantees iteration order for keys and values,
+    and can so be used in e.g. the generation of hash keys or other deterministic functions.
+
+    Returns list of dict, every item of list are separate parameters
+    """
+
+    if settings.AXES_ONLY_USER_FAILURES:
+        # 1. Only individual usernames can be tracked with parametrization
+        filter_query = [{"username": username}]
+    else:
+        if settings.AXES_LOCK_OUT_BY_USER_OR_IP:
+            # One of `username` or `IP address` is used
+            filter_query = [{"username": username}, {"ip_address": ip_address}]
+        elif settings.AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP:
+            # 2. A combination of username and IP address can be used as well
+            filter_query = [{"username": username, "ip_address": ip_address}]
+        else:
+            # 3. Default case is to track the IP address only, which is the most secure option
+            filter_query = [{"ip_address": ip_address}]
+
+        if settings.AXES_USE_USER_AGENT:
+            # 4. The HTTP User-Agent can be used to track e.g. one browser
+            filter_query.append({"user_agent": user_agent})
+
+    return filter_query
+
+
+def make_cache_key_list(filter_kwargs_list):
+    cache_keys = []
+    for filter_kwargs in filter_kwargs_list:
+        cache_key_components = "".join(
+            value for value in filter_kwargs.values() if value
+        )
+        cache_key_digest = md5(cache_key_components.encode()).hexdigest()
+        cache_keys.append(f"axes-{cache_key_digest}")
+    return cache_keys
+
+
+def get_client_cache_key(
+    request_or_attempt: Union[HttpRequest, AccessBase], credentials: dict = None
+) -> str:
+    """
+    Build cache key name from request or AccessAttempt object.
+
+    :param request_or_attempt: HttpRequest or AccessAttempt object
+    :param credentials: credentials containing user information
+    :return cache_key: Hash key that is usable for Django cache backends
+    """
+
+    if isinstance(request_or_attempt, AccessBase):
+        username = request_or_attempt.username
+        ip_address = request_or_attempt.ip_address
+        user_agent = request_or_attempt.user_agent
+    else:
+        username = get_client_username(request_or_attempt, credentials)
+        ip_address = get_client_ip_address(request_or_attempt)
+        user_agent = get_client_user_agent(request_or_attempt)
+
+    filter_kwargs_list = get_client_parameters(username, ip_address, user_agent)
+
+    return make_cache_key_list(filter_kwargs_list)
+
+
+def get_client_str(
+    username: str, ip_address: str, user_agent: str, path_info: str
+) -> str:
+    """
+    Get a readable string that can be used in e.g. logging to distinguish client requests.
+
+    Example log format would be
+    ``{username: "example", ip_address: "127.0.0.1", path_info: "/example/"}``
+    """
+
+    client_dict = dict()
+
+    if settings.AXES_VERBOSE:
+        # Verbose mode logs every attribute that is available
+        client_dict["username"] = username
+        client_dict["ip_address"] = ip_address
+        client_dict["user_agent"] = user_agent
+    else:
+        # Other modes initialize the attributes that are used for the actual lockouts
+        client_list = get_client_parameters(username, ip_address, user_agent)
+        client_dict = {}
+        for client in client_list:
+            client_dict.update(client)
+
+    # Path info is always included as last component in the client string for traceability purposes
+    if path_info and isinstance(path_info, (tuple, list)):
+        path_info = path_info[0]
+    client_dict["path_info"] = path_info
+
+    # Template the internal dictionary representation into a readable and concatenated {key: "value"} format
+    template = Template('$key: "$value"')
+    items = [{"key": k, "value": v} for k, v in client_dict.items()]
+    client_str = ", ".join(template.substitute(item) for item in items)
+    client_str = "{" + client_str + "}"
+    return client_str
+
+
+def get_query_str(query: Type[QueryDict], max_length: int = 1024) -> str:
+    """
+    Turns a query dictionary into an easy-to-read list of key-value pairs.
+
+    If a field is called either ``'password'`` or ``settings.AXES_PASSWORD_FORM_FIELD`` it will be excluded.
+
+    The length of the output is limited to max_length to avoid a DoS attack via excessively large payloads.
+    """
+
+    query_dict = query.copy()
+    query_dict.pop("password", None)
+    query_dict.pop(settings.AXES_PASSWORD_FORM_FIELD, None)
+
+    template = Template("$key=$value")
+    items = [{"key": k, "value": v} for k, v in query_dict.items()]
+    query_str = "\n".join(template.substitute(item) for item in items)
+
+    return query_str[:max_length]
+
+
+def get_failure_limit(request, credentials) -> int:
+    if callable(settings.AXES_FAILURE_LIMIT):
+        return settings.AXES_FAILURE_LIMIT(request, credentials)
+    if isinstance(settings.AXES_FAILURE_LIMIT, str):
+        return import_string(settings.AXES_FAILURE_LIMIT)(request, credentials)
+    if isinstance(settings.AXES_FAILURE_LIMIT, int):
+        return settings.AXES_FAILURE_LIMIT
+    raise TypeError("settings.AXES_FAILURE_LIMIT needs to be a callable or an integer")
+
+
+def get_lockout_message() -> str:
+    if settings.AXES_COOLOFF_TIME:
+        return settings.AXES_COOLOFF_MESSAGE
+    return settings.AXES_PERMALOCK_MESSAGE
+
+
+def get_lockout_response(request, credentials: dict = None) -> HttpResponse:
+    if settings.AXES_LOCKOUT_CALLABLE:
+        if callable(settings.AXES_LOCKOUT_CALLABLE):
+            return settings.AXES_LOCKOUT_CALLABLE(request, credentials)
+        if isinstance(settings.AXES_LOCKOUT_CALLABLE, str):
+            return import_string(settings.AXES_LOCKOUT_CALLABLE)(request, credentials)
+        raise TypeError(
+            "settings.AXES_LOCKOUT_CALLABLE needs to be a string, callable, or None."
+        )
+
+    status = 403
+    context = {
+        "failure_limit": get_failure_limit(request, credentials),
+        "username": get_client_username(request, credentials) or "",
+    }
+
+    cool_off = get_cool_off()
+    if cool_off:
+        context.update(
+            {
+                "cooloff_time": get_cool_off_iso8601(
+                    cool_off
+                ),  # differing old name is kept for backwards compatibility
+                "cooloff_timedelta": cool_off,
+            }
+        )
+
+    if request.META.get("HTTP_X_REQUESTED_WITH") == "XMLHttpRequest":
+        json_response = JsonResponse(context, status=status)
+        json_response[
+            "Access-Control-Allow-Origin"
+        ] = settings.AXES_ALLOWED_CORS_ORIGINS
+        json_response["Access-Control-Allow-Methods"] = "POST, OPTIONS"
+        json_response[
+            "Access-Control-Allow-Headers"
+        ] = "Origin, Content-Type, Accept, Authorization, x-requested-with"
+        return json_response
+
+    if settings.AXES_LOCKOUT_TEMPLATE:
+        return render(request, settings.AXES_LOCKOUT_TEMPLATE, context, status=status)
+
+    if settings.AXES_LOCKOUT_URL:
+        lockout_url = settings.AXES_LOCKOUT_URL
+        query_string = urlencode({"username": context["username"]})
+        url = "{}?{}".format(lockout_url, query_string)
+        return redirect(url)
+
+    return HttpResponse(get_lockout_message(), status=status)
+
+
+def is_ip_address_in_whitelist(ip_address: str) -> bool:
+    if not settings.AXES_IP_WHITELIST:
+        return False
+
+    return ip_address in settings.AXES_IP_WHITELIST
+
+
+def is_ip_address_in_blacklist(ip_address: str) -> bool:
+    if not settings.AXES_IP_BLACKLIST:
+        return False
+
+    return ip_address in settings.AXES_IP_BLACKLIST
+
+
+def is_client_ip_address_whitelisted(request):
+    """
+    Check if the given request refers to a whitelisted IP.
+    """
+
+    if settings.AXES_NEVER_LOCKOUT_WHITELIST and is_ip_address_in_whitelist(
+        request.axes_ip_address
+    ):
+        return True
+
+    if settings.AXES_ONLY_WHITELIST and is_ip_address_in_whitelist(
+        request.axes_ip_address
+    ):
+        return True
+
+    return False
+
+
+def is_client_ip_address_blacklisted(request) -> bool:
+    """
+    Check if the given request refers to a blacklisted IP.
+    """
+
+    if is_ip_address_in_blacklist(request.axes_ip_address):
+        return True
+
+    if settings.AXES_ONLY_WHITELIST and not is_ip_address_in_whitelist(
+        request.axes_ip_address
+    ):
+        return True
+
+    return False
+
+
+def is_client_method_whitelisted(request) -> bool:
+    """
+    Check if the given request uses a whitelisted method.
+    """
+
+    if settings.AXES_NEVER_LOCKOUT_GET and request.method == "GET":
+        return True
+
+    return False
+
+
+def is_user_attempt_whitelisted(request, credentials: dict = None) -> bool:
+    """
+    Check if the given request or credentials refer to a whitelisted username.
+
+    This method invokes the ``settings.AXES_WHITELIST`` callable
+    with ``request`` and ``credentials`` arguments.
+
+    This function could use the following implementation for checking
+    the lockout flags from a specific property in the user object:
+
+    .. code-block: python
+
+       username_value = get_client_username(request, credentials)
+       username_field = getattr(
+           get_user_model(),
+           "USERNAME_FIELD",
+           "username"
+       )
+       kwargs = {username_field: username_value}
+
+       user_model = get_user_model()
+       user = user_model.objects.get(**kwargs)
+       return user.nolockout
+    """
+
+    whitelist_callable = settings.AXES_WHITELIST_CALLABLE
+    if whitelist_callable is None:
+        return False
+    if callable(whitelist_callable):
+        return whitelist_callable(request, credentials)
+    if isinstance(whitelist_callable, str):
+        return import_string(whitelist_callable)(request, credentials)
+
+    raise TypeError(
+        "settings.AXES_WHITELIST_CALLABLE needs to be a string, callable, or None."
+    )
+
+
+def toggleable(func) -> Callable:
+    """
+    Decorator that toggles function execution based on settings.
+
+    If the ``settings.AXES_ENABLED`` flag is set to ``False``
+    the decorated function never runs and a None is returned.
+
+    This decorator is only suitable for functions that do not
+    require return values to be passed back to callers.
+    """
+
+    def inner(*args, **kwargs):  # pylint: disable=inconsistent-return-statements
+        if settings.AXES_ENABLED:
+            return func(*args, **kwargs)
+
+    return inner

BIN
desktop/core/ext-py3/django-axes-5.13.0/axes/locale/de/LC_MESSAGES/django.mo


+ 97 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/locale/de/LC_MESSAGES/django.po

@@ -0,0 +1,97 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-07-17 15:56+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: axes/admin.py:38
+msgid "Form Data"
+msgstr "Form-Daten"
+
+#: axes/admin.py:41 axes/admin.py:95
+msgid "Meta Data"
+msgstr "Meta-Daten"
+
+#: axes/conf.py:58
+msgid "Account locked: too many login attempts. Please try again later"
+msgstr ""
+"Zugang gesperrt: zu viele fehlgeschlagene Anmeldeversuche. Bitte versuchen "
+"Sie es später erneut."
+
+#: axes/conf.py:61
+msgid ""
+"Account locked: too many login attempts. Contact an admin to unlock your "
+"account."
+msgstr ""
+"Zugang gesperrt: zu viele fehlgeschlagene Anmeldeversuche. Kontaktieren Sie "
+"einen Administrator, um Ihren Zugang zu entsperren."
+
+#: axes/models.py:9
+msgid "User Agent"
+msgstr "Browserkennung"
+
+#: axes/models.py:15
+msgid "IP Address"
+msgstr "IP-Adresse"
+
+#: axes/models.py:21
+msgid "Username"
+msgstr "Benutzername"
+
+#: axes/models.py:35
+msgid "HTTP Accept"
+msgstr ""
+
+#: axes/models.py:40
+msgid "Path"
+msgstr "Pfad"
+
+#: axes/models.py:45
+msgid "Attempt Time"
+msgstr "Zugriffszeitpunkt"
+
+#: axes/models.py:57
+msgid "GET Data"
+msgstr "GET-Daten"
+
+#: axes/models.py:61
+msgid "POST Data"
+msgstr "POST-Daten"
+
+#: axes/models.py:65
+msgid "Failed Logins"
+msgstr "Fehlgeschlagene Anmeldeversuche"
+
+#: axes/models.py:76
+msgid "access attempt"
+msgstr "Zugriffsversuch"
+
+#: axes/models.py:77
+msgid "access attempts"
+msgstr "Zugriffsversuche"
+
+#: axes/models.py:81
+msgid "Logout Time"
+msgstr "Abmeldezeitpunkt"
+
+#: axes/models.py:90
+msgid "access log"
+msgstr "Zugriffslog"
+
+#: axes/models.py:91
+msgid "access logs"
+msgstr "Zugriffslogs"

BIN
desktop/core/ext-py3/django-axes-5.13.0/axes/locale/ru/LC_MESSAGES/django.mo


+ 97 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/locale/ru/LC_MESSAGES/django.po

@@ -0,0 +1,97 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-01-11 12:20+0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: axes/admin.py:38
+msgid "Form Data"
+msgstr "Данные формы"
+
+#: axes/admin.py:41 axes/admin.py:95
+msgid "Meta Data"
+msgstr "Метаданные"
+
+#: axes/conf.py:58
+msgid "Account locked: too many login attempts. Please try again later"
+msgstr ""
+"Учетная запись заблокирована: слишком много попыток входа. "
+"Повторите попытку позже."
+
+#: axes/conf.py:61
+msgid ""
+"Account locked: too many login attempts. Contact an admin to unlock your "
+"account."
+msgstr ""
+"Учетная запись заблокирована: слишком много попыток входа. "
+"Обратитесь к администратору для разблокирования учетной записи."
+
+#: axes/models.py:9
+msgid "User Agent"
+msgstr "Браузер пользователя"
+
+#: axes/models.py:15
+msgid "IP Address"
+msgstr "Адрес IP"
+
+#: axes/models.py:21
+msgid "Username"
+msgstr "Пользователь"
+
+#: axes/models.py:35
+msgid "HTTP Accept"
+msgstr "Запрос HTTP"
+
+#: axes/models.py:40
+msgid "Path"
+msgstr "Путь"
+
+#: axes/models.py:45
+msgid "Attempt Time"
+msgstr "Время входа"
+
+#: axes/models.py:57
+msgid "GET Data"
+msgstr "Данные GET-запроса"
+
+#: axes/models.py:61
+msgid "POST Data"
+msgstr "Данные POST-запроса"
+
+#: axes/models.py:65
+msgid "Failed Logins"
+msgstr "Ошибочные попытки"
+
+#: axes/models.py:76
+msgid "access attempt"
+msgstr "Запись о попытке доступа"
+
+#: axes/models.py:77
+msgid "access attempts"
+msgstr "Попытки доступа"
+
+#: axes/models.py:81
+msgid "Logout Time"
+msgstr "Время выхода"
+
+#: axes/models.py:90
+msgid "access log"
+msgstr "Запись о доступе"
+
+#: axes/models.py:91
+msgid "access logs"
+msgstr "Логи доступа"

BIN
desktop/core/ext-py3/django-axes-5.13.0/axes/locale/tr/LC_MESSAGES/django.mo


+ 96 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/locale/tr/LC_MESSAGES/django.po

@@ -0,0 +1,96 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-07-17 15:56+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: axes/admin.py:38
+msgid "Form Data"
+msgstr "Form-Verisi"
+
+#: axes/admin.py:41 axes/admin.py:95
+msgid "Meta Data"
+msgstr "Meta-Verisi"
+
+#: axes/conf.py:58
+msgid "Account locked: too many login attempts. Please try again later"
+msgstr ""
+"Hesap kilitlendi: cok fazla erişim denemesi. Lütfen daha sonra tekrar deneyiniz"
+
+#: axes/conf.py:61
+msgid ""
+"Account locked: too many login attempts. Contact an admin to unlock your "
+"account."
+msgstr ""
+"Hesap kilitlendi: cok fazla erişim denemesi. Hesabını açtırmak için yöneticiyle iletişime"
+"geçin"
+
+#: axes/models.py:9
+msgid "User Agent"
+msgstr ""
+
+#: axes/models.py:15
+msgid "IP Address"
+msgstr "IP-Adresi"
+
+#: axes/models.py:21
+msgid "Username"
+msgstr "Kullanıcı Adı"
+
+#: axes/models.py:35
+msgid "HTTP Accept"
+msgstr ""
+
+#: axes/models.py:40
+msgid "Path"
+msgstr "Yol"
+
+#: axes/models.py:45
+msgid "Attempt Time"
+msgstr "Girişim Zamanı"
+
+#: axes/models.py:57
+msgid "GET Data"
+msgstr "GET-Verisi"
+
+#: axes/models.py:61
+msgid "POST Data"
+msgstr "POST-Verisi"
+
+#: axes/models.py:65
+msgid "Failed Logins"
+msgstr "Geçersiz Girişler"
+
+#: axes/models.py:76
+msgid "access attempt"
+msgstr "erişim denemesi"
+
+#: axes/models.py:77
+msgid "access attempts"
+msgstr "erişim denemeleri"
+
+#: axes/models.py:81
+msgid "Logout Time"
+msgstr "Çıkış Zamanı"
+
+#: axes/models.py:90
+msgid "access log"
+msgstr "erişim kaydı"
+
+#: axes/models.py:91
+msgid "access logs"
+msgstr "erişim kayıtları"

+ 0 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/__init__.py


+ 0 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/__init__.py


+ 13 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_list_attempts.py

@@ -0,0 +1,13 @@
+from django.core.management.base import BaseCommand
+
+from axes.models import AccessAttempt
+
+
+class Command(BaseCommand):
+    help = "List access attempts"
+
+    def handle(self, *args, **options):  # pylint: disable=unused-argument
+        for obj in AccessAttempt.objects.all():
+            self.stdout.write(
+                f"{obj.ip_address}\t{obj.username}\t{obj.failures_since_start}"
+            )

+ 15 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset.py

@@ -0,0 +1,15 @@
+from django.core.management.base import BaseCommand
+
+from axes.utils import reset
+
+
+class Command(BaseCommand):
+    help = "Reset all access attempts and lockouts"
+
+    def handle(self, *args, **options):  # pylint: disable=unused-argument
+        count = reset()
+
+        if count:
+            self.stdout.write(f"{count} attempts removed.")
+        else:
+            self.stdout.write("No attempts found.")

+ 21 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_ip.py

@@ -0,0 +1,21 @@
+from django.core.management.base import BaseCommand
+
+from axes.utils import reset
+
+
+class Command(BaseCommand):
+    help = "Reset all access attempts and lockouts for given IP addresses"
+
+    def add_arguments(self, parser):
+        parser.add_argument("ip", nargs="+", type=str)
+
+    def handle(self, *args, **options):
+        count = 0
+
+        for ip in options["ip"]:
+            count += reset(ip=ip)
+
+        if count:
+            self.stdout.write(f"{count} attempts removed.")
+        else:
+            self.stdout.write("No attempts found.")

+ 22 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_logs.py

@@ -0,0 +1,22 @@
+from django.core.management.base import BaseCommand
+
+from axes.handlers.proxy import AxesProxyHandler
+
+
+class Command(BaseCommand):
+    help = "Reset access log records older than given days."
+
+    def add_arguments(self, parser):
+        parser.add_argument(
+            "--age",
+            type=int,
+            default=30,
+            help="Maximum age for records to keep in days",
+        )
+
+    def handle(self, *args, **options):
+        count = AxesProxyHandler.reset_logs(age_days=options["age"])
+        if count:
+            self.stdout.write(f"{count} logs removed.")
+        else:
+            self.stdout.write("No logs found.")

+ 21 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_user.py

@@ -0,0 +1,21 @@
+from django.core.management.base import BaseCommand
+
+from axes.utils import reset
+
+
+class Command(BaseCommand):
+    help = "Reset all access attempts and lockouts for given usernames"
+
+    def add_arguments(self, parser):
+        parser.add_argument("username", nargs="+", type=str)
+
+    def handle(self, *args, **options):
+        count = 0
+
+        for username in options["username"]:
+            count += reset(username=username)
+
+        if count:
+            self.stdout.write(f"{count} attempts removed.")
+        else:
+            self.stdout.write("No attempts found.")

+ 21 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/management/commands/axes_reset_username.py

@@ -0,0 +1,21 @@
+from django.core.management.base import BaseCommand
+
+from axes.utils import reset
+
+
+class Command(BaseCommand):
+    help = "Reset all access attempts and lockouts for given usernames"
+
+    def add_arguments(self, parser):
+        parser.add_argument("username", nargs="+", type=str)
+
+    def handle(self, *args, **options):
+        count = 0
+
+        for username in options["username"]:
+            count += reset(username=username)
+
+        if count:
+            self.stdout.write(f"{count} attempts removed.")
+        else:
+            self.stdout.write("No attempts found.")

+ 42 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/middleware.py

@@ -0,0 +1,42 @@
+from typing import Callable
+
+from django.conf import settings
+
+from axes.helpers import get_lockout_response
+
+
+class AxesMiddleware:
+    """
+    Middleware that calculates necessary HTTP request attributes for attempt monitoring
+    and maps lockout signals into readable HTTP 403 Forbidden responses.
+
+    If a project uses ``django rest framework`` then the middleware updates the
+    request and checks whether the limit has been exceeded. It's needed only
+    for integration with DRF because it uses its own request object.
+
+    This middleware recognizes a logout monitoring flag in the request and
+    and uses the ``axes.helpers.get_lockout_response`` handler for returning
+    customizable and context aware lockout message to the end user if necessary.
+
+    To customize the lockout handling behaviour further, you can subclass this middleware
+    and change the ``__call__`` method to your own liking.
+
+    Please see the following configuration flags before customizing this handler:
+
+    - ``AXES_LOCKOUT_TEMPLATE``,
+    - ``AXES_LOCKOUT_URL``,
+    - ``AXES_COOLOFF_MESSAGE``, and
+    - ``AXES_PERMALOCK_MESSAGE``.
+    """
+
+    def __init__(self, get_response: Callable):
+        self.get_response = get_response
+
+    def __call__(self, request):
+        response = self.get_response(request)
+
+        if settings.AXES_ENABLED:
+            if getattr(request, "axes_locked_out", None):
+                response = get_lockout_response(request)  # type: ignore
+
+        return response

+ 72 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0001_initial.py

@@ -0,0 +1,72 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = []
+
+    operations = [
+        migrations.CreateModel(
+            name="AccessAttempt",
+            fields=[
+                (
+                    "id",
+                    models.AutoField(
+                        verbose_name="ID",
+                        serialize=False,
+                        auto_created=True,
+                        primary_key=True,
+                    ),
+                ),
+                ("user_agent", models.CharField(max_length=255)),
+                (
+                    "ip_address",
+                    models.GenericIPAddressField(null=True, verbose_name="IP Address"),
+                ),
+                ("username", models.CharField(max_length=255, null=True)),
+                ("trusted", models.BooleanField(default=False)),
+                (
+                    "http_accept",
+                    models.CharField(max_length=1025, verbose_name="HTTP Accept"),
+                ),
+                ("path_info", models.CharField(max_length=255, verbose_name="Path")),
+                ("attempt_time", models.DateTimeField(auto_now_add=True)),
+                ("get_data", models.TextField(verbose_name="GET Data")),
+                ("post_data", models.TextField(verbose_name="POST Data")),
+                (
+                    "failures_since_start",
+                    models.PositiveIntegerField(verbose_name="Failed Logins"),
+                ),
+            ],
+            options={"ordering": ["-attempt_time"], "abstract": False},
+        ),
+        migrations.CreateModel(
+            name="AccessLog",
+            fields=[
+                (
+                    "id",
+                    models.AutoField(
+                        verbose_name="ID",
+                        serialize=False,
+                        auto_created=True,
+                        primary_key=True,
+                    ),
+                ),
+                ("user_agent", models.CharField(max_length=255)),
+                (
+                    "ip_address",
+                    models.GenericIPAddressField(null=True, verbose_name="IP Address"),
+                ),
+                ("username", models.CharField(max_length=255, null=True)),
+                ("trusted", models.BooleanField(default=False)),
+                (
+                    "http_accept",
+                    models.CharField(max_length=1025, verbose_name="HTTP Accept"),
+                ),
+                ("path_info", models.CharField(max_length=255, verbose_name="Path")),
+                ("attempt_time", models.DateTimeField(auto_now_add=True)),
+                ("logout_time", models.DateTimeField(null=True, blank=True)),
+            ],
+            options={"ordering": ["-attempt_time"], "abstract": False},
+        ),
+    ]

+ 53 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0002_auto_20151217_2044.py

@@ -0,0 +1,53 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [("axes", "0001_initial")]
+
+    operations = [
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="ip_address",
+            field=models.GenericIPAddressField(
+                db_index=True, null=True, verbose_name="IP Address"
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="trusted",
+            field=models.BooleanField(db_index=True, default=False),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="user_agent",
+            field=models.CharField(db_index=True, max_length=255),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="username",
+            field=models.CharField(db_index=True, max_length=255, null=True),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="ip_address",
+            field=models.GenericIPAddressField(
+                db_index=True, null=True, verbose_name="IP Address"
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="trusted",
+            field=models.BooleanField(db_index=True, default=False),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="user_agent",
+            field=models.CharField(db_index=True, max_length=255),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="username",
+            field=models.CharField(db_index=True, max_length=255, null=True),
+        ),
+    ]

+ 58 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0003_auto_20160322_0929.py

@@ -0,0 +1,58 @@
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [("axes", "0002_auto_20151217_2044")]
+
+    operations = [
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="failures_since_start",
+            field=models.PositiveIntegerField(verbose_name="Failed Logins"),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="get_data",
+            field=models.TextField(verbose_name="GET Data"),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="http_accept",
+            field=models.CharField(verbose_name="HTTP Accept", max_length=1025),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="ip_address",
+            field=models.GenericIPAddressField(
+                null=True, verbose_name="IP Address", db_index=True
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="path_info",
+            field=models.CharField(verbose_name="Path", max_length=255),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="post_data",
+            field=models.TextField(verbose_name="POST Data"),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="http_accept",
+            field=models.CharField(verbose_name="HTTP Accept", max_length=1025),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="ip_address",
+            field=models.GenericIPAddressField(
+                null=True, verbose_name="IP Address", db_index=True
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="path_info",
+            field=models.CharField(verbose_name="Path", max_length=255),
+        ),
+    ]

+ 68 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0004_auto_20181024_1538.py

@@ -0,0 +1,68 @@
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [("axes", "0003_auto_20160322_0929")]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name="accessattempt",
+            options={
+                "verbose_name": "access attempt",
+                "verbose_name_plural": "access attempts",
+            },
+        ),
+        migrations.AlterModelOptions(
+            name="accesslog",
+            options={
+                "verbose_name": "access log",
+                "verbose_name_plural": "access logs",
+            },
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="attempt_time",
+            field=models.DateTimeField(auto_now_add=True, verbose_name="Attempt Time"),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="user_agent",
+            field=models.CharField(
+                db_index=True, max_length=255, verbose_name="User Agent"
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accessattempt",
+            name="username",
+            field=models.CharField(
+                db_index=True, max_length=255, null=True, verbose_name="Username"
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="attempt_time",
+            field=models.DateTimeField(auto_now_add=True, verbose_name="Attempt Time"),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="logout_time",
+            field=models.DateTimeField(
+                blank=True, null=True, verbose_name="Logout Time"
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="user_agent",
+            field=models.CharField(
+                db_index=True, max_length=255, verbose_name="User Agent"
+            ),
+        ),
+        migrations.AlterField(
+            model_name="accesslog",
+            name="username",
+            field=models.CharField(
+                db_index=True, max_length=255, null=True, verbose_name="Username"
+            ),
+        ),
+    ]

+ 8 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0005_remove_accessattempt_trusted.py

@@ -0,0 +1,8 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [("axes", "0004_auto_20181024_1538")]
+
+    operations = [migrations.RemoveField(model_name="accessattempt", name="trusted")]

+ 10 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/0006_remove_accesslog_trusted.py

@@ -0,0 +1,10 @@
+# Generated by Django 2.0.4 on 2019-03-13 08:55
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [("axes", "0005_remove_accessattempt_trusted")]
+
+    operations = [migrations.RemoveField(model_name="accesslog", name="trusted")]

+ 0 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/migrations/__init__.py


+ 47 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/models.py

@@ -0,0 +1,47 @@
+from django.db import models
+from django.utils.translation import gettext_lazy as _
+
+
+class AccessBase(models.Model):
+    user_agent = models.CharField(_("User Agent"), max_length=255, db_index=True)
+
+    ip_address = models.GenericIPAddressField(_("IP Address"), null=True, db_index=True)
+
+    username = models.CharField(_("Username"), max_length=255, null=True, db_index=True)
+
+    http_accept = models.CharField(_("HTTP Accept"), max_length=1025)
+
+    path_info = models.CharField(_("Path"), max_length=255)
+
+    attempt_time = models.DateTimeField(_("Attempt Time"), auto_now_add=True)
+
+    class Meta:
+        app_label = "axes"
+        abstract = True
+        ordering = ["-attempt_time"]
+
+
+class AccessAttempt(AccessBase):
+    get_data = models.TextField(_("GET Data"))
+
+    post_data = models.TextField(_("POST Data"))
+
+    failures_since_start = models.PositiveIntegerField(_("Failed Logins"))
+
+    def __str__(self):
+        return f"Attempted Access: {self.attempt_time}"
+
+    class Meta:
+        verbose_name = _("access attempt")
+        verbose_name_plural = _("access attempts")
+
+
+class AccessLog(AccessBase):
+    logout_time = models.DateTimeField(_("Logout Time"), null=True, blank=True)
+
+    def __str__(self):
+        return f"Access Log for {self.username} @ {self.attempt_time}"
+
+    class Meta:
+        verbose_name = _("access log")
+        verbose_name_plural = _("access logs")

+ 61 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/signals.py

@@ -0,0 +1,61 @@
+from logging import getLogger
+
+from django.contrib.auth.signals import (
+    user_logged_in,
+    user_logged_out,
+    user_login_failed,
+)
+from django.core.signals import setting_changed
+from django.db.models.signals import post_save, post_delete
+from django.dispatch import Signal
+from django.dispatch import receiver
+
+from axes.handlers.proxy import AxesProxyHandler
+from axes.models import AccessAttempt
+
+log = getLogger(__name__)
+
+
+# This signal provides the following arguments to any listeners:
+# request - The current Request object.
+# username - The username of the User who has been locked out.
+# ip_address - The IP of the user who has been locked out.
+user_locked_out = Signal()
+
+
+@receiver(user_login_failed)
+def handle_user_login_failed(*args, **kwargs):
+    AxesProxyHandler.user_login_failed(*args, **kwargs)
+
+
+@receiver(user_logged_in)
+def handle_user_logged_in(*args, **kwargs):
+    AxesProxyHandler.user_logged_in(*args, **kwargs)
+
+
+@receiver(user_logged_out)
+def handle_user_logged_out(*args, **kwargs):
+    AxesProxyHandler.user_logged_out(*args, **kwargs)
+
+
+@receiver(post_save, sender=AccessAttempt)
+def handle_post_save_access_attempt(*args, **kwargs):
+    AxesProxyHandler.post_save_access_attempt(*args, **kwargs)
+
+
+@receiver(post_delete, sender=AccessAttempt)
+def handle_post_delete_access_attempt(*args, **kwargs):
+    AxesProxyHandler.post_delete_access_attempt(*args, **kwargs)
+
+
+@receiver(setting_changed)
+def handle_setting_changed(
+    sender, setting, value, enter, **kwargs
+):  # pylint: disable=unused-argument
+    """
+    Reinitialize handler implementation if a relevant setting changes
+    in e.g. application reconfiguration or during testing.
+    """
+
+    if setting == "AXES_HANDLER":
+        AxesProxyHandler.get_implementation(force=True)

+ 57 - 0
desktop/core/ext-py3/django-axes-5.13.0/axes/utils.py

@@ -0,0 +1,57 @@
+"""
+Axes utility functions that are publicly available.
+
+This module is separate for historical reasons
+and offers a backwards compatible import path.
+"""
+
+from logging import getLogger
+from typing import Optional
+
+from django.http import HttpRequest
+
+from axes.conf import settings
+from axes.handlers.proxy import AxesProxyHandler
+from axes.helpers import get_client_ip_address
+
+log = getLogger(__name__)
+
+
+def reset(ip: str = None, username: str = None, ip_or_username=False) -> int:
+    """
+    Reset records that match IP or username, and return the count of removed attempts.
+
+    This utility method is meant to be used from the CLI or via Python API.
+    """
+
+    return AxesProxyHandler.reset_attempts(
+        ip_address=ip, username=username, ip_or_username=ip_or_username
+    )
+
+
+def reset_request(request: HttpRequest) -> int:
+    """
+    Reset records that match IP or username, and return the count of removed attempts.
+
+    This utility method is meant to be used from the CLI or via Python API.
+    """
+
+    ip: Optional[str] = get_client_ip_address(request)
+    username = request.GET.get("username", None)
+
+    ip_or_username = settings.AXES_LOCK_OUT_BY_USER_OR_IP
+    if settings.AXES_ONLY_USER_FAILURES:
+        ip = None
+    elif not (
+        settings.AXES_LOCK_OUT_BY_USER_OR_IP
+        or settings.AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP
+    ):
+        username = None
+
+    if not ip and not username:
+        return 0
+        # We don't want to reset everything, if there is some wrong request parameter
+
+    # if settings.AXES_USE_USER_AGENT:
+    # TODO: reset based on user_agent?
+    return reset(ip, username, ip_or_username)

+ 9 - 0
desktop/core/ext-py3/django-axes-5.13.0/codecov.yml

@@ -0,0 +1,9 @@
+coverage:
+  status:
+    patch: off
+    project:
+      default:
+        # Minimum test coverage required for pass
+        target: 90%
+        # Maximum test coverage change allowed for pass
+        threshold: 20%

+ 3 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/10_changelog.rst

@@ -0,0 +1,3 @@
+.. changelog:
+
+.. include:: ../CHANGES.rst

+ 15 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/1_requirements.rst

@@ -0,0 +1,15 @@
+.. _requirements:
+
+Requirements
+============
+
+Axes requires a supported Django version and runs on Python versions 3.6 and above.
+
+Refer to the project source code repository in
+`GitHub <https://github.com/jazzband/django-axes/>`_ and see the
+`Tox configuration <https://github.com/jazzband/django-axes/blob/master/tox.ini>`_ and
+`Python package definition <https://github.com/jazzband/django-axes/blob/master/setup.py>`_
+to check if your Django and Python version are supported.
+
+The `GitHub Actions builds <https://github.com/jazzband/django-axes/actions>`_
+test Axes compatibility with the Django master branch for future compatibility as well.

+ 138 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/2_installation.rst

@@ -0,0 +1,138 @@
+.. _installation:
+
+Installation
+============
+
+Axes is easy to install from the PyPI package::
+
+    $ pip install django-axes
+
+After installing the package, the project settings need to be configured.
+
+**1.** Add ``axes`` to your ``INSTALLED_APPS``::
+
+    INSTALLED_APPS = [
+        'django.contrib.admin',
+        'django.contrib.auth',
+        'django.contrib.contenttypes',
+        'django.contrib.sessions',
+        'django.contrib.messages',
+        'django.contrib.staticfiles',
+
+        # Axes app can be in any position in the INSTALLED_APPS list.
+        'axes',
+    ]
+
+**2.** Add ``axes.backends.AxesBackend`` to the top of ``AUTHENTICATION_BACKENDS``::
+
+    AUTHENTICATION_BACKENDS = [
+        # AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.
+        'axes.backends.AxesBackend',
+
+        # Django ModelBackend is the default authentication backend.
+        'django.contrib.auth.backends.ModelBackend',
+    ]
+
+**3.** Add ``axes.middleware.AxesMiddleware`` to your list of ``MIDDLEWARE``::
+
+    MIDDLEWARE = [
+        # The following is the list of default middleware in new Django projects.
+        'django.middleware.security.SecurityMiddleware',
+        'django.contrib.sessions.middleware.SessionMiddleware',
+        'django.middleware.common.CommonMiddleware',
+        'django.middleware.csrf.CsrfViewMiddleware',
+        'django.contrib.auth.middleware.AuthenticationMiddleware',
+        'django.contrib.messages.middleware.MessageMiddleware',
+        'django.middleware.clickjacking.XFrameOptionsMiddleware',
+
+        # AxesMiddleware should be the last middleware in the MIDDLEWARE list.
+        # It only formats user lockout messages and renders Axes lockout responses
+        # on failed user authentication attempts from login views.
+        # If you do not want Axes to override the authentication response
+        # you can skip installing the middleware and use your own views.
+        'axes.middleware.AxesMiddleware',
+    ]
+
+**4.** Run ``python manage.py check`` to check the configuration.
+
+**5.** Run ``python manage.py migrate`` to sync the database.
+
+Axes is now functional with the default settings and is saving user attempts
+into your database and locking users out if they exceed the maximum attempts.
+
+You should use the ``python manage.py check`` command to verify the correct configuration in
+development, staging, and production environments. It is probably best to use this step as part
+of your regular CI workflows to verify that your project is not misconfigured.
+
+Axes uses checks to verify your Django settings configuration for security and functionality.
+Many people have different configurations for their development and production environments,
+and running the application with misconfigured settings can prevent security features from working.
+
+
+Disabling Axes system checks
+----------------------------
+
+If you are implementing custom authentication, request middleware, or signal handlers
+the Axes checks system might generate false positives in the Django checks framework.
+
+You can silence the unnecessary warnings by using the following Django settings::
+
+   SILENCED_SYSTEM_CHECKS = ['axes.W003']
+
+
+Axes has the following warnings codes built in:
+
+- ``axes.W001`` for invalid ``CACHES`` configuration.
+- ``axes.W002`` for invalid ``MIDDLEWARE`` configuration.
+- ``axes.W003`` for invalid ``AUTHENTICATION_BACKENDS`` configuration.
+- ``axes.W004`` for deprecated use of ``AXES_*`` setting flags.
+
+
+.. note::
+   Only disable the Axes system checks and warnings if you know what you are doing.
+   The default checks are implemented to verify and improve your project's security
+   and should only produce necessary warnings due to misconfigured settings.
+
+
+Disabling Axes components in tests
+----------------------------------
+
+If you get errors when running tests, try setting the
+``AXES_ENABLED`` flag to ``False`` in your test settings::
+
+    AXES_ENABLED = False
+
+This disables the Axes middleware, authentication backend and signal receivers,
+which might fix errors with incompatible test configurations.
+
+
+Disabling atomic requests
+-------------------------
+
+Django offers atomic database transactions that are tied to HTTP requests
+and toggled on and off with the ``ATOMIC_REQUESTS`` configuration.
+
+When ``ATOMIC_REQUESTS`` is set to ``True`` Django will always either perform
+all database read and write operations in one successful atomic transaction
+or in a case of failure roll them back, leaving no trace of the failed
+request in the database.
+
+However, sometimes Axes or another plugin can misbehave or not act correctly with
+other code, preventing the login mechanisms from working due to e.g. exception
+being thrown in some part of the code, preventing access attempts being logged
+to database with Axes or causing similar problems.
+
+If new attempts or log objects are not being correctly written to the Axes tables, 
+it is possible to configure Django ``ATOMIC_REQUESTS`` setting to to ``False``::
+
+    ATOMIC_REQUESTS = False
+
+Please note that atomic requests are usually desirable when writing e.g. RESTful APIs,
+but sometimes it can be problematic and warrant a disable.
+
+Before disabling atomic requests or configuring them please read the relevant
+Django documentation and make sure you know what you are configuring
+rather than just toggling the flag on and off for testing.
+
+Also note that the cache backend can provide correct functionality with
+Memcached or Redis caches even with exceptions being thrown in the stack.

+ 109 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/3_usage.rst

@@ -0,0 +1,109 @@
+.. _usage:
+
+Usage
+=====
+
+Once Axes is installed and configured, you can login and logout
+of your application via the ``django.contrib.auth`` views.
+The attempts will be logged and visible in the Access Attempts section in admin.
+
+Axes monitors the views by using the Django login and logout signals and
+locks out user attempts with a custom authentication backend that checks
+if requests are allowed to authenticate per the configured rules.
+
+By default, Axes will lock out repeated access attempts from the same IP address
+by monitoring login failures and storing them into the default database.
+
+
+Authenticating users
+--------------------
+
+Axes needs a ``request`` attribute to be supplied to the stock Django ``authenticate``
+method in the ``django.contrib.auth`` module in order to function correctly.
+
+If you wish to manually supply the argument to the calls to ``authenticate``,
+you can use the following snippet in your custom login views, tests, or other code::
+
+
+    def custom_login_view(request)
+        username = ...
+        password = ...
+
+        user = authenticate(
+            request=request,  # this is the important custom argument
+            username=username,
+            password=password,
+        )
+
+        if user is not None:
+            login(request, user)
+
+
+If your test setup has problems with the ``request`` argument, you can either
+supply the argument manually with a blank `HttpRequest()`` object,
+disable Axes in the test setup by excluding ``axes`` from ``INSTALLED_APPS``,
+or leave out ``axes.backends.AxesBackend`` from your ``AUTHENTICATION_BACKENDS``.
+
+If you are using a 3rd party library that does not supply the ``request`` attribute
+when calling ``authenticate`` you can implement a customized backend that inherits
+from ``axes.backends.AxesBackend`` or other backend and overrides the ``authenticate`` method.
+
+
+Resetting attempts and lockouts
+-------------------------------
+
+When Axes locks an IP address, it is not allowed to login again.
+You can allow IPs to attempt again by resetting (deleting)
+the relevant AccessAttempt records in the admin UI, CLI, or your own code.
+
+You can also configure automatic cool down periods, IP whitelists, and custom
+code and handler functions for resetting attempts. Please check out the
+configuration and customization documentation for further information.
+
+.. note::
+   Please note that the functionality describe here concerns the default
+   database handler. If you have changed the default handler to another
+   class such as the cache handler you have to implement custom reset commands.
+
+
+Resetting attempts from the Django admin UI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Records can be easily deleted by using the Django admin application.
+
+Go to the admin UI and check the ``Access Attempt`` view.
+Select the attempts you wish the allow again and simply remove them.
+The blocked user will be allowed to log in again in accordance to the rules.
+
+
+Resetting attempts from command line
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Axes offers a command line interface with
+``axes_reset``, ``axes_reset_ip``, and ``axes_reset_username``
+management commands with the Django ``manage.py`` or ``django-admin`` command helpers:
+
+- ``python manage.py axes_reset``
+  will reset all lockouts and access records.
+- ``python manage.py axes_reset_ip [ip ...]``
+  will clear lockouts and records for the given IP addresses.
+- ``python manage.py axes_reset_username [username ...]``
+  will clear lockouts and records for the given usernames.
+- ``python manage.py axes_reset_logs (age)``
+  will reset (i.e. delete) AccessLog records that are older
+  than the given age where the default is 30 days.
+
+
+Resetting attempts programmatically by APIs
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In your code, you can use the ``axes.utils.reset`` function.
+
+- ``reset()`` will reset all lockouts and access records.
+- ``reset(ip=ip)`` will clear lockouts and records for the given IP address.
+- ``reset(username=username)`` will clear lockouts and records for the given username.
+
+.. note::
+   Please note that if you give both ``username`` and ``ip`` arguments to ``reset``
+   that attempts that have both the set IP and username are reset.
+   The effective behaviour of ``reset`` is to ``and`` the terms instead of ``or`` ing them.

+ 246 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/4_configuration.rst

@@ -0,0 +1,246 @@
+.. _configuration:
+
+Configuration
+=============
+
+Minimal Axes configuration is done with just ``settings.py`` updates.
+
+More advanced configuration and integrations might require updates
+on source code level depending on your project implementation.
+
+
+Configuring project settings
+----------------------------
+
+The following ``settings.py`` options are available for customizing Axes behaviour.
+
+* ``AXES_ENABLED``: Enable or disable Axes plugin functionality,
+  for example in test runner setup. Default: ``True``
+* ``AXES_FAILURE_LIMIT``: The integer number of login attempts allowed before a
+  record is created for the failed logins. This can also be a callable
+  or a dotted path to callable that returns an integer and all of the following are valid:
+  ``AXES_FAILURE_LIMIT = 42``,
+  ``AXES_FAILURE_LIMIT = lambda *args: 42``, and
+  ``AXES_FAILURE_LIMIT = 'project.app.get_login_failure_limit'``.
+  Default: ``3``
+* ``AXES_LOCK_OUT_AT_FAILURE``: After the number of allowed login attempts
+  are exceeded, should we lock out this IP (and optional user agent)?
+  Default: ``True``
+* ``AXES_COOLOFF_TIME``: If set, defines a period of inactivity after which
+  old failed login attempts will be cleared.
+  Can be set to a Python timedelta object, an integer, a callable,
+  or a string path to a callable which takes no arguments.
+  If an integer, will be interpreted as a number of hours.
+  Default: ``None``
+* ``AXES_ONLY_ADMIN_SITE``: If ``True``, lock is only enabled for admin site.
+  Admin site is determined by checking request path against the path of ``"admin:index"`` view.
+  If admin urls are not registered in current urlconf, all requests will not be locked.
+  Default: ``False``
+* ``AXES_ONLY_USER_FAILURES`` : If ``True``, only lock based on username,
+  and never lock based on IP if attempts exceed the limit.
+  Otherwise utilize the existing IP and user locking logic.
+  Default: ``False``
+* ``AXES_ENABLE_ADMIN``: If ``True``, admin views for access attempts and
+  logins are shown in Django admin interface.
+  Default: ``True``
+* ``AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP``: If ``True``, prevent login
+  from IP under a particular username if the attempt limit has been exceeded,
+  otherwise lock out based on IP.
+  Default: ``False``
+* ``AXES_LOCK_OUT_BY_USER_OR_IP``: If ``True``, prevent login
+  from if the attempt limit has been exceeded for IP or username.
+  Default: ``False``
+* ``AXES_USE_USER_AGENT``: If ``True``, lock out and log based on the IP address
+  and the user agent.  This means requests from different user agents but from
+  the same IP are treated differently. This settings has no effect if the
+  ``AXES_ONLY_USER_FAILURES`` setting is active.
+  Default: ``False``
+* ``AXES_HANDLER``: The path to the handler class to use.
+  If set, overrides the default signal handler backend.
+  Default: ``'axes.handlers.database.DatabaseHandler'``
+* ``AXES_CACHE``: The name of the cache for Axes to use.
+  Default: ``'default'``
+* ``AXES_LOCKOUT_TEMPLATE``: If set, specifies a template to render when a
+  user is locked out. Template receives ``cooloff_timedelta``, ``cooloff_time``, ``username`` and ``failure_limit`` as
+  context variables.
+  Default: ``None``
+* ``AXES_LOCKOUT_URL``: If set, specifies a URL to redirect to on lockout. If both
+  ``AXES_LOCKOUT_TEMPLATE`` and ``AXES_LOCKOUT_URL`` are set, the template will be used.
+  Default: ``None``
+* ``AXES_VERBOSE``: If ``True``, you'll see slightly more logging for Axes.
+  Default: ``True``
+* ``AXES_USERNAME_FORM_FIELD``: the name of the form field that contains your users usernames.
+  Default: ``username``
+* ``AXES_USERNAME_CALLABLE``: A callable or a string path to callable that takes
+  two arguments for user lookups: ``def get_username(request: HttpRequest, credentials: dict) -> str: ...``.
+  This can be any callable such as ``AXES_USERNAME_CALLABLE = lambda request, credentials: 'username'``
+  or a full Python module path to callable such as ``AXES_USERNAME_CALLABLE = 'example.get_username``.
+  The ``request`` is a HttpRequest like object and the ``credentials`` is a dictionary like object.
+  ``credentials`` are the ones that were passed to Django ``authenticate()`` in the login flow.
+  If no function is supplied, Axes fetches the username from the ``credentials`` or ``request.POST``
+  dictionaries based on ``AXES_USERNAME_FORM_FIELD``.
+* ``AXES_WHITELIST_CALLABLE``: A callable or a string path to callable that takes
+  two arguments for whitelisting determination and returns True,
+  if user should be whitelisted:
+  ``def is_whilisted(request: HttpRequest, credentials: dict) -> bool: ...``.
+  This can be any callable similarly to ``AXES_USERNAME_CALLABLE``.
+  Default: ``None``
+* ``AXES_LOCKOUT_CALLABLE``: A callable or a string path to callable that takes
+  two arguments returns a response. For example:
+  ``def generate_lockout_response(request: HttpRequest, credentials: dict) -> HttpResponse: ...``.
+  This can be any callable similarly to ``AXES_USERNAME_CALLABLE``.
+  If not callable is defined, then the default implementation in ``axes.helpers.get_lockout_response``
+  is used for determining the correct lockout response that is sent to the requesting client.
+  Default: ``None``
+* ``AXES_PASSWORD_FORM_FIELD``: the name of the form or credentials field that contains your users password.
+  Default: ``password``
+* ``AXES_NEVER_LOCKOUT_GET``: If ``True``, Axes will never lock out HTTP GET requests.
+  Default: ``False``
+* ``AXES_NEVER_LOCKOUT_WHITELIST``: If ``True``, users can always login from whitelisted IP addresses.
+  Default: ``False``
+* ``AXES_IP_BLACKLIST``: An iterable of IPs to be blacklisted.
+  Takes precedence over whitelists. For example: ``AXES_IP_BLACKLIST = ['0.0.0.0']``.
+  Default: ``None``
+* ``AXES_IP_WHITELIST``: An iterable of IPs to be whitelisted.
+  For example: ``AXES_IP_WHITELIST = ['0.0.0.0']``.
+  Default: ``None``
+* ``AXES_DISABLE_ACCESS_LOG``: If ``True``, disable writing login and logout access logs to database,
+  so the admin interface will not have user login trail for successful user authentication.
+  Default: ``False``
+* ``AXES_RESET_ON_SUCCESS``: If ``True``, a successful login will reset the number of failed logins.
+  Default: ``False``
+* ``AXES_ALLOWED_CORS_ORIGINS``: Configures lockout response CORS headers for XHR requests.
+  Default: ``*``
+
+The configuration option precedences for the access attempt monitoring are:
+
+1. Default: only use IP address.
+2. ``AXES_ONLY_USER_FAILURES``: only user username (``AXES_USE_USER_AGENT`` has no effect).
+3. ``AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP``: use username and IP address.
+
+The ``AXES_USE_USER_AGENT`` setting can be used with username and IP address or just IP address monitoring,
+but does nothing when the ``AXES_ONLY_USER_FAILURES`` setting is set.
+
+
+Configuring reverse proxies
+---------------------------
+
+Axes makes use of ``django-ipware`` package to detect the IP address of the client
+and uses some conservative configuration parameters by default for security.
+
+If you are using reverse proxies, you will need to configure one or more of the
+following settings to suit your set up to correctly resolve client IP addresses:
+
+* ``AXES_PROXY_COUNT``: The number of reverse proxies in front of Django as an integer. Default: ``None``
+* ``AXES_META_PRECEDENCE_ORDER``: The names of ``request.META`` attributes as a tuple of strings
+  to check to get the client IP address. Check the Django documentation for header naming conventions.
+  Default: ``IPWARE_META_PRECEDENCE_ORDER`` setting if set, else ``('REMOTE_ADDR', )``
+
+.. note::
+   For reverse proxies or e.g. Heroku, you might also want to fetch IP addresses from a HTTP header such as ``X-Forwarded-For``. To configure this, you can fetch IPs through the ``HTTP_X_FORWARDED_FOR`` key from the ``request.META`` property which contains all the HTTP headers in Django:
+
+   .. code-block:: python
+
+      # refer to the Django request and response objects documentation
+      AXES_META_PRECEDENCE_ORDER = [
+         'HTTP_X_FORWARDED_FOR',
+         'REMOTE_ADDR',
+      ]
+
+   Please note that proxies have different behaviours with the HTTP headers. Make sure that your proxy either strips the incoming value or otherwise makes sure of the validity of the header that is used because **any header values used in application configuration must be secure and trusted**. Otherwise the client can spoof IP addresses by just setting the header in their request and circumvent the IP address monitoring. Normal proxy server behaviours include overriding and appending the header value depending on the platform. Different platforms and gateway services utilize different headers, please refer to your deployment target documentation for up-to-date information on correct configuration.
+
+
+Configuring handlers
+--------------------
+
+Axes uses handlers for processing signals and events
+from Django authentication and login attempts.
+
+The following handlers are implemented by Axes and can be configured
+with the ``AXES_HANDLER`` setting in project configuration:
+
+- ``axes.handlers.database.AxesDatabaseHandler``
+  logs attempts to database and creates AccessAttempt and AccessLog records
+  that persist until removed from the database manually or automatically
+  after their cool offs expire (checked on each login event).
+- ``axes.handlers.cache.AxesCacheHandler``
+  only uses the cache for monitoring attempts and does not persist data
+  other than in the cache backend; this data can be purged automatically
+  depending on your cache configuration, so the cache handler is by design
+  less secure than the database backend but offers higher throughput
+  and can perform better with less bottlenecks.
+  The cache backend should ideally be used with a central cache system
+  such as a Memcached cache and should not rely on individual server
+  state such as the local memory or file based cache does.
+- ``axes.handlers.dummy.AxesDummyHandler``
+  does nothing with attempts and can be used to disable Axes handlers
+  if the user does not wish Axes to execute any logic on login signals.
+  Please note that this effectively disables any Axes security features,
+  and is meant to be used on e.g. local development setups
+  and testing deployments where login monitoring is not wanted.
+
+To switch to cache based attempt tracking you can do the following::
+
+    AXES_HANDLER = 'axes.handlers.cache.AxesCacheHandler'
+
+See the cache configuration section for suitable cache backends.
+
+
+Configuring caches
+------------------
+
+If you are running Axes with the cache based handler on a deployment with a
+local Django cache, the Axes lockout and reset functionality might not work
+predictably if the cache in use is not the same for all the Django processes.
+
+Axes needs to cache access attempts application-wide, and e.g. the
+in-memory cache only caches access attempts per Django process, so for example
+resets made in the command line might not remove lock-outs that are in a separate
+process's in-memory cache such as the web server serving your login or admin page.
+
+To circumvent this problem, please use somethings else than
+``django.core.cache.backends.dummy.DummyCache``,
+``django.core.cache.backends.locmem.LocMemCache``, or
+``django.core.cache.backends.filebased.FileBasedCache``
+as your cache backend in Django cache ``BACKEND`` setting.
+
+If changing the ``'default'`` cache is not an option, you can add a cache
+specifically for use with Axes. This is a two step process. First you need to
+add an extra cache to ``CACHES`` with a name of your choice::
+
+    CACHES = {
+        'axes': {
+            'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+            'LOCATION': '127.0.0.1:11211',
+        }
+    }
+
+The next step is to tell Axes to use this cache through adding ``AXES_CACHE``
+to your ``settings.py`` file::
+
+    AXES_CACHE = 'axes'
+
+There are no known problems in e.g. ``MemcachedCache`` or Redis based caches.
+
+
+Configuring authentication backends
+-----------------------------------
+
+Axes requires authentication backends to pass request objects
+with the authentication requests for performing monitoring.
+
+If you get ``AxesBackendRequestParameterRequired`` exceptions,
+make sure any libraries and middleware you use pass the request object.
+
+Please check the integration documentation for further information.
+
+
+Configuring 3rd party apps
+--------------------------
+
+Refer to the integration documentation for Axes configuration
+with third party applications and plugins such as
+
+- Django REST Framework
+- Django Allauth
+- Django Simple Captcha

+ 156 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/5_customization.rst

@@ -0,0 +1,156 @@
+.. customization:
+
+Customization
+=============
+
+Axes has multiple options for customization including customizing the
+attempt tracking and lockout handling logic and lockout response formatting.
+
+There are public APIs and the whole Axes tracking system is pluggable.
+You can swap the authentication backend, attempt tracker, failure handlers,
+database or cache backends and error formatters as you see fit.
+
+Check the API reference section for further inspiration on
+implementing custom authentication backends, middleware, and handlers.
+
+Axes uses the stock Django signals for login monitoring and
+can be customized and extended by using them correctly.
+
+Axes listens to the following signals from ``django.contrib.auth.signals`` to log access attempts:
+
+* ``user_logged_in``
+* ``user_logged_out``
+* ``user_login_failed``
+
+You can also use Axes with your own auth module, but you'll need
+to ensure that it sends the correct signals in order for Axes to
+log the access attempts.
+
+
+Customizing authentication views
+--------------------------------
+
+Here is a more detailed example of sending the necessary signals using
+and a custom auth backend at an endpoint that expects JSON
+requests. The custom authentication can be swapped out with ``authenticate``
+and ``login`` from ``django.contrib.auth``, but beware that those methods take
+care of sending the nessary signals for you, and there is no need to duplicate
+them as per the example.
+
+``example/forms.py``::
+
+    from django import forms
+
+    class LoginForm(forms.Form):
+        username = forms.CharField(max_length=128, required=True)
+        password = forms.CharField(max_length=128, required=True)
+
+``example/views.py``::
+
+    from django.contrib.auth import signals
+    from django.http import JsonResponse, HttpResponse
+    from django.utils.decorators import method_decorator
+    from django.views import View
+    from django.views.decorators.csrf import csrf_exempt
+
+    from axes.decorators import axes_dispatch
+
+    from example.forms import LoginForm
+    from example.authentication import authenticate, login
+
+
+    @method_decorator(axes_dispatch, name='dispatch')
+    @method_decorator(csrf_exempt, name='dispatch')
+    class Login(View):
+        """
+        Custom login view that takes JSON credentials
+        """
+
+        http_method_names = ['post']
+
+        def post(self, request):
+            form = LoginForm(request.POST)
+
+            if not form.is_valid():
+                # inform django-axes of failed login
+                signals.user_login_failed.send(
+                    sender=User,
+                    request=request,
+                    credentials={
+                        'username': form.cleaned_data.get('username'),
+                    },
+                )
+                return HttpResponse(status=400)
+
+            user = authenticate(
+                request=request,
+                username=form.cleaned_data.get('username'),
+                password=form.cleaned_data.get('password'),
+            )
+
+            if user is not None:
+                login(request, user)
+
+                signals.user_logged_in.send(
+                    sender=User,
+                    request=request,
+                    user=user,
+                )
+
+                return JsonResponse({
+                    'message':'success'
+                }, status=200)
+
+            # inform django-axes of failed login
+            signals.user_login_failed.send(
+                sender=User,
+                request=request,
+                credentials={
+                    'username': form.cleaned_data.get('username'),
+                },
+            )
+
+            return HttpResponse(status=403)
+
+``urls.py``::
+
+    from django.urls import path
+    from example.views import Login
+
+    urlpatterns = [
+        path('login/', Login.as_view(), name='login'),
+    ]
+
+
+Customizing username lookups
+----------------------------
+
+In special cases, you may have the need to modify the username that is
+submitted before attempting to authenticate. For example, adding namespacing or
+removing client-set prefixes. In these cases, ``axes`` needs to know how to make
+these changes so that it can correctly identify the user without any form
+cleaning or validation. This is where the ``AXES_USERNAME_CALLABLE`` setting
+comes in. You can define how to make these modifications in a callable that
+takes a request object and a credentials dictionary,
+and provide that callable to ``axes`` via this setting.
+
+For example, a function like this could take a post body with something like
+``username='prefixed-username'`` and ``namespace=my_namespace`` and turn it
+into ``my_namespace-username``:
+
+``example/utils.py``::
+
+    def get_username(request, credentials):
+        username = credentials.get('username')
+        namespace = credentials.get('namespace')
+        return namespace + '-' + username
+
+``settings.py``::
+
+    AXES_USERNAME_CALLABLE = 'example.utils.get_username'
+
+.. note::
+   You still have to make these modifications yourself before calling
+   authenticate. If you want to re-use the same function for consistency, that's
+   fine, but Axes does not inject these changes into the authentication flow
+   for you.

+ 275 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/6_integration.rst

@@ -0,0 +1,275 @@
+.. _integration:
+
+Integration
+===========
+
+Axes is intended to be pluggable and usable with custom authentication solutions.
+This document describes the integration with some popular 3rd party packages
+such as Django Allauth, Django REST Framework, and other tools.
+
+In the following table
+**Compatible** means that a component should be fully compatible out-of-the-box,
+**Functional** means that a component should be functional after configuration, and
+**Incompatible** means that a component has been reported as non-functional with Axes.
+
+=======================   =============   ============   ============   ==============
+Project                   Version         Compatible     Functional     Incompatible
+=======================   =============   ============   ============   ==============
+Django REST Framework                                    |check|
+Django Allauth                                           |check|
+Django Simple Captcha                                    |check|
+Django OAuth Toolkit                                     |check|
+Django Reversion                                         |check|
+=======================   =============   ============   ============   ==============
+
+.. |check|  unicode:: U+2713
+.. |lt|     unicode:: U+003C
+.. |lte|    unicode:: U+2264
+.. |gte|    unicode:: U+2265
+.. |gt|     unicode:: U+003E
+
+Please note that project compatibility depends on multiple different factors
+such as Django version, Axes version, and 3rd party package versions and
+their unique combinations per project.
+
+.. note::
+   This documentation is mostly provided by Axes users.
+   If you have your own compatibility tweaks and customizations
+   that enable you to use Axes with other tools or have better
+   implementations than the solutions provided here, please do
+   feel free to open an issue or a pull request in GitHub!
+
+
+Integration with Django Allauth
+-------------------------------
+
+Axes relies on having login information stored under ``AXES_USERNAME_FORM_FIELD`` key
+both in ``request.POST`` and in ``credentials`` dict passed to
+``user_login_failed`` signal.
+
+This is not the case with Allauth. Allauth always uses the ``login`` key in post POST data
+but it becomes ``username`` key in ``credentials`` dict in signal handler.
+
+To overcome this you need to use custom login form that duplicates the value
+of ``username`` key under a ``login`` key in that dict and set ``AXES_USERNAME_FORM_FIELD = 'login'``.
+
+You also need to decorate ``dispatch()`` and ``form_invalid()`` methods of the Allauth login view.
+
+``settings.py``::
+
+    AXES_USERNAME_FORM_FIELD = 'login'
+
+``example/forms.py``::
+
+    from allauth.account.forms import LoginForm
+
+    class AxesLoginForm(LoginForm):
+        """
+        Extended login form class that supplied the
+        user credentials for Axes compatibility.
+        """
+
+        def user_credentials(self):
+            credentials = super().user_credentials()
+            credentials['login'] = credentials.get('email') or credentials.get('username')
+            return credentials
+
+``example/urls.py``::
+
+    from django.utils.decorators import method_decorator
+
+    from allauth.account.views import LoginView
+
+    from axes.decorators import axes_dispatch
+    from axes.decorators import axes_form_invalid
+
+    from example.forms import AxesLoginForm
+
+    LoginView.dispatch = method_decorator(axes_dispatch)(LoginView.dispatch)
+    LoginView.form_invalid = method_decorator(axes_form_invalid)(LoginView.form_invalid)
+
+    urlpatterns = [
+        # Override allauth default login view with a patched view
+        path('accounts/login/', LoginView.as_view(form_class=AxesLoginForm), name='account_login'),
+        path('accounts/', include('allauth.urls')),
+    ]
+
+
+Integration with Django REST Framework
+--------------------------------------
+
+Django Axes requires REST Framework to be connected
+via lockout signals for correct functionality.
+
+You can use the following snippet in your project signals such as ``example/signals.py``::
+
+    from django.dispatch import receiver
+
+    from axes.signals import user_locked_out
+    from rest_framework.exceptions import PermissionDenied
+
+
+    @receiver(user_locked_out)
+    def raise_permission_denied(*args, **kwargs):
+        raise PermissionDenied("Too many failed login attempts")
+
+And then configure your application to load it in ``examples/apps.py``::
+
+    from django import apps
+
+
+    class AppConfig(apps.AppConfig):
+        name = "example"
+
+        def ready(self):
+            from example import signals  # noqa
+
+Please check the Django signals documentation for more information:
+
+https://docs.djangoproject.com/en/3.1/topics/signals/
+
+When a user login fails a signal is emitted and PermissionDenied
+raises a HTTP 403 reply which interrupts the login process.
+
+This functionality was handled in the middleware for a time,
+but that resulted in extra database requests being made for
+each and every web request, and was migrated to signals.
+
+
+Integration with Django Simple Captcha
+--------------------------------------
+
+Axes supports Captcha with the Django Simple Captcha package in the following manner.
+
+``settings.py``::
+
+    AXES_LOCKOUT_URL = '/locked'
+
+``example/urls.py``::
+
+    url(r'^locked/$', locked_out, name='locked_out'),
+
+``example/forms.py``::
+
+    class AxesCaptchaForm(forms.Form):
+        captcha = CaptchaField()
+
+``example/views.py``::
+
+    from axes.utils import reset_request
+    from django.http.response import HttpResponseRedirect
+    from django.shortcuts import render
+    from django.urls import reverse_lazy
+
+    from .forms import AxesCaptchaForm
+
+
+    def locked_out(request):
+        if request.POST:
+            form = AxesCaptchaForm(request.POST)
+            if form.is_valid():
+                reset_request(request)
+                return HttpResponseRedirect(reverse_lazy('auth_login'))
+        else:
+            form = AxesCaptchaForm()
+
+        return render(request, 'accounts/captcha.html', {'form': form})
+
+``example/templates/example/captcha.html``::
+
+    <form action="" method="post">
+        {% csrf_token %}
+
+        {{ form.captcha.errors }}
+        {{ form.captcha }}
+
+        <div class="form-actions">
+            <input type="submit" value="Submit" />
+        </div>
+    </form>
+
+
+Integration with Django OAuth Toolkit
+-------------------------------------
+
+Django OAuth toolkit is not designed to work with Axes,
+but some users have reported that they have configured
+validator classes to function correctly.
+
+
+``example/validators.py``::
+
+    from django.contrib.auth import authenticate
+    from django.http import HttpRequest, QueryDict
+
+    from oauth2_provider.oauth2_validators import OAuth2Validator
+
+    from axes.helpers import get_client_ip_address, get_client_user_agent
+
+
+    class AxesOAuth2Validator(OAuth2Validator):
+        def validate_user(self, username, password, client, request, *args, **kwargs):
+            """
+            Check username and password correspond to a valid and active User
+
+            Set defaults for necessary request object attributes for Axes compatibility.
+            The ``request`` argument is not a Django ``HttpRequest`` object.
+            """
+
+            _request = request
+            if request and not isinstance(request, HttpRequest):
+                request = HttpRequest()
+
+                request.uri = _request.uri
+                request.method = request.http_method = _request.http_method
+                request.META = request.headers = _request.headers
+                request._params = _request._params
+                request.decoded_body = _request.decoded_body
+
+                request.axes_ip_address = get_client_ip_address(request)
+                request.axes_user_agent = get_client_user_agent(request)
+
+                body = QueryDict(str(_request.body), mutable=True)
+                if request.method == 'GET':
+                    request.GET = body
+                elif request.method == 'POST':
+                    request.POST = body
+
+            user = authenticate(request=request, username=username, password=password)
+            if user is not None and user.is_active:
+                request = _request
+                request.user = user
+                return True
+
+            return False
+
+
+``settings.py``::
+
+    OAUTH2_PROVIDER = {
+        'OAUTH2_VALIDATOR_CLASS': 'example.validators.AxesOAuth2Validator',
+        'SCOPES': {'read': 'Read scope', 'write': 'Write scope'},
+    }
+
+
+Integration with Django Reversion
+---------------------------------
+
+Django Reversion is not designed to work with Axes,
+but some users have reported that they have configured
+a workaround with a monkeypatch function that functions correctly.
+
+``example/monkeypatch.py``::
+
+    from django.urls import resolve
+
+    from reversion import views
+
+    def _request_creates_revision(request):
+        view_name = resolve(request.path_info).url_name
+        if view_name and view_name.endswith('login'):
+            return False
+
+        return request.method not in ["OPTIONS", "GET", "HEAD"]
+
+    views._request_creates_revision = _request_creates_revision

+ 77 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/7_architecture.rst

@@ -0,0 +1,77 @@
+.. _architecture:
+
+Architecture
+============
+
+Axes is based on the existing Django authentication backend
+architecture and framework for recognizing users and aims to be
+compatible with the stock design and implementation of Django
+while offering extensibility and configurability for using the
+Axes authentication monitoring and logging for users of the package
+as well as 3rd party package vendors such as Django REST Framework,
+Django Allauth, Python Social Auth and so forth.
+
+The development of custom 3rd party package support are active goals,
+but you should check the up-to-date documentation and implementation
+of Axes for current compatibility before using Axes with custom solutions
+and make sure that authentication monitoring is working correctly.
+
+This document describes the Django authentication flow
+and how Axes augments it to achieve authentication and login
+monitoring and lock users out on too many access attempts.
+
+
+Django Axes authentication flow
+-------------------------------
+
+Axes offers a few additions to the Django authentication flow
+that implement the login monitoring and lockouts through a swappable
+**handler** API and configuration flags that users and package vendors
+can use to customize Axes or their own projects as they best see fit.
+
+The following diagram visualizes the Django login flow
+and highlights the following extra steps that Axes adds to it with the
+**1. Authentication backend**, **2. Signal receivers**, and **3. Middleware**.
+
+.. image:: images/flow.png
+   :alt: Django Axes augmented authentication flow
+         with custom authentication backend,
+         signal receivers, and middleware
+
+When a user tries to log in in Django, the login is usually performed
+by running a number of authentication backends that check user login
+information by calling the ``authenticate`` function, which either
+returns a Django compatible ``User``  object or a ``None``.
+
+If an authentication backend does not approve a user login,
+it can raise a ``PermissionDenied`` exception, which immediately
+skips the rest of the authentication backends, triggers the
+``user_login_failed`` signal, and then returns a ``None``
+to the calling function, indicating that the login failed.
+
+Axes implements authentication blocking with the custom
+``AxesBackend`` authentication backend which checks every request
+coming through the Django authentication flow and verifies they
+are not blocked, and allows the requests to go through if the check passes.
+
+If the authentication attempt matches a lockout rule, e.g. it is from a
+blacklisted IP or exceeds the maximum configured authentication attempts,
+it is blocked by raising the ``PermissionDenied`` excepton in the backend.
+
+Axes monitors logins with the ``user_login_failed`` signal receiver
+and records authentication failures from both the ``AxesBackend`` and
+other authentication backends and tracks the failed attempts
+by tracking the attempt IP address, username, user agent, or all of them.
+
+If the lockout rules match, then Axes marks the request
+as locked by setting a special attribute into the request.
+The ``AxesMiddleware`` then processes the request, returning
+a lockout response to the user, if the flag has been set.
+
+Axes assumes that the login views either call the ``authenticate`` method
+to log in users or otherwise take care of notifying Axes of authentication
+attempts and failures the same way Django does via authentication signals.
+
+The login flows can be customized and the Axes
+authentication backend, middleware, and signal receivers
+can easily be swapped to alternative implementations.

+ 18 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/8_reference.rst

@@ -0,0 +1,18 @@
+.. _reference:
+
+API reference
+=============
+
+Axes offers extensible APIs that you can customize to your liking.
+You can specialize the following base classes or alternatively use
+third party modules as long as they implement the following APIs.
+
+.. automodule:: axes.handlers.base
+   :members:
+
+.. automodule:: axes.backends
+   :members:
+   :show-inheritance:
+
+.. automodule:: axes.middleware
+   :members:

+ 46 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/9_development.rst

@@ -0,0 +1,46 @@
+.. _development:
+
+Development
+===========
+
+You can contribute to this project forking it from GitHub and sending pull requests.
+
+First `fork <https://help.github.com/en/articles/fork-a-repo>`_ the
+`repository <https://github.com/jazzband/django-axes>`_ and then clone it::
+
+    $ git clone git@github.com:<you>/django-axes.git
+
+Initialize a virtual environment for development purposes::
+
+    $ mkdir -p ~/.virtualenvs
+    $ python3 -m venv ~/.virtualenvs/django-axes
+    $ source ~/.virtualenvs/django-axes/bin/activate
+
+Then install the necessary requirements::
+
+    $ cd django-axes
+    $ pip install -r requirements.txt
+
+Unit tests are located in the ``axes/tests`` folder and can be easily run with the pytest tool::
+
+    $ pytest
+
+Prospector runs a number of source code style, safety, and complexity checks::
+
+    $ prospector
+
+Mypy runs static typing checks to verify the source code type annotations and correctness::
+
+    $ mypy .
+
+Before committing, you can run all the above tests against all supported Python and Django versions with tox::
+
+    $ tox
+
+Tox runs the same test set that is run by GitHub Actions, and your code should be good to go if it passes.
+
+If you wish to limit the testing to specific environment(s), you can parametrize the tox run::
+
+    $ tox -e py39-django22
+
+After you have pushed your changes, open a pull request on GitHub for getting your code upstreamed.

+ 192 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/Makefile

@@ -0,0 +1,192 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  applehelp  to make an Apple Help Book"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  xml        to make Docutils-native XML files"
+	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+	@echo "  coverage   to run coverage check of the documentation (if enabled)"
+
+clean:
+	rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/DjangoAxes.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/DjangoAxes.qhc"
+
+applehelp:
+	$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
+	@echo
+	@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
+	@echo "N.B. You won't be able to view it unless you put it in" \
+	      "~/Library/Documentation/Help or install it in your application" \
+	      "bundle."
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/DjangoAxes"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/DjangoAxes"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+latexpdfja:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through platex and dvipdfmx..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
+coverage:
+	$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
+	@echo "Testing of coverage in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/coverage/python.txt."
+
+xml:
+	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+	@echo
+	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+pseudoxml:
+	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+	@echo
+	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

+ 122 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/conf.py

@@ -0,0 +1,122 @@
+"""
+Sphinx documentation generator configuration.
+
+More information on the configuration options is available at:
+
+    http://www.sphinx-doc.org/en/master/usage/configuration.html
+"""
+
+from os import environ
+
+import django
+import sphinx_rtd_theme
+from pkg_resources import get_distribution
+
+environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
+django.setup()
+
+# -- Extra custom configuration  ------------------------------------------
+
+title = "django-axes documentation"
+description = ("Keep track of failed login attempts in Django-powered sites.",)
+
+# -- General configuration ------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings.
+# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ["sphinx.ext.autodoc"]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ["_templates"]
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string: source_suffix = ['.rst', '.md']
+source_suffix = ".rst"
+
+# The master toctree document.
+master_doc = "index"
+
+# General information about the project.
+project = "django-axes"
+copyright = "2016, Jazzband"
+author = "Jazzband"
+
+# The full version, including alpha/beta/rc tags.
+release = get_distribution("django-axes").version
+
+# The short X.Y version.
+version = ".".join(release.split(".")[:2])
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ["_build"]
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = "sphinx"
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = "sphinx_rtd_theme"
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ["_static"]
+
+# Custom sidebar templates, maps document names to template names.
+html_sidebars = {
+    "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"]
+}
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = "DjangoAxesdoc"
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+    "papersize": "a4paper",
+    "pointsize": "12pt",
+    "preamble": "",
+    "figure_align": "htbp",
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto, manual, or own class]).
+latex_documents = [(master_doc, "DjangoAxes.tex", title, author, "manual")]
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [(master_doc, "djangoaxes", description, [author], 1)]
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author, dir menu entry, description, category)
+texinfo_documents = [
+    (
+        master_doc,
+        "DjangoAxes",
+        title,
+        author,
+        "DjangoAxes",
+        description,
+        "Miscellaneous",
+    )
+]

BIN
desktop/core/ext-py3/django-axes-5.13.0/docs/images/flow.png


+ 28 - 0
desktop/core/ext-py3/django-axes-5.13.0/docs/index.rst

@@ -0,0 +1,28 @@
+.. _index:
+
+django-axes documentation
+=========================
+
+Contents
+--------
+
+.. toctree::
+   :maxdepth: 2
+   :numbered: 1
+
+   1_requirements
+   2_installation
+   3_usage
+   4_configuration
+   5_customization
+   6_integration
+   7_architecture
+   8_reference
+   9_development
+   10_changelog
+
+
+Indices and tables
+------------------
+
+* :ref:`search`

+ 11 - 0
desktop/core/ext-py3/django-axes-5.13.0/manage.py

@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+if __name__ == "__main__":
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)

+ 6 - 0
desktop/core/ext-py3/django-axes-5.13.0/mypy.ini

@@ -0,0 +1,6 @@
+[mypy]
+python_version = 3.6
+ignore_missing_imports = True
+
+[mypy-axes.migrations.*]
+ignore_errors = True

+ 58 - 0
desktop/core/ext-py3/django-axes-5.13.0/pyproject.toml

@@ -0,0 +1,58 @@
+[build-system]
+requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"]
+
+[tool.pytest.ini_options]
+testpaths = "tests"
+addopts = "--cov axes --cov-append --cov-branch --cov-report term-missing --cov-report=xml"
+DJANGO_SETTINGS_MODULE = "tests.settings"
+
+[tool.tox]
+legacy_tox_ini = """
+[tox]
+envlist =
+    py{36,37,38,39,py3}-dj{22,30,31}
+    py{38,39}-dj{dev}
+    py38-djqa
+
+[gh-actions]
+python =
+    3.6: py36
+    3.7: py37
+    3.8: py38
+    3.9: py39
+    pypy3: pypy3
+
+[gh-actions:env]
+DJANGO =
+    2.2: dj22
+    3.0: dj30
+    3.1: dj31
+    dev: djdev
+    qa: djqa
+
+# Normal test environment runs pytest which orchestrates other tools
+[testenv]
+deps =
+    -r requirements-test.txt
+    dj22: django>=2.2,<2.3
+    dj30: django>=3.0,<3.1
+    dj31: django>=3.1,<3.2
+    djdev: https://github.com/django/django/archive/master.tar.gz
+usedevelop = true
+commands = pytest
+setenv =
+    PYTHONDONTWRITEBYTECODE=1
+
+# Django development version is allowed to fail the test matrix
+[testenv:py{38,39,py3}-dj{dev}]
+ignore_errors = true
+ignore_outcome = true
+
+# QA runs type checks, linting, and code formatting checks
+[testenv:py38-djqa]
+deps = -r requirements-qa.txt
+commands =
+    mypy axes
+    prospector
+    black -t py36 --check --diff axes
+"""

+ 3 - 0
desktop/core/ext-py3/django-axes-5.13.0/requirements-qa.txt

@@ -0,0 +1,3 @@
+black==20.8b1
+mypy==0.800
+prospector==1.3.1

+ 6 - 0
desktop/core/ext-py3/django-axes-5.13.0/requirements-test.txt

@@ -0,0 +1,6 @@
+-e .
+coverage==5.4
+pytest==6.2.2
+pytest-cov==2.11.1
+pytest-django==4.1.0
+pytest-subtests==0.4.0

+ 5 - 0
desktop/core/ext-py3/django-axes-5.13.0/requirements.txt

@@ -0,0 +1,5 @@
+-e .
+-r requirements-qa.txt
+-r requirements-test.txt
+sphinx_rtd_theme==0.5.1
+tox==3.21.4

+ 4 - 0
desktop/core/ext-py3/django-axes-5.13.0/setup.cfg

@@ -0,0 +1,4 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+

+ 67 - 0
desktop/core/ext-py3/django-axes-5.13.0/setup.py

@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+
+from setuptools import setup, find_packages
+
+setup(
+    name="django-axes",
+    description="Keep track of failed login attempts in Django-powered sites.",
+    long_description="\n".join(
+        [
+            open("README.rst", encoding="utf-8").read(),
+            open("CHANGES.rst", encoding="utf-8").read(),
+        ]
+    ),
+    keywords="authentication django pci security",
+    author=", ".join(
+        [
+            "Josh VanderLinden",
+            "Philip Neustrom",
+            "Michael Blume",
+            "Alex Clark",
+            "Camilo Nova",
+            "Aleksi Hakli",
+        ]
+    ),
+    author_email="security@jazzband.co",
+    maintainer="Jazzband",
+    maintainer_email="security@jazzband.co",
+    url="https://github.com/jazzband/django-axes",
+    project_urls={
+        "Documentation": "https://django-axes.readthedocs.io/",
+        "Source": "https://github.com/jazzband/django-axes",
+        "Tracker": "https://github.com/jazzband/django-axes/issues",
+    },
+    license="MIT",
+    package_dir={"axes": "axes"},
+    use_scm_version=True,
+    setup_requires=["setuptools_scm"],
+    python_requires="~=3.6",
+    install_requires=["django>=2.2", "django-ipware>=3,<4"],
+    include_package_data=True,
+    packages=find_packages(exclude=["tests"]),
+    classifiers=[
+        "Development Status :: 5 - Production/Stable",
+        "Environment :: Web Environment",
+        "Environment :: Plugins",
+        "Framework :: Django",
+        "Framework :: Django :: 2.2",
+        "Framework :: Django :: 3.0",
+        "Framework :: Django :: 3.1",
+        "Intended Audience :: Developers",
+        "Intended Audience :: System Administrators",
+        "License :: OSI Approved :: MIT License",
+        "Operating System :: OS Independent",
+        "Programming Language :: Python",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.6",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: Implementation :: CPython",
+        "Programming Language :: Python :: Implementation :: PyPy",
+        "Topic :: Internet :: Log Analysis",
+        "Topic :: Security",
+        "Topic :: System :: Logging",
+    ],
+    zip_safe=False,
+)

+ 0 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/__init__.py


+ 191 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/base.py

@@ -0,0 +1,191 @@
+from random import choice
+from string import ascii_letters, digits
+from time import sleep
+
+from django.contrib.auth import get_user_model
+from django.http import HttpRequest
+from django.test import TestCase
+from django.urls import reverse
+from django.utils.timezone import now
+
+from axes.conf import settings
+from axes.helpers import (
+    get_cache,
+    get_client_http_accept,
+    get_client_ip_address,
+    get_client_path_info,
+    get_client_user_agent,
+    get_cool_off,
+    get_credentials,
+    get_failure_limit,
+)
+from axes.models import AccessAttempt, AccessLog
+from axes.utils import reset
+
+
+def custom_failure_limit(request, credentials):
+    return 3
+
+
+class AxesTestCase(TestCase):
+    """
+    Test case using custom settings for testing.
+    """
+
+    VALID_USERNAME = "axes-valid-username"
+    VALID_PASSWORD = "axes-valid-password"
+    VALID_EMAIL = "axes-valid-email@example.com"
+    VALID_USER_AGENT = "axes-user-agent"
+    VALID_IP_ADDRESS = "127.0.0.1"
+
+    INVALID_USERNAME = "axes-invalid-username"
+    INVALID_PASSWORD = "axes-invalid-password"
+    INVALID_EMAIL = "axes-invalid-email@example.com"
+
+    LOCKED_MESSAGE = "Account locked: too many login attempts."
+    LOGOUT_MESSAGE = "Logged out"
+    LOGIN_FORM_KEY = '<input type="submit" value="Log in" />'
+
+    STATUS_SUCCESS = 200
+    ALLOWED = 302
+    BLOCKED = 403
+
+    def setUp(self):
+        """
+        Create a valid user for login.
+        """
+
+        self.username = self.VALID_USERNAME
+        self.password = self.VALID_PASSWORD
+        self.email = self.VALID_EMAIL
+
+        self.ip_address = self.VALID_IP_ADDRESS
+        self.user_agent = self.VALID_USER_AGENT
+        self.path_info = reverse("admin:login")
+
+        self.user = get_user_model().objects.create_superuser(
+            username=self.username, password=self.password, email=self.email
+        )
+
+        self.request = HttpRequest()
+        self.request.method = "POST"
+        self.request.META["REMOTE_ADDR"] = self.ip_address
+        self.request.META["HTTP_USER_AGENT"] = self.user_agent
+        self.request.META["PATH_INFO"] = self.path_info
+
+        self.request.axes_attempt_time = now()
+        self.request.axes_ip_address = get_client_ip_address(self.request)
+        self.request.axes_user_agent = get_client_user_agent(self.request)
+        self.request.axes_path_info = get_client_path_info(self.request)
+        self.request.axes_http_accept = get_client_http_accept(self.request)
+
+        self.credentials = get_credentials(self.username)
+
+    def tearDown(self):
+        get_cache().clear()
+
+    def get_kwargs_with_defaults(self, **kwargs):
+        defaults = {
+            "user_agent": self.user_agent,
+            "ip_address": self.ip_address,
+            "username": self.username,
+        }
+
+        defaults.update(kwargs)
+        return defaults
+
+    def create_attempt(self, **kwargs):
+        kwargs = self.get_kwargs_with_defaults(**kwargs)
+        kwargs.setdefault("failures_since_start", 1)
+        return AccessAttempt.objects.create(**kwargs)
+
+    def create_log(self, **kwargs):
+        return AccessLog.objects.create(**self.get_kwargs_with_defaults(**kwargs))
+
+    def reset(self, ip=None, username=None):
+        return reset(ip, username)
+
+    def login(
+        self,
+        is_valid_username=False,
+        is_valid_password=False,
+        remote_addr=None,
+        **kwargs
+    ):
+        """
+        Login a user.
+
+        A valid credential is used when is_valid_username is True,
+        otherwise it will use a random string to make a failed login.
+        """
+
+        if is_valid_username:
+            username = self.VALID_USERNAME
+        else:
+            username = "".join(choice(ascii_letters + digits) for _ in range(10))
+
+        if is_valid_password:
+            password = self.VALID_PASSWORD
+        else:
+            password = self.INVALID_PASSWORD
+
+        post_data = {"username": username, "password": password, **kwargs}
+
+        return self.client.post(
+            reverse("admin:login"),
+            post_data,
+            REMOTE_ADDR=remote_addr or self.ip_address,
+            HTTP_USER_AGENT=self.user_agent,
+        )
+
+    def logout(self):
+        return self.client.post(
+            reverse("admin:logout"),
+            REMOTE_ADDR=self.ip_address,
+            HTTP_USER_AGENT=self.user_agent,
+        )
+
+    def check_login(self):
+        response = self.login(is_valid_username=True, is_valid_password=True)
+        self.assertNotContains(
+            response, self.LOGIN_FORM_KEY, status_code=self.ALLOWED, html=True
+        )
+
+    def almost_lockout(self):
+        for _ in range(1, get_failure_limit(None, None)):
+            response = self.login()
+            self.assertContains(response, self.LOGIN_FORM_KEY, html=True)
+
+    def lockout(self):
+        self.almost_lockout()
+        return self.login()
+
+    def check_lockout(self):
+        response = self.lockout()
+        if settings.AXES_LOCK_OUT_AT_FAILURE == True:
+            self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+        else:
+            self.assertNotContains(
+                response, self.LOCKED_MESSAGE, status_code=self.STATUS_SUCCESS
+            )
+
+    def cool_off(self):
+        sleep(get_cool_off().total_seconds())
+
+    def check_logout(self):
+        response = self.logout()
+        self.assertContains(
+            response, self.LOGOUT_MESSAGE, status_code=self.STATUS_SUCCESS
+        )
+
+    def check_handler(self):
+        """
+        Check a handler and its basic functionality with lockouts, cool offs, login, and logout.
+
+        This is a check that is intended to successfully run for each and every new handler.
+        """
+
+        self.check_lockout()
+        self.cool_off()
+        self.check_login()
+        self.check_logout()

+ 76 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/settings.py

@@ -0,0 +1,76 @@
+DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
+
+CACHES = {
+    "default": {
+        # This cache backend is OK to use in development and testing
+        # but has the potential to break production setups with more than on process
+        # due to each process having their own local memory based cache
+        "BACKEND": "django.core.cache.backends.locmem.LocMemCache"
+    }
+}
+
+SITE_ID = 1
+
+MIDDLEWARE = [
+    "django.middleware.common.CommonMiddleware",
+    "django.contrib.sessions.middleware.SessionMiddleware",
+    "django.contrib.auth.middleware.AuthenticationMiddleware",
+    "django.contrib.messages.middleware.MessageMiddleware",
+    "axes.middleware.AxesMiddleware",
+]
+
+AUTHENTICATION_BACKENDS = [
+    "axes.backends.AxesBackend",
+    "django.contrib.auth.backends.ModelBackend",
+]
+
+PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
+
+ROOT_URLCONF = "tests.urls"
+
+INSTALLED_APPS = [
+    "django.contrib.auth",
+    "django.contrib.contenttypes",
+    "django.contrib.sessions",
+    "django.contrib.sites",
+    "django.contrib.messages",
+    "django.contrib.admin",
+    "axes",
+]
+
+TEMPLATES = [
+    {
+        "BACKEND": "django.template.backends.django.DjangoTemplates",
+        "DIRS": [],
+        "APP_DIRS": True,
+        "OPTIONS": {
+            "context_processors": [
+                "django.template.context_processors.debug",
+                "django.template.context_processors.request",
+                "django.contrib.auth.context_processors.auth",
+                "django.contrib.messages.context_processors.messages",
+            ]
+        },
+    }
+]
+
+LOGGING = {
+    "version": 1,
+    "disable_existing_loggers": False,
+    "handlers": {"console": {"class": "logging.StreamHandler"}},
+    "loggers": {"axes": {"handlers": ["console"], "level": "INFO", "propagate": False}},
+}
+
+SECRET_KEY = "too-secret-for-test"
+
+USE_I18N = False
+
+USE_L10N = False
+
+USE_TZ = False
+
+LOGIN_REDIRECT_URL = "/admin/"
+
+AXES_FAILURE_LIMIT = 10
+
+DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

+ 28 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_admin.py

@@ -0,0 +1,28 @@
+from contextlib import suppress
+from importlib import reload
+
+from django.contrib import admin
+from django.test import override_settings
+
+import axes.admin
+from axes.models import AccessAttempt, AccessLog
+from tests.base import AxesTestCase
+
+
+class AxesEnableAdminFlag(AxesTestCase):
+    def setUp(self):
+        with suppress(admin.sites.NotRegistered):
+            admin.site.unregister(AccessAttempt)
+        with suppress(admin.sites.NotRegistered):
+            admin.site.unregister(AccessLog)
+
+    @override_settings(AXES_ENABLE_ADMIN=False)
+    def test_disable_admin(self):
+        reload(axes.admin)
+        self.assertFalse(admin.site.is_registered(AccessAttempt))
+        self.assertFalse(admin.site.is_registered(AccessLog))
+
+    def test_enable_admin_by_default(self):
+        reload(axes.admin)
+        self.assertTrue(admin.site.is_registered(AccessAttempt))
+        self.assertTrue(admin.site.is_registered(AccessLog))

+ 155 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_attempts.py

@@ -0,0 +1,155 @@
+from unittest.mock import patch
+
+from django.http import HttpRequest
+from django.test import override_settings
+from django.utils.timezone import now
+
+from axes.attempts import get_cool_off_threshold
+from axes.models import AccessAttempt
+from axes.utils import reset, reset_request
+from tests.base import AxesTestCase
+
+
+class GetCoolOffThresholdTestCase(AxesTestCase):
+    @override_settings(AXES_COOLOFF_TIME=42)
+    def test_get_cool_off_threshold(self):
+        timestamp = now()
+
+        with patch("axes.attempts.now", return_value=timestamp):
+            attempt_time = timestamp
+            threshold_now = get_cool_off_threshold(attempt_time)
+
+            attempt_time = None
+            threshold_none = get_cool_off_threshold(attempt_time)
+
+        self.assertEqual(threshold_now, threshold_none)
+
+    @override_settings(AXES_COOLOFF_TIME=None)
+    def test_get_cool_off_threshold_error(self):
+        with self.assertRaises(TypeError):
+            get_cool_off_threshold()
+
+
+class ResetTestCase(AxesTestCase):
+    def test_reset(self):
+        self.create_attempt()
+        reset()
+        self.assertFalse(AccessAttempt.objects.count())
+
+    def test_reset_ip(self):
+        self.create_attempt(ip_address=self.ip_address)
+        reset(ip=self.ip_address)
+        self.assertFalse(AccessAttempt.objects.count())
+
+    def test_reset_username(self):
+        self.create_attempt(username=self.username)
+        reset(username=self.username)
+        self.assertFalse(AccessAttempt.objects.count())
+
+
+class ResetResponseTestCase(AxesTestCase):
+    USERNAME_1 = "foo_username"
+    USERNAME_2 = "bar_username"
+    IP_1 = "127.1.0.1"
+    IP_2 = "127.1.0.2"
+
+    def setUp(self):
+        super().setUp()
+        self.create_attempt()
+        self.create_attempt(username=self.USERNAME_1, ip_address=self.IP_1)
+        self.create_attempt(username=self.USERNAME_1, ip_address=self.IP_2)
+        self.create_attempt(username=self.USERNAME_2, ip_address=self.IP_1)
+        self.create_attempt(username=self.USERNAME_2, ip_address=self.IP_2)
+        self.request = HttpRequest()
+
+    def test_reset(self):
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 5)
+
+    def test_reset_ip(self):
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    def test_reset_username(self):
+        self.request.GET["username"] = self.USERNAME_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 5)
+
+    def test_reset_ip_username(self):
+        self.request.GET["username"] = self.USERNAME_1
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_reset_user_failures(self):
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 5)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_reset_ip_user_failures(self):
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 5)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_reset_username_user_failures(self):
+        self.request.GET["username"] = self.USERNAME_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_reset_ip_username_user_failures(self):
+        self.request.GET["username"] = self.USERNAME_1
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_reset_user_or_ip(self):
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 5)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_reset_ip_user_or_ip(self):
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_reset_username_user_or_ip(self):
+        self.request.GET["username"] = self.USERNAME_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_reset_ip_username_user_or_ip(self):
+        self.request.GET["username"] = self.USERNAME_1
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 2)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_reset_user_and_ip(self):
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 5)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_reset_ip_user_and_ip(self):
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_reset_username_user_and_ip(self):
+        self.request.GET["username"] = self.USERNAME_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_AND=True)
+    def test_reset_ip_username_user_and_ip(self):
+        self.request.GET["username"] = self.USERNAME_1
+        self.request.META["REMOTE_ADDR"] = self.IP_1
+        reset_request(self.request)
+        self.assertEqual(AccessAttempt.objects.count(), 3)

+ 23 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_backends.py

@@ -0,0 +1,23 @@
+from unittest.mock import patch, MagicMock
+
+from axes.backends import AxesBackend
+from axes.exceptions import (
+    AxesBackendRequestParameterRequired,
+    AxesBackendPermissionDenied,
+)
+from tests.base import AxesTestCase
+
+
+class BackendTestCase(AxesTestCase):
+    def test_authenticate_raises_on_missing_request(self):
+        request = None
+
+        with self.assertRaises(AxesBackendRequestParameterRequired):
+            AxesBackend().authenticate(request)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.is_allowed", return_value=False)
+    def test_authenticate_raises_on_locked_request(self, _):
+        request = MagicMock()
+
+        with self.assertRaises(AxesBackendPermissionDenied):
+            AxesBackend().authenticate(request)

+ 110 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_checks.py

@@ -0,0 +1,110 @@
+from django.core.checks import run_checks, Warning  # pylint: disable=redefined-builtin
+from django.test import override_settings, modify_settings
+
+from axes.backends import AxesBackend
+from axes.checks import Messages, Hints, Codes
+from tests.base import AxesTestCase
+
+
+class CacheCheckTestCase(AxesTestCase):
+    @override_settings(
+        AXES_HANDLER="axes.handlers.cache.AxesCacheHandler",
+        CACHES={
+            "default": {
+                "BACKEND": "django.core.cache.backends.db.DatabaseCache",
+                "LOCATION": "axes_cache",
+            }
+        },
+    )
+    def test_cache_check(self):
+        warnings = run_checks()
+        self.assertEqual(warnings, [])
+
+    @override_settings(
+        AXES_HANDLER="axes.handlers.cache.AxesCacheHandler",
+        CACHES={
+            "default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}
+        },
+    )
+    def test_cache_check_warnings(self):
+        warnings = run_checks()
+        warning = Warning(
+            msg=Messages.CACHE_INVALID, hint=Hints.CACHE_INVALID, id=Codes.CACHE_INVALID
+        )
+
+        self.assertEqual(warnings, [warning])
+
+    @override_settings(
+        AXES_HANDLER="axes.handlers.database.AxesDatabaseHandler",
+        CACHES={
+            "default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}
+        },
+    )
+    def test_cache_check_does_not_produce_check_warnings_with_database_handler(self):
+        warnings = run_checks()
+        self.assertEqual(warnings, [])
+
+
+class MiddlewareCheckTestCase(AxesTestCase):
+    @modify_settings(MIDDLEWARE={"remove": ["axes.middleware.AxesMiddleware"]})
+    def test_cache_check_warnings(self):
+        warnings = run_checks()
+        warning = Warning(
+            msg=Messages.MIDDLEWARE_INVALID,
+            hint=Hints.MIDDLEWARE_INVALID,
+            id=Codes.MIDDLEWARE_INVALID,
+        )
+
+        self.assertEqual(warnings, [warning])
+
+
+class AxesSpecializedBackend(AxesBackend):
+    pass
+
+
+class BackendCheckTestCase(AxesTestCase):
+    @modify_settings(AUTHENTICATION_BACKENDS={"remove": ["axes.backends.AxesBackend"]})
+    def test_backend_missing(self):
+        warnings = run_checks()
+        warning = Warning(
+            msg=Messages.BACKEND_INVALID,
+            hint=Hints.BACKEND_INVALID,
+            id=Codes.BACKEND_INVALID,
+        )
+
+        self.assertEqual(warnings, [warning])
+
+    @override_settings(
+        AUTHENTICATION_BACKENDS=["tests.test_checks.AxesSpecializedBackend"]
+    )
+    def test_specialized_backend(self):
+        warnings = run_checks()
+        self.assertEqual(warnings, [])
+
+    @override_settings(
+        AUTHENTICATION_BACKENDS=["tests.test_checks.AxesNotDefinedBackend"]
+    )
+    def test_import_error(self):
+        with self.assertRaises(ImportError):
+            run_checks()
+
+    @override_settings(AUTHENTICATION_BACKENDS=["module.not_defined"])
+    def test_module_not_found_error(self):
+        with self.assertRaises(ModuleNotFoundError):
+            run_checks()
+
+
+class DeprecatedSettingsTestCase(AxesTestCase):
+    def setUp(self):
+        self.disable_success_access_log_warning = Warning(
+            msg=Messages.SETTING_DEPRECATED.format(
+                deprecated_setting="AXES_DISABLE_SUCCESS_ACCESS_LOG"
+            ),
+            hint=Hints.SETTING_DEPRECATED,
+            id=Codes.SETTING_DEPRECATED,
+        )
+
+    @override_settings(AXES_DISABLE_SUCCESS_ACCESS_LOG=True)
+    def test_deprecated_success_access_log_flag(self):
+        warnings = run_checks()
+        self.assertEqual(warnings, [self.disable_success_access_log_warning])

+ 40 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_decorators.py

@@ -0,0 +1,40 @@
+from unittest.mock import MagicMock, patch
+
+from django.http import HttpResponse
+
+from axes.decorators import axes_dispatch, axes_form_invalid
+from tests.base import AxesTestCase
+
+
+class DecoratorTestCase(AxesTestCase):
+    SUCCESS_RESPONSE = HttpResponse(status=200, content="Dispatched")
+    LOCKOUT_RESPONSE = HttpResponse(status=403, content="Locked out")
+
+    def setUp(self):
+        self.request = MagicMock()
+        self.cls = MagicMock(return_value=self.request)
+        self.func = MagicMock(return_value=self.SUCCESS_RESPONSE)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.is_allowed", return_value=False)
+    @patch("axes.decorators.get_lockout_response", return_value=LOCKOUT_RESPONSE)
+    def test_axes_dispatch_locks_out(self, _, __):
+        response = axes_dispatch(self.func)(self.request)
+        self.assertEqual(response.content, self.LOCKOUT_RESPONSE.content)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.is_allowed", return_value=True)
+    @patch("axes.decorators.get_lockout_response", return_value=LOCKOUT_RESPONSE)
+    def test_axes_dispatch_dispatches(self, _, __):
+        response = axes_dispatch(self.func)(self.request)
+        self.assertEqual(response.content, self.SUCCESS_RESPONSE.content)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.is_allowed", return_value=False)
+    @patch("axes.decorators.get_lockout_response", return_value=LOCKOUT_RESPONSE)
+    def test_axes_form_invalid_locks_out(self, _, __):
+        response = axes_form_invalid(self.func)(self.cls)
+        self.assertEqual(response.content, self.LOCKOUT_RESPONSE.content)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.is_allowed", return_value=True)
+    @patch("axes.decorators.get_lockout_response", return_value=LOCKOUT_RESPONSE)
+    def test_axes_form_invalid_dispatches(self, _, __):
+        response = axes_form_invalid(self.func)(self.cls)
+        self.assertEqual(response.content, self.SUCCESS_RESPONSE.content)

+ 499 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_handlers.py

@@ -0,0 +1,499 @@
+from unittest.mock import MagicMock, patch
+
+from django.core.cache import cache
+from django.test import override_settings
+from django.urls import reverse
+from django.utils import timezone
+from django.utils.timezone import timedelta
+
+from axes.conf import settings
+from axes.handlers.proxy import AxesProxyHandler
+from axes.helpers import get_client_str
+from axes.models import AccessAttempt, AccessLog
+from tests.base import AxesTestCase
+
+
+@override_settings(AXES_HANDLER="axes.handlers.base.AxesHandler")
+class AxesHandlerTestCase(AxesTestCase):
+    @override_settings(AXES_IP_BLACKLIST=["127.0.0.1"])
+    def test_is_allowed_with_blacklisted_ip_address(self):
+        self.assertFalse(AxesProxyHandler.is_allowed(self.request))
+
+    @override_settings(
+        AXES_NEVER_LOCKOUT_WHITELIST=True, AXES_IP_WHITELIST=["127.0.0.1"]
+    )
+    def test_is_allowed_with_whitelisted_ip_address(self):
+        self.assertTrue(AxesProxyHandler.is_allowed(self.request))
+
+    @override_settings(AXES_NEVER_LOCKOUT_GET=True)
+    def test_is_allowed_with_whitelisted_method(self):
+        self.request.method = "GET"
+        self.assertTrue(AxesProxyHandler.is_allowed(self.request))
+
+    @override_settings(AXES_LOCK_OUT_AT_FAILURE=False)
+    def test_is_allowed_no_lock_out(self):
+        self.assertTrue(AxesProxyHandler.is_allowed(self.request))
+
+    @override_settings(AXES_ONLY_ADMIN_SITE=True)
+    def test_only_admin_site(self):
+        request = MagicMock()
+        request.path = "/test/"
+        self.assertTrue(AxesProxyHandler.is_allowed(self.request))
+
+    def test_is_admin_site(self):
+        request = MagicMock()
+        tests = (  # (AXES_ONLY_ADMIN_SITE, URL, Expected)
+            (True, "/test/", True),
+            (True, reverse("admin:index"), False),
+            (False, "/test/", False),
+            (False, reverse("admin:index"), False),
+        )
+
+        for setting_value, url, expected in tests:
+            with override_settings(AXES_ONLY_ADMIN_SITE=setting_value):
+                request.path = url
+                self.assertEqual(AxesProxyHandler().is_admin_site(request), expected)
+
+    @override_settings(ROOT_URLCONF="tests.urls_empty")
+    @override_settings(AXES_ONLY_ADMIN_SITE=True)
+    def test_is_admin_site_no_admin_site(self):
+        request = MagicMock()
+        request.path = "/admin/"
+        self.assertTrue(AxesProxyHandler().is_admin_site(self.request))
+
+
+class AxesProxyHandlerTestCase(AxesTestCase):
+    def setUp(self):
+        self.sender = MagicMock()
+        self.credentials = MagicMock()
+        self.request = MagicMock()
+        self.user = MagicMock()
+        self.instance = MagicMock()
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.implementation", None)
+    def test_setting_changed_signal_triggers_handler_reimport(self):
+        self.assertIsNone(AxesProxyHandler.implementation)
+
+        with self.settings(AXES_HANDLER="axes.handlers.database.AxesDatabaseHandler"):
+            self.assertIsNotNone(AxesProxyHandler.implementation)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.implementation")
+    def test_user_login_failed(self, handler):
+        self.assertFalse(handler.user_login_failed.called)
+        AxesProxyHandler.user_login_failed(self.sender, self.credentials, self.request)
+        self.assertTrue(handler.user_login_failed.called)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.implementation")
+    def test_user_logged_in(self, handler):
+        self.assertFalse(handler.user_logged_in.called)
+        AxesProxyHandler.user_logged_in(self.sender, self.request, self.user)
+        self.assertTrue(handler.user_logged_in.called)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.implementation")
+    def test_user_logged_out(self, handler):
+        self.assertFalse(handler.user_logged_out.called)
+        AxesProxyHandler.user_logged_out(self.sender, self.request, self.user)
+        self.assertTrue(handler.user_logged_out.called)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.implementation")
+    def test_post_save_access_attempt(self, handler):
+        self.assertFalse(handler.post_save_access_attempt.called)
+        AxesProxyHandler.post_save_access_attempt(self.instance)
+        self.assertTrue(handler.post_save_access_attempt.called)
+
+    @patch("axes.handlers.proxy.AxesProxyHandler.implementation")
+    def test_post_delete_access_attempt(self, handler):
+        self.assertFalse(handler.post_delete_access_attempt.called)
+        AxesProxyHandler.post_delete_access_attempt(self.instance)
+        self.assertTrue(handler.post_delete_access_attempt.called)
+
+
+class AxesHandlerBaseTestCase(AxesTestCase):
+    def check_whitelist(self, log):
+        with override_settings(
+            AXES_NEVER_LOCKOUT_WHITELIST=True, AXES_IP_WHITELIST=[self.ip_address]
+        ):
+            AxesProxyHandler.user_login_failed(
+                sender=None, request=self.request, credentials=self.credentials
+            )
+            client_str = get_client_str(
+                self.username, self.ip_address, self.user_agent, self.path_info
+            )
+            log.info.assert_called_with(
+                "AXES: Login failed from whitelisted client %s.", client_str
+            )
+
+    def check_empty_request(self, log, handler):
+        AxesProxyHandler.user_login_failed(sender=None, credentials={}, request=None)
+        log.error.assert_called_with(
+            f"AXES: {handler}.user_login_failed does not function without a request."
+        )
+
+
+@override_settings(AXES_HANDLER="axes.handlers.database.AxesDatabaseHandler")
+class ResetAttemptsTestCase(AxesHandlerBaseTestCase):
+    """ Resetting attempts is currently implemented only for database handler """
+
+    USERNAME_1 = "foo_username"
+    USERNAME_2 = "bar_username"
+    IP_1 = "127.1.0.1"
+    IP_2 = "127.1.0.2"
+
+    def setUp(self):
+        super().setUp()
+        self.create_attempt()
+        self.create_attempt(username=self.USERNAME_1, ip_address=self.IP_1)
+        self.create_attempt(username=self.USERNAME_1, ip_address=self.IP_2)
+        self.create_attempt(username=self.USERNAME_2, ip_address=self.IP_1)
+        self.create_attempt(username=self.USERNAME_2, ip_address=self.IP_2)
+
+    def test_handler_reset_attempts(self):
+        self.assertEqual(5, AxesProxyHandler.reset_attempts())
+        self.assertFalse(AccessAttempt.objects.count())
+
+    def test_handler_reset_attempts_username(self):
+        self.assertEqual(2, AxesProxyHandler.reset_attempts(username=self.USERNAME_1))
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+        self.assertEqual(
+            AccessAttempt.objects.filter(ip_address=self.USERNAME_1).count(), 0
+        )
+
+    def test_handler_reset_attempts_ip(self):
+        self.assertEqual(2, AxesProxyHandler.reset_attempts(ip_address=self.IP_1))
+        self.assertEqual(AccessAttempt.objects.count(), 3)
+        self.assertEqual(AccessAttempt.objects.filter(ip_address=self.IP_1).count(), 0)
+
+    def test_handler_reset_attempts_ip_and_username(self):
+        self.assertEqual(
+            1,
+            AxesProxyHandler.reset_attempts(
+                ip_address=self.IP_1, username=self.USERNAME_1
+            ),
+        )
+        self.assertEqual(AccessAttempt.objects.count(), 4)
+        self.assertEqual(AccessAttempt.objects.filter(ip_address=self.IP_1).count(), 1)
+
+        self.create_attempt(username=self.USERNAME_1, ip_address=self.IP_1)
+        self.assertEqual(
+            1,
+            AxesProxyHandler.reset_attempts(
+                ip_address=self.IP_1, username=self.USERNAME_2
+            ),
+        )
+        self.assertEqual(
+            1,
+            AxesProxyHandler.reset_attempts(
+                ip_address=self.IP_2, username=self.USERNAME_1
+            ),
+        )
+
+    def test_handler_reset_attempts_ip_or_username(self):
+        self.assertEqual(
+            3,
+            AxesProxyHandler.reset_attempts(
+                ip_address=self.IP_1, username=self.USERNAME_1, ip_or_username=True
+            ),
+        )
+        self.assertEqual(AccessAttempt.objects.count(), 2)
+        self.assertEqual(AccessAttempt.objects.filter(ip_address=self.IP_1).count(), 0)
+        self.assertEqual(
+            AccessAttempt.objects.filter(ip_address=self.USERNAME_1).count(), 0
+        )
+
+
+@override_settings(
+    AXES_HANDLER="axes.handlers.database.AxesDatabaseHandler",
+    AXES_COOLOFF_TIME=timedelta(seconds=2),
+    AXES_RESET_ON_SUCCESS=True,
+)
+class AxesDatabaseHandlerTestCase(AxesHandlerBaseTestCase):
+    def test_handler_reset_attempts(self):
+        self.create_attempt()
+        self.assertEqual(1, AxesProxyHandler.reset_attempts())
+        self.assertFalse(AccessAttempt.objects.count())
+
+    def test_handler_reset_logs(self):
+        self.create_log()
+        self.assertEqual(1, AxesProxyHandler.reset_logs())
+        self.assertFalse(AccessLog.objects.count())
+
+    def test_handler_reset_logs_older_than_42_days(self):
+        self.create_log()
+
+        then = timezone.now() - timezone.timedelta(days=90)
+        with patch("django.utils.timezone.now", return_value=then):
+            self.create_log()
+
+        self.assertEqual(AccessLog.objects.count(), 2)
+        self.assertEqual(1, AxesProxyHandler.reset_logs(age_days=42))
+        self.assertEqual(AccessLog.objects.count(), 1)
+
+    @override_settings(AXES_RESET_ON_SUCCESS=True)
+    def test_handler(self):
+        self.check_handler()
+
+    @override_settings(AXES_RESET_ON_SUCCESS=False)
+    def test_handler_without_reset(self):
+        self.check_handler()
+
+    @override_settings(AXES_FAILURE_LIMIT=lambda *args: 3)
+    def test_handler_callable_failure_limit(self):
+        self.check_handler()
+
+    @override_settings(AXES_FAILURE_LIMIT="tests.base.custom_failure_limit")
+    def test_handler_str_failure_limit(self):
+        self.check_handler()
+
+    @override_settings(AXES_FAILURE_LIMIT=None)
+    def test_handler_invalid_failure_limit(self):
+        with self.assertRaises(TypeError):
+            self.check_handler()
+
+    @override_settings(AXES_LOCK_OUT_AT_FAILURE=False)
+    def test_handler_without_lockout(self):
+        self.check_handler()
+
+    @patch("axes.handlers.database.log")
+    def test_empty_request(self, log):
+        self.check_empty_request(log, "AxesDatabaseHandler")
+
+    @patch("axes.handlers.database.log")
+    def test_whitelist(self, log):
+        self.check_whitelist(log)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    @patch("axes.handlers.database.log")
+    def test_user_login_failed_only_user_failures_with_none_username(self, log):
+        credentials = {"username": None, "password": "test"}
+        sender = MagicMock()
+        AxesProxyHandler.user_login_failed(sender, credentials, self.request)
+        attempt = AccessAttempt.objects.all()
+        self.assertEqual(0, AccessAttempt.objects.count())
+        log.warning.assert_called_with(
+            "AXES: Username is None and AXES_ONLY_USER_FAILURES is enable, New record won't be created."
+        )
+
+    def test_user_login_failed_with_none_username(self):
+        credentials = {"username": None, "password": "test"}
+        sender = MagicMock()
+        AxesProxyHandler.user_login_failed(sender, credentials, self.request)
+        attempt = AccessAttempt.objects.all()
+        self.assertEqual(1, AccessAttempt.objects.filter(username__isnull=True).count())
+
+    def test_user_login_failed_multiple_username(self):
+        configurations = (
+            (2, 1, {}, ["admin", "admin1"]),
+            (2, 1, {"AXES_USE_USER_AGENT": True}, ["admin", "admin1"]),
+            (2, 1, {"AXES_ONLY_USER_FAILURES": True}, ["admin", "admin1"]),
+            (
+                2,
+                1,
+                {"AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP": True},
+                ["admin", "admin1"],
+            ),
+            (
+                1,
+                2,
+                {"AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP": True},
+                ["admin", "admin"],
+            ),
+            (1, 2, {"AXES_LOCK_OUT_BY_USER_OR_IP": True}, ["admin", "admin"]),
+            (2, 1, {"AXES_LOCK_OUT_BY_USER_OR_IP": True}, ["admin", "admin1"]),
+        )
+
+        for (
+            total_attempts_count,
+            failures_since_start,
+            overrides,
+            usernames,
+        ) in configurations:
+            with self.settings(**overrides):
+                with self.subTest(
+                    total_attempts_count=total_attempts_count,
+                    failures_since_start=failures_since_start,
+                    settings=overrides,
+                ):
+                    self.login(username=usernames[0])
+                    attempt = AccessAttempt.objects.get(username=usernames[0])
+                    self.assertEqual(1, attempt.failures_since_start)
+
+                    # check the number of failures associated to the attempt
+                    self.login(username=usernames[1])
+                    attempt = AccessAttempt.objects.get(username=usernames[1])
+                    self.assertEqual(failures_since_start, attempt.failures_since_start)
+
+                    # check the number of distinct attempts
+                    self.assertEqual(
+                        total_attempts_count, AccessAttempt.objects.count()
+                    )
+
+            AccessAttempt.objects.all().delete()
+
+
+@override_settings(AXES_HANDLER="axes.handlers.cache.AxesCacheHandler")
+class ResetAttemptsCacheHandlerTestCase(AxesHandlerBaseTestCase):
+    """ Test reset attempts for the cache handler """
+
+    USERNAME_1 = "foo_username"
+    USERNAME_2 = "bar_username"
+    IP_1 = "127.1.0.1"
+    IP_2 = "127.1.0.2"
+
+    def set_up_login_attemtps(self):
+        """Set up the login attempts."""
+        self.login(username=self.USERNAME_1, remote_addr=self.IP_1)
+        self.login(username=self.USERNAME_1, remote_addr=self.IP_2)
+        self.login(username=self.USERNAME_2, remote_addr=self.IP_1)
+        self.login(username=self.USERNAME_2, remote_addr=self.IP_2)
+
+    def check_failures(self, failures, username=None, ip_address=None):
+        if ip_address is None and username is None:
+            raise NotImplementedError("Must supply ip_address or username")
+        try:
+            prev_ip = self.request.META["REMOTE_ADDR"]
+            credentials = {"username": username} if username else {}
+            if ip_address is not None:
+                self.request.META["REMOTE_ADDR"] = ip_address
+            self.assertEqual(
+                failures,
+                AxesProxyHandler.get_failures(self.request, credentials=credentials),
+            )
+        finally:
+            self.request.META["REMOTE_ADDR"] = prev_ip
+
+    def test_handler_reset_attempts(self):
+        with self.assertRaises(NotImplementedError):
+            AxesProxyHandler.reset_attempts()
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_handler_reset_attempts_username(self):
+        self.set_up_login_attemtps()
+        self.assertEqual(
+            2,
+            AxesProxyHandler.get_failures(
+                self.request, credentials={"username": self.USERNAME_1}
+            ),
+        )
+        self.assertEqual(
+            2,
+            AxesProxyHandler.get_failures(
+                self.request, credentials={"username": self.USERNAME_2}
+            ),
+        )
+        self.assertEqual(1, AxesProxyHandler.reset_attempts(username=self.USERNAME_1))
+        self.assertEqual(
+            0,
+            AxesProxyHandler.get_failures(
+                self.request, credentials={"username": self.USERNAME_1}
+            ),
+        )
+        self.assertEqual(
+            2,
+            AxesProxyHandler.get_failures(
+                self.request, credentials={"username": self.USERNAME_2}
+            ),
+        )
+
+    def test_handler_reset_attempts_ip(self):
+        self.set_up_login_attemtps()
+        self.check_failures(2, ip_address=self.IP_1)
+        self.assertEqual(1, AxesProxyHandler.reset_attempts(ip_address=self.IP_1))
+        self.check_failures(0, ip_address=self.IP_1)
+        self.check_failures(2, ip_address=self.IP_2)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_handler_reset_attempts_ip_and_username(self):
+        self.set_up_login_attemtps()
+        self.check_failures(1, username=self.USERNAME_1, ip_address=self.IP_1)
+        self.check_failures(1, username=self.USERNAME_2, ip_address=self.IP_1)
+        self.check_failures(1, username=self.USERNAME_1, ip_address=self.IP_2)
+        self.assertEqual(
+            1,
+            AxesProxyHandler.reset_attempts(
+                ip_address=self.IP_1, username=self.USERNAME_1
+            ),
+        )
+        self.check_failures(0, username=self.USERNAME_1, ip_address=self.IP_1)
+        self.check_failures(1, username=self.USERNAME_2, ip_address=self.IP_1)
+        self.check_failures(1, username=self.USERNAME_1, ip_address=self.IP_2)
+
+    def test_handler_reset_attempts_ip_or_username(self):
+        with self.assertRaises(NotImplementedError):
+            AxesProxyHandler.reset_attempts()
+
+
+@override_settings(
+    AXES_HANDLER="axes.handlers.cache.AxesCacheHandler",
+    AXES_COOLOFF_TIME=timedelta(seconds=1),
+)
+class AxesCacheHandlerTestCase(AxesHandlerBaseTestCase):
+    @override_settings(AXES_RESET_ON_SUCCESS=True)
+    def test_handler(self):
+        self.check_handler()
+
+    @override_settings(AXES_RESET_ON_SUCCESS=False)
+    def test_handler_without_reset(self):
+        self.check_handler()
+
+    @override_settings(AXES_LOCK_OUT_AT_FAILURE=False)
+    def test_handler_without_lockout(self):
+        self.check_handler()
+
+    @patch("axes.handlers.cache.log")
+    def test_empty_request(self, log):
+        self.check_empty_request(log, "AxesCacheHandler")
+
+    @patch("axes.handlers.cache.log")
+    def test_whitelist(self, log):
+        self.check_whitelist(log)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    @patch.object(cache, "set")
+    @patch("axes.handlers.cache.log")
+    def test_user_login_failed_only_user_failures_with_none_username(
+        self, log, cache_set
+    ):
+        credentials = {"username": None, "password": "test"}
+        sender = MagicMock()
+        AxesProxyHandler.user_login_failed(sender, credentials, self.request)
+        self.assertFalse(cache_set.called)
+        log.warning.assert_called_with(
+            "AXES: Username is None and AXES_ONLY_USER_FAILURES is enable, New record won't be created."
+        )
+
+    @patch.object(cache, "set")
+    def test_user_login_failed_with_none_username(self, cache_set):
+        credentials = {"username": None, "password": "test"}
+        sender = MagicMock()
+        AxesProxyHandler.user_login_failed(sender, credentials, self.request)
+        self.assertTrue(cache_set.called)
+
+
+@override_settings(AXES_HANDLER="axes.handlers.dummy.AxesDummyHandler")
+class AxesDummyHandlerTestCase(AxesHandlerBaseTestCase):
+    def test_handler(self):
+        for _ in range(settings.AXES_FAILURE_LIMIT):
+            self.login()
+
+        self.check_login()
+
+    def test_handler_is_allowed(self):
+        self.assertEqual(True, AxesProxyHandler.is_allowed(self.request, {}))
+
+    def test_handler_get_failures(self):
+        self.assertEqual(0, AxesProxyHandler.get_failures(self.request, {}))
+
+
+@override_settings(AXES_HANDLER="axes.handlers.test.AxesTestHandler")
+class AxesTestHandlerTestCase(AxesHandlerBaseTestCase):
+    def test_handler_reset_attempts(self):
+        self.assertEqual(0, AxesProxyHandler.reset_attempts())
+
+    def test_handler_reset_logs(self):
+        self.assertEqual(0, AxesProxyHandler.reset_logs())
+
+    def test_handler_is_allowed(self):
+        self.assertEqual(True, AxesProxyHandler.is_allowed(self.request, {}))
+
+    def test_handler_get_failures(self):
+        self.assertEqual(0, AxesProxyHandler.get_failures(self.request, {}))

+ 683 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_helpers.py

@@ -0,0 +1,683 @@
+from datetime import timedelta
+from hashlib import md5
+from unittest.mock import patch
+
+from django.contrib.auth import get_user_model
+from django.http import JsonResponse, HttpResponseRedirect, HttpResponse, HttpRequest
+from django.test import override_settings, RequestFactory
+
+from axes.apps import AppConfig
+from axes.helpers import (
+    get_cache_timeout,
+    get_client_str,
+    get_client_username,
+    get_client_cache_key,
+    get_client_parameters,
+    get_cool_off,
+    get_cool_off_iso8601,
+    get_lockout_response,
+    is_client_ip_address_blacklisted,
+    is_client_ip_address_whitelisted,
+    is_client_method_whitelisted,
+    is_ip_address_in_blacklist,
+    is_ip_address_in_whitelist,
+    is_user_attempt_whitelisted,
+    toggleable,
+)
+from axes.models import AccessAttempt
+from tests.base import AxesTestCase
+
+
+@override_settings(AXES_ENABLED=False)
+class AxesDisabledTestCase(AxesTestCase):
+    def test_initialize(self):
+        AppConfig.logging_initialized = False
+        AppConfig.initialize()
+        self.assertFalse(AppConfig.logging_initialized)
+
+    def test_toggleable(self):
+        def is_true():
+            return True
+
+        self.assertTrue(is_true())
+        self.assertIsNone(toggleable(is_true)())
+
+
+class CacheTestCase(AxesTestCase):
+    @override_settings(AXES_COOLOFF_TIME=3)  # hours
+    def test_get_cache_timeout_integer(self):
+        timeout_seconds = float(60 * 60 * 3)
+        self.assertEqual(get_cache_timeout(), timeout_seconds)
+
+    @override_settings(AXES_COOLOFF_TIME=timedelta(seconds=420))
+    def test_get_cache_timeout_timedelta(self):
+        self.assertEqual(get_cache_timeout(), 420)
+
+    @override_settings(AXES_COOLOFF_TIME=None)
+    def test_get_cache_timeout_none(self):
+        self.assertEqual(get_cache_timeout(), None)
+
+
+class TimestampTestCase(AxesTestCase):
+    def test_iso8601(self):
+        """
+        Test get_cool_off_iso8601 correctly translates datetime.timedelta to ISO 8601 formatted duration.
+        """
+
+        expected = {
+            timedelta(days=1, hours=25, minutes=42, seconds=8): "P2DT1H42M8S",
+            timedelta(days=7, seconds=342): "P7DT5M42S",
+            timedelta(days=0, hours=2, minutes=42): "PT2H42M",
+            timedelta(hours=20, seconds=42): "PT20H42S",
+            timedelta(seconds=300): "PT5M",
+            timedelta(seconds=9005): "PT2H30M5S",
+            timedelta(minutes=9005): "P6DT6H5M",
+            timedelta(days=15): "P15D",
+        }
+
+        for delta, iso_duration in expected.items():
+            with self.subTest(iso_duration):
+                self.assertEqual(get_cool_off_iso8601(delta), iso_duration)
+
+
+class ClientStringTestCase(AxesTestCase):
+    @staticmethod
+    def get_expected_client_str(*args, **kwargs):
+        client_str_template = '{{username: "{0}", ip_address: "{1}", user_agent: "{2}", path_info: "{3}"}}'
+        return client_str_template.format(*args, **kwargs)
+
+    @override_settings(AXES_VERBOSE=True)
+    def test_verbose_ip_only_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = self.get_expected_client_str(
+            username, ip_address, user_agent, path_info
+        )
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_VERBOSE=True)
+    def test_imbalanced_quotes(self):
+        username = "butterfly.. },,,"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = self.get_expected_client_str(
+            username, ip_address, user_agent, path_info
+        )
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_VERBOSE=True)
+    def test_verbose_ip_only_client_details_tuple(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = ("admin", "login")
+
+        expected = self.get_expected_client_str(
+            username, ip_address, user_agent, path_info[0]
+        )
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_VERBOSE=False)
+    def test_non_verbose_ip_only_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = '{ip_address: "127.0.0.1", path_info: "/admin/"}'
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    @override_settings(AXES_VERBOSE=True)
+    def test_verbose_user_only_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = self.get_expected_client_str(
+            username, ip_address, user_agent, path_info
+        )
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    @override_settings(AXES_VERBOSE=False)
+    def test_non_verbose_user_only_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = '{username: "test@example.com", path_info: "/admin/"}'
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    @override_settings(AXES_VERBOSE=True)
+    def test_verbose_user_ip_combo_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = self.get_expected_client_str(
+            username, ip_address, user_agent, path_info
+        )
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    @override_settings(AXES_VERBOSE=False)
+    def test_non_verbose_user_ip_combo_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = '{username: "test@example.com", ip_address: "127.0.0.1", path_info: "/admin/"}'
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_USE_USER_AGENT=True)
+    @override_settings(AXES_VERBOSE=True)
+    def test_verbose_user_agent_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = self.get_expected_client_str(
+            username, ip_address, user_agent, path_info
+        )
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_USE_USER_AGENT=True)
+    @override_settings(AXES_VERBOSE=False)
+    def test_non_verbose_user_agent_client_details(self):
+        username = "test@example.com"
+        ip_address = "127.0.0.1"
+        user_agent = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)"
+        path_info = "/admin/"
+
+        expected = '{ip_address: "127.0.0.1", user_agent: "Googlebot/2.1 (+http://www.googlebot.com/bot.html)", path_info: "/admin/"}'
+        actual = get_client_str(username, ip_address, user_agent, path_info)
+
+        self.assertEqual(expected, actual)
+
+
+class ClientParametersTestCase(AxesTestCase):
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_get_filter_kwargs_user(self):
+        self.assertEqual(
+            get_client_parameters(self.username, self.ip_address, self.user_agent),
+            [{"username": self.username}],
+        )
+
+    @override_settings(
+        AXES_ONLY_USER_FAILURES=False,
+        AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=False,
+        AXES_USE_USER_AGENT=False,
+    )
+    def test_get_filter_kwargs_ip(self):
+        self.assertEqual(
+            get_client_parameters(self.username, self.ip_address, self.user_agent),
+            [{"ip_address": self.ip_address}],
+        )
+
+    @override_settings(
+        AXES_ONLY_USER_FAILURES=False,
+        AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True,
+        AXES_USE_USER_AGENT=False,
+    )
+    def test_get_filter_kwargs_user_and_ip(self):
+        self.assertEqual(
+            get_client_parameters(self.username, self.ip_address, self.user_agent),
+            [{"username": self.username, "ip_address": self.ip_address}],
+        )
+
+    @override_settings(
+        AXES_ONLY_USER_FAILURES=False,
+        AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=False,
+        AXES_LOCK_OUT_BY_USER_OR_IP=True,
+        AXES_USE_USER_AGENT=False,
+    )
+    def test_get_filter_kwargs_user_or_ip(self):
+        self.assertEqual(
+            get_client_parameters(self.username, self.ip_address, self.user_agent),
+            [{"username": self.username}, {"ip_address": self.ip_address}],
+        )
+
+    @override_settings(
+        AXES_ONLY_USER_FAILURES=False,
+        AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=False,
+        AXES_USE_USER_AGENT=True,
+    )
+    def test_get_filter_kwargs_ip_and_agent(self):
+        self.assertEqual(
+            get_client_parameters(self.username, self.ip_address, self.user_agent),
+            [{"ip_address": self.ip_address}, {"user_agent": self.user_agent}],
+        )
+
+    @override_settings(
+        AXES_ONLY_USER_FAILURES=False,
+        AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True,
+        AXES_USE_USER_AGENT=True,
+    )
+    def test_get_filter_kwargs_user_ip_agent(self):
+        self.assertEqual(
+            get_client_parameters(self.username, self.ip_address, self.user_agent),
+            [
+                {"username": self.username, "ip_address": self.ip_address},
+                {"user_agent": self.user_agent},
+            ],
+        )
+
+
+class ClientCacheKeyTestCase(AxesTestCase):
+    def test_get_cache_key(self):
+        """
+        Test the cache key format.
+        """
+
+        cache_hash_digest = md5(self.ip_address.encode()).hexdigest()
+        cache_hash_key = f"axes-{cache_hash_digest}"
+
+        # Getting cache key from request
+        request_factory = RequestFactory()
+        request = request_factory.post(
+            "/admin/login/", data={"username": self.username, "password": "test"}
+        )
+
+        self.assertEqual([cache_hash_key], get_client_cache_key(request))
+
+        # Getting cache key from AccessAttempt Object
+        attempt = AccessAttempt(
+            user_agent="<unknown>",
+            ip_address=self.ip_address,
+            username=self.username,
+            get_data="",
+            post_data="",
+            http_accept=request.META.get("HTTP_ACCEPT", "<unknown>"),
+            path_info=request.META.get("PATH_INFO", "<unknown>"),
+            failures_since_start=0,
+        )
+
+        self.assertEqual([cache_hash_key], get_client_cache_key(attempt))
+
+    def test_get_cache_key_empty_ip_address(self):
+        """
+        Simulate an empty IP address in the request.
+        """
+
+        empty_ip_address = ""
+
+        cache_hash_digest = md5(empty_ip_address.encode()).hexdigest()
+        cache_hash_key = f"axes-{cache_hash_digest}"
+
+        # Getting cache key from request
+        request_factory = RequestFactory()
+        request = request_factory.post(
+            "/admin/login/",
+            data={"username": self.username, "password": "test"},
+            REMOTE_ADDR=empty_ip_address,
+        )
+
+        self.assertEqual([cache_hash_key], get_client_cache_key(request))
+
+        # Getting cache key from AccessAttempt Object
+        attempt = AccessAttempt(
+            user_agent="<unknown>",
+            ip_address=empty_ip_address,
+            username=self.username,
+            get_data="",
+            post_data="",
+            http_accept=request.META.get("HTTP_ACCEPT", "<unknown>"),
+            path_info=request.META.get("PATH_INFO", "<unknown>"),
+            failures_since_start=0,
+        )
+
+        self.assertEqual([cache_hash_key], get_client_cache_key(attempt))
+
+    def test_get_cache_key_credentials(self):
+        """
+        Test the cache key format.
+        """
+
+        ip_address = self.ip_address
+        cache_hash_digest = md5(ip_address.encode()).hexdigest()
+        cache_hash_key = f"axes-{cache_hash_digest}"
+
+        # Getting cache key from request
+        request_factory = RequestFactory()
+        request = request_factory.post(
+            "/admin/login/", data={"username": self.username, "password": "test"}
+        )
+
+        # Difference between the upper test: new call signature with credentials
+        credentials = {"username": self.username}
+
+        self.assertEqual([cache_hash_key], get_client_cache_key(request, credentials))
+
+        # Getting cache key from AccessAttempt Object
+        attempt = AccessAttempt(
+            user_agent="<unknown>",
+            ip_address=ip_address,
+            username=self.username,
+            get_data="",
+            post_data="",
+            http_accept=request.META.get("HTTP_ACCEPT", "<unknown>"),
+            path_info=request.META.get("PATH_INFO", "<unknown>"),
+            failures_since_start=0,
+        )
+        self.assertEqual([cache_hash_key], get_client_cache_key(attempt))
+
+
+class UsernameTestCase(AxesTestCase):
+    @override_settings(AXES_USERNAME_FORM_FIELD="username")
+    def test_default_get_client_username(self):
+        expected = "test-username"
+
+        request = HttpRequest()
+        request.POST["username"] = expected
+
+        actual = get_client_username(request)
+
+        self.assertEqual(expected, actual)
+
+    def test_default_get_client_username_drf(self):
+        class DRFRequest:
+            def __init__(self):
+                self.data = {}
+                self.POST = {}
+
+        expected = "test-username"
+
+        request = DRFRequest()
+        request.data["username"] = expected
+
+        actual = get_client_username(request)
+
+        self.assertEqual(expected, actual)
+
+    @override_settings(AXES_USERNAME_FORM_FIELD="username")
+    def test_default_get_client_username_credentials(self):
+        expected = "test-username"
+        expected_in_credentials = "test-credentials-username"
+
+        request = HttpRequest()
+        request.POST["username"] = expected
+        credentials = {"username": expected_in_credentials}
+
+        actual = get_client_username(request, credentials)
+
+        self.assertEqual(expected_in_credentials, actual)
+
+    def sample_customize_username(request, credentials):
+        return "prefixed-" + request.POST.get("username")
+
+    @override_settings(AXES_USERNAME_FORM_FIELD="username")
+    @override_settings(AXES_USERNAME_CALLABLE=sample_customize_username)
+    def test_custom_get_client_username_from_request(self):
+        provided = "test-username"
+        expected = "prefixed-" + provided
+        provided_in_credentials = "test-credentials-username"
+
+        request = HttpRequest()
+        request.POST["username"] = provided
+        credentials = {"username": provided_in_credentials}
+
+        actual = get_client_username(request, credentials)
+
+        self.assertEqual(expected, actual)
+
+    def sample_customize_username_credentials(request, credentials):
+        return "prefixed-" + credentials.get("username")
+
+    @override_settings(AXES_USERNAME_FORM_FIELD="username")
+    @override_settings(AXES_USERNAME_CALLABLE=sample_customize_username_credentials)
+    def test_custom_get_client_username_from_credentials(self):
+        provided = "test-username"
+        provided_in_credentials = "test-credentials-username"
+        expected_in_credentials = "prefixed-" + provided_in_credentials
+
+        request = HttpRequest()
+        request.POST["username"] = provided
+        credentials = {"username": provided_in_credentials}
+
+        actual = get_client_username(request, credentials)
+
+        self.assertEqual(expected_in_credentials, actual)
+
+    @override_settings(
+        AXES_USERNAME_CALLABLE=lambda request, credentials: "example"
+    )  # pragma: no cover
+    def test_get_client_username(self):
+        self.assertEqual(get_client_username(HttpRequest(), {}), "example")
+
+    @override_settings(AXES_USERNAME_CALLABLE=lambda request: None)  # pragma: no cover
+    def test_get_client_username_invalid_callable_too_few_arguments(self):
+        with self.assertRaises(TypeError):
+            get_client_username(HttpRequest(), {})
+
+    @override_settings(
+        AXES_USERNAME_CALLABLE=lambda request, credentials, extra: None
+    )  # pragma: no cover
+    def test_get_client_username_invalid_callable_too_many_arguments(self):
+        with self.assertRaises(TypeError):
+            get_client_username(HttpRequest(), {})
+
+    @override_settings(AXES_USERNAME_CALLABLE=True)
+    def test_get_client_username_not_callable(self):
+        with self.assertRaises(TypeError):
+            get_client_username(HttpRequest(), {})
+
+    @override_settings(AXES_USERNAME_CALLABLE="tests.test_helpers.get_username")
+    def test_get_client_username_str(self):
+        self.assertEqual(get_client_username(HttpRequest(), {}), "username")
+
+
+def get_username(request, credentials: dict) -> str:
+    return "username"
+
+
+class IPWhitelistTestCase(AxesTestCase):
+    def setUp(self):
+        self.request = HttpRequest()
+        self.request.method = "POST"
+        self.request.META["REMOTE_ADDR"] = "127.0.0.1"
+        self.request.axes_ip_address = "127.0.0.1"
+
+    @override_settings(AXES_IP_WHITELIST=None)
+    def test_ip_in_whitelist_none(self):
+        self.assertFalse(is_ip_address_in_whitelist("127.0.0.2"))
+
+    @override_settings(AXES_IP_WHITELIST=["127.0.0.1"])
+    def test_ip_in_whitelist(self):
+        self.assertTrue(is_ip_address_in_whitelist("127.0.0.1"))
+        self.assertFalse(is_ip_address_in_whitelist("127.0.0.2"))
+
+    @override_settings(AXES_IP_BLACKLIST=None)
+    def test_ip_in_blacklist_none(self):
+        self.assertFalse(is_ip_address_in_blacklist("127.0.0.2"))
+
+    @override_settings(AXES_IP_BLACKLIST=["127.0.0.1"])
+    def test_ip_in_blacklist(self):
+        self.assertTrue(is_ip_address_in_blacklist("127.0.0.1"))
+        self.assertFalse(is_ip_address_in_blacklist("127.0.0.2"))
+
+    @override_settings(AXES_IP_BLACKLIST=["127.0.0.1"])
+    def test_is_client_ip_address_blacklisted_ip_in_blacklist(self):
+        self.assertTrue(is_client_ip_address_blacklisted(self.request))
+
+    @override_settings(AXES_IP_BLACKLIST=["127.0.0.2"])
+    def test_is_is_client_ip_address_blacklisted_ip_not_in_blacklist(self):
+        self.assertFalse(is_client_ip_address_blacklisted(self.request))
+
+    @override_settings(AXES_NEVER_LOCKOUT_WHITELIST=True)
+    @override_settings(AXES_IP_WHITELIST=["127.0.0.1"])
+    def test_is_client_ip_address_blacklisted_ip_in_whitelist(self):
+        self.assertFalse(is_client_ip_address_blacklisted(self.request))
+
+    @override_settings(AXES_ONLY_WHITELIST=True)
+    @override_settings(AXES_IP_WHITELIST=["127.0.0.2"])
+    def test_is_already_locked_ip_not_in_whitelist(self):
+        self.assertTrue(is_client_ip_address_blacklisted(self.request))
+
+    @override_settings(AXES_NEVER_LOCKOUT_WHITELIST=True)
+    @override_settings(AXES_IP_WHITELIST=["127.0.0.1"])
+    def test_is_client_ip_address_whitelisted_never_lockout(self):
+        self.assertTrue(is_client_ip_address_whitelisted(self.request))
+
+    @override_settings(AXES_ONLY_WHITELIST=True)
+    @override_settings(AXES_IP_WHITELIST=["127.0.0.1"])
+    def test_is_client_ip_address_whitelisted_only_allow(self):
+        self.assertTrue(is_client_ip_address_whitelisted(self.request))
+
+    @override_settings(AXES_ONLY_WHITELIST=True)
+    @override_settings(AXES_IP_WHITELIST=["127.0.0.2"])
+    def test_is_client_ip_address_whitelisted_not(self):
+        self.assertFalse(is_client_ip_address_whitelisted(self.request))
+
+
+class MethodWhitelistTestCase(AxesTestCase):
+    def setUp(self):
+        self.request = HttpRequest()
+        self.request.method = "GET"
+
+    @override_settings(AXES_NEVER_LOCKOUT_GET=True)
+    def test_is_client_method_whitelisted(self):
+        self.assertTrue(is_client_method_whitelisted(self.request))
+
+    @override_settings(AXES_NEVER_LOCKOUT_GET=False)
+    def test_is_client_method_whitelisted_not(self):
+        self.assertFalse(is_client_method_whitelisted(self.request))
+
+
+class LockoutResponseTestCase(AxesTestCase):
+    def setUp(self):
+        self.request = HttpRequest()
+
+    @override_settings(AXES_COOLOFF_TIME=42)
+    def test_get_lockout_response_cool_off(self):
+        get_lockout_response(request=self.request)
+
+    @override_settings(AXES_LOCKOUT_TEMPLATE="example.html")
+    @patch("axes.helpers.render")
+    def test_get_lockout_response_lockout_template(self, render):
+        self.assertFalse(render.called)
+        get_lockout_response(request=self.request)
+        self.assertTrue(render.called)
+
+    @override_settings(AXES_LOCKOUT_URL="https://example.com")
+    def test_get_lockout_response_lockout_url(self):
+        response = get_lockout_response(request=self.request)
+        self.assertEqual(type(response), HttpResponseRedirect)
+
+    def test_get_lockout_response_lockout_json(self):
+        self.request.META["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest"
+        response = get_lockout_response(request=self.request)
+        self.assertEqual(type(response), JsonResponse)
+
+    def test_get_lockout_response_lockout_response(self):
+        response = get_lockout_response(request=self.request)
+        self.assertEqual(type(response), HttpResponse)
+
+def mock_get_cool_off_str():
+    return timedelta(seconds=30)
+
+
+class AxesCoolOffTestCase(AxesTestCase):
+    @override_settings(AXES_COOLOFF_TIME=None)
+    def test_get_cool_off_none(self):
+        self.assertIsNone(get_cool_off())
+
+    @override_settings(AXES_COOLOFF_TIME=2)
+    def test_get_cool_off_int(self):
+        self.assertEqual(get_cool_off(), timedelta(hours=2))
+
+    @override_settings(AXES_COOLOFF_TIME=lambda: timedelta(seconds=30))
+    def test_get_cool_off_callable(self):
+        self.assertEqual(get_cool_off(), timedelta(seconds=30))
+
+    @override_settings(AXES_COOLOFF_TIME="tests.test_helpers.mock_get_cool_off_str")
+    def test_get_cool_off_path(self):
+        self.assertEqual(get_cool_off(), timedelta(seconds=30))
+
+
+def mock_is_whitelisted(request, credentials):
+    return True
+
+
+class AxesWhitelistTestCase(AxesTestCase):
+    def setUp(self):
+        self.user_model = get_user_model()
+        self.user = self.user_model.objects.create(username="jane.doe")
+        self.request = HttpRequest()
+        self.credentials = dict()
+
+    def test_is_whitelisted(self):
+        self.assertFalse(is_user_attempt_whitelisted(self.request, self.credentials))
+
+    @override_settings(AXES_WHITELIST_CALLABLE=mock_is_whitelisted)
+    def test_is_whitelisted_override_callable(self):
+        self.assertTrue(is_user_attempt_whitelisted(self.request, self.credentials))
+
+    @override_settings(AXES_WHITELIST_CALLABLE="tests.test_helpers.mock_is_whitelisted")
+    def test_is_whitelisted_override_path(self):
+        self.assertTrue(is_user_attempt_whitelisted(self.request, self.credentials))
+
+    @override_settings(AXES_WHITELIST_CALLABLE=42)
+    def test_is_whitelisted_override_invalid(self):
+        with self.assertRaises(TypeError):
+            is_user_attempt_whitelisted(self.request, self.credentials)
+
+
+def mock_get_lockout_response(request, credentials):
+    return HttpResponse(status=400)
+
+
+class AxesLockoutTestCase(AxesTestCase):
+    def setUp(self):
+        self.request = HttpRequest()
+        self.credentials = dict()
+
+    def test_get_lockout_response(self):
+        response = get_lockout_response(self.request, self.credentials)
+        self.assertEqual(403, response.status_code)
+
+    @override_settings(AXES_LOCKOUT_CALLABLE=mock_get_lockout_response)
+    def test_get_lockout_response_override_callable(self):
+        response = get_lockout_response(self.request, self.credentials)
+        self.assertEqual(400, response.status_code)
+
+    @override_settings(
+        AXES_LOCKOUT_CALLABLE="tests.test_helpers.mock_get_lockout_response"
+    )
+    def test_get_lockout_response_override_path(self):
+        response = get_lockout_response(self.request, self.credentials)
+        self.assertEqual(400, response.status_code)
+
+    @override_settings(AXES_LOCKOUT_CALLABLE=42)
+    def test_get_lockout_response_override_invalid(self):
+        with self.assertRaises(TypeError):
+            get_lockout_response(self.request, self.credentials)

+ 121 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_logging.py

@@ -0,0 +1,121 @@
+from unittest.mock import patch
+
+from django.test import override_settings
+from django.urls import reverse
+
+from axes.apps import AppConfig
+from axes.models import AccessAttempt, AccessLog
+from tests.base import AxesTestCase
+
+
+@patch("axes.apps.AppConfig.initialized", False)
+@patch("axes.apps.log")
+class AppsTestCase(AxesTestCase):
+    def test_axes_config_log_re_entrant(self, log):
+        """
+        Test that initialize call count does not increase on repeat calls.
+        """
+
+        AppConfig.initialize()
+        calls = log.info.call_count
+
+        AppConfig.initialize()
+        self.assertTrue(
+            calls == log.info.call_count and calls > 0,
+            "AxesConfig.initialize needs to be re-entrant",
+        )
+
+    @override_settings(AXES_VERBOSE=False)
+    def test_axes_config_log_not_verbose(self, log):
+        AppConfig.initialize()
+        self.assertFalse(log.info.called)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_axes_config_log_user_only(self, log):
+        AppConfig.initialize()
+        log.info.assert_called_with("AXES: blocking by username only.")
+
+    @override_settings(AXES_ONLY_USER_FAILURES=False)
+    def test_axes_config_log_ip_only(self, log):
+        AppConfig.initialize()
+        log.info.assert_called_with("AXES: blocking by IP only.")
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_axes_config_log_user_ip(self, log):
+        AppConfig.initialize()
+        log.info.assert_called_with("AXES: blocking by combination of username and IP.")
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_axes_config_log_user_or_ip(self, log):
+        AppConfig.initialize()
+        log.info.assert_called_with("AXES: blocking by username or IP.")
+
+
+class AccessLogTestCase(AxesTestCase):
+    def test_access_log_on_logout(self):
+        """
+        Test a valid logout and make sure the logout_time is updated.
+        """
+
+        self.login(is_valid_username=True, is_valid_password=True)
+        self.assertIsNone(AccessLog.objects.latest("id").logout_time)
+
+        response = self.client.get(reverse("admin:logout"))
+        self.assertContains(response, "Logged out")
+
+        self.assertIsNotNone(AccessLog.objects.latest("id").logout_time)
+
+    def test_log_data_truncated(self):
+        """
+        Test that get_query_str properly truncates data to the max_length (default 1024).
+        """
+
+        # An impossibly large post dict
+        extra_data = {"a" * x: x for x in range(1024)}
+        self.login(**extra_data)
+        self.assertEqual(len(AccessAttempt.objects.latest("id").post_data), 1024)
+
+    @override_settings(AXES_DISABLE_ACCESS_LOG=True)
+    def test_valid_logout_without_success_log(self):
+        AccessLog.objects.all().delete()
+
+        response = self.login(is_valid_username=True, is_valid_password=True)
+        response = self.client.get(reverse("admin:logout"))
+
+        self.assertEqual(AccessLog.objects.all().count(), 0)
+        self.assertContains(response, "Logged out", html=True)
+
+    @override_settings(AXES_DISABLE_ACCESS_LOG=True)
+    def test_valid_login_without_success_log(self):
+        """
+        Test that a valid login does not generate an AccessLog when DISABLE_SUCCESS_ACCESS_LOG is True.
+        """
+
+        AccessLog.objects.all().delete()
+
+        response = self.login(is_valid_username=True, is_valid_password=True)
+
+        self.assertEqual(response.status_code, 302)
+        self.assertEqual(AccessLog.objects.all().count(), 0)
+
+    @override_settings(AXES_DISABLE_ACCESS_LOG=True)
+    def test_valid_logout_without_log(self):
+        AccessLog.objects.all().delete()
+
+        response = self.login(is_valid_username=True, is_valid_password=True)
+        response = self.client.get(reverse("admin:logout"))
+
+        self.assertEqual(AccessLog.objects.count(), 0)
+        self.assertContains(response, "Logged out", html=True)
+
+    @override_settings(AXES_DISABLE_ACCESS_LOG=True)
+    def test_non_valid_login_without_log(self):
+        """
+        Test that a non-valid login does generate an AccessLog when DISABLE_ACCESS_LOG is True.
+        """
+        AccessLog.objects.all().delete()
+
+        response = self.login(is_valid_username=True, is_valid_password=False)
+        self.assertEqual(response.status_code, 200)
+
+        self.assertEqual(AccessLog.objects.all().count(), 0)

+ 644 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_login.py

@@ -0,0 +1,644 @@
+"""
+Integration tests for the login handling.
+
+TODO: Clean up the tests in this module.
+"""
+
+from importlib import import_module
+
+from django.contrib.auth import get_user_model, login, logout
+from django.http import HttpRequest
+from django.test import override_settings, TestCase
+from django.urls import reverse
+
+from axes.conf import settings
+from axes.helpers import get_cache, make_cache_key_list
+from axes.models import AccessAttempt
+from tests.base import AxesTestCase
+
+
+class DjangoLoginTestCase(TestCase):
+    def setUp(self):
+        engine = import_module(settings.SESSION_ENGINE)
+
+        self.request = HttpRequest()
+        self.request.session = engine.SessionStore()
+
+        self.username = "john.doe"
+        self.password = "hunter2"
+
+        self.user = get_user_model().objects.create(username=self.username)
+        self.user.set_password(self.password)
+        self.user.save()
+        self.user.backend = "django.contrib.auth.backends.ModelBackend"
+
+
+class DjangoContribAuthLoginTestCase(DjangoLoginTestCase):
+    def test_login(self):
+        login(self.request, self.user)
+
+    def test_logout(self):
+        login(self.request, self.user)
+        logout(self.request)
+
+
+@override_settings(AXES_ENABLED=False)
+class DjangoTestClientLoginTestCase(DjangoLoginTestCase):
+    def test_client_login(self):
+        self.client.login(username=self.username, password=self.password)
+
+    def test_client_logout(self):
+        self.client.login(username=self.username, password=self.password)
+        self.client.logout()
+
+    def test_client_force_login(self):
+        self.client.force_login(self.user)
+
+
+class DatabaseLoginTestCase(AxesTestCase):
+    """
+    Test for lockouts under different configurations and circumstances to prevent false positives and false negatives.
+
+    Always block attempted logins for the same user from the same IP.
+    Always allow attempted logins for a different user from a different IP.
+    """
+
+    IP_1 = "10.1.1.1"
+    IP_2 = "10.2.2.2"
+    IP_3 = "10.2.2.3"
+    USER_1 = "valid-user-1"
+    USER_2 = "valid-user-2"
+    USER_3 = "valid-user-3"
+    EMAIL_1 = "valid-email-1@example.com"
+    EMAIL_2 = "valid-email-2@example.com"
+
+    VALID_USERNAME = USER_1
+    VALID_EMAIL = EMAIL_1
+    VALID_PASSWORD = "valid-password"
+
+    VALID_IP_ADDRESS = IP_1
+
+    WRONG_PASSWORD = "wrong-password"
+    LOCKED_MESSAGE = "Account locked: too many login attempts."
+    LOGIN_FORM_KEY = '<input type="submit" value="Log in" />'
+    ATTEMPT_NOT_BLOCKED = 200
+    ALLOWED = 302
+    BLOCKED = 403
+
+    def _login(self, username, password, ip_addr="127.0.0.1", **kwargs):
+        """
+        Login a user and get the response.
+
+        IP address can be configured to test IP blocking functionality.
+        """
+
+        post_data = {"username": username, "password": password}
+
+        post_data.update(kwargs)
+
+        return self.client.post(
+            reverse("admin:login"),
+            post_data,
+            REMOTE_ADDR=ip_addr,
+            HTTP_USER_AGENT="test-browser",
+        )
+
+    def _lockout_user_from_ip(self, username, ip_addr):
+        for _ in range(settings.AXES_FAILURE_LIMIT):
+            response = self._login(
+                username=username, password=self.WRONG_PASSWORD, ip_addr=ip_addr
+            )
+        return response
+
+    def _lockout_user1_from_ip1(self):
+        return self._lockout_user_from_ip(username=self.USER_1, ip_addr=self.IP_1)
+
+    def setUp(self):
+        """
+        Create two valid users for authentication.
+        """
+
+        super().setUp()
+
+        self.user2 = get_user_model().objects.create_superuser(
+            username=self.USER_2,
+            email=self.EMAIL_2,
+            password=self.VALID_PASSWORD,
+            is_staff=True,
+            is_superuser=True,
+        )
+
+    def test_login(self):
+        """
+        Test a valid login for a real username.
+        """
+
+        response = self._login(self.username, self.password)
+        self.assertNotContains(
+            response, self.LOGIN_FORM_KEY, status_code=self.ALLOWED, html=True
+        )
+
+    def test_lockout_limit_once(self):
+        """
+        Test the login lock trying to login one more time than failure limit.
+        """
+
+        response = self.lockout()
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+    def test_lockout_limit_many(self):
+        """
+        Test the login lock trying to login a lot of times more than failure limit.
+        """
+
+        self.lockout()
+
+        for _ in range(settings.AXES_FAILURE_LIMIT):
+            response = self.login()
+            self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+    def attempt_count(self):
+        return AccessAttempt.objects.count()
+
+    @override_settings(AXES_RESET_ON_SUCCESS=False)
+    def test_reset_on_success_false(self):
+        self.almost_lockout()
+        self.login(is_valid_username=True, is_valid_password=True)
+
+        response = self.login()
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+        self.assertTrue(self.attempt_count())
+
+    @override_settings(AXES_RESET_ON_SUCCESS=True)
+    def test_reset_on_success_true(self):
+        self.almost_lockout()
+        self.assertTrue(self.attempt_count())
+
+        self.login(is_valid_username=True, is_valid_password=True)
+        self.assertFalse(self.attempt_count())
+
+        response = self.lockout()
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+        self.assertTrue(self.attempt_count())
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_combination_user_and_ip(self):
+        """
+        Test login failure when AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP is True.
+        """
+
+        # test until one try before the limit
+        for _ in range(1, settings.AXES_FAILURE_LIMIT):
+            response = self.login(is_valid_username=True, is_valid_password=False)
+            # Check if we are in the same login page
+            self.assertContains(response, self.LOGIN_FORM_KEY, html=True)
+
+        # So, we shouldn't have gotten a lock-out yet.
+        # But we should get one now
+        response = self.login(is_valid_username=True, is_valid_password=False)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=403)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_only_user_failures(self):
+        """
+        Test login failure when AXES_ONLY_USER_FAILURES is True.
+        """
+
+        # test until one try before the limit
+        for _ in range(1, settings.AXES_FAILURE_LIMIT):
+            response = self._login(self.username, self.WRONG_PASSWORD)
+
+            # Check if we are in the same login page
+            self.assertContains(response, self.LOGIN_FORM_KEY, html=True)
+
+        # So, we shouldn't have gotten a lock-out yet.
+        # But we should get one now
+        response = self._login(self.username, self.WRONG_PASSWORD)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+        # reset the username only and make sure we can log in now even though our IP has failed each time
+        self.reset(username=self.username)
+
+        response = self._login(self.username, self.password)
+
+        # Check if we are still in the login page
+        self.assertNotContains(
+            response, self.LOGIN_FORM_KEY, status_code=self.ALLOWED, html=True
+        )
+
+        # now create failure_limit + 1 failed logins and then we should still
+        # be able to login with valid_username
+        for _ in range(settings.AXES_FAILURE_LIMIT):
+            response = self._login(self.username, self.password)
+
+        # Check if we can still log in with valid user
+        response = self._login(self.username, self.password)
+        self.assertNotContains(
+            response, self.LOGIN_FORM_KEY, status_code=self.ALLOWED, html=True
+        )
+
+    # Test for true and false positives when blocking by IP *OR* user (default)
+    # Cache disabled. Default settings.
+    def test_lockout_by_ip_blocks_when_same_user_same_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    def test_lockout_by_ip_allows_when_same_user_diff_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 can still login from IP 2.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    def test_lockout_by_ip_blocks_when_diff_user_same_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 is also locked out from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    def test_lockout_by_ip_allows_when_diff_user_diff_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    # Test for true and false positives when blocking by user only.
+    # Cache disabled. When AXES_ONLY_USER_FAILURES = True
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_blocks_when_same_user_same_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_blocks_when_same_user_diff_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is also locked out from IP 2.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_allows_when_diff_user_same_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_allows_when_diff_user_diff_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_with_empty_username_allows_other_users_without_cache(self):
+        # User with empty username is locked out from IP 1.
+        self._lockout_user_from_ip(username="", ip_addr=self.IP_1)
+
+        # Still possible to access the login page
+        response = self.client.get(reverse("admin:login"), REMOTE_ADDR=self.IP_1)
+        self.assertContains(response, self.LOGIN_FORM_KEY, status_code=200, html=True)
+
+    # Test for true and false positives when blocking by user and IP together.
+    # Cache disabled. When LOCK_OUT_BY_COMBINATION_USER_AND_IP = True
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_blocks_when_same_user_same_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_allows_when_same_user_diff_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 can still login from IP 2.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_allows_when_diff_user_same_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_allows_when_diff_user_diff_ip_without_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_with_empty_username_allows_other_users_without_cache(
+        self,
+    ):
+        # User with empty username is locked out from IP 1.
+        self._lockout_user_from_ip(username="", ip_addr=self.IP_1)
+
+        # Still possible to access the login page
+        response = self.client.get(reverse("admin:login"), REMOTE_ADDR=self.IP_1)
+        self.assertContains(response, self.LOGIN_FORM_KEY, status_code=200, html=True)
+
+    # Test for true and false positives when blocking by IP *OR* user (default)
+    # With cache enabled. Default criteria.
+    def test_lockout_by_ip_blocks_when_same_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    def test_lockout_by_ip_allows_when_same_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 can still login from IP 2.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    def test_lockout_by_ip_blocks_when_diff_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 is also locked out from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    def test_lockout_by_ip_allows_when_diff_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_with_empty_username_allows_other_users_using_cache(self):
+        # User with empty username is locked out from IP 1.
+        self._lockout_user_from_ip(username="", ip_addr=self.IP_1)
+
+        # Still possible to access the login page
+        response = self.client.get(reverse("admin:login"), REMOTE_ADDR=self.IP_1)
+        self.assertContains(response, self.LOGIN_FORM_KEY, status_code=200, html=True)
+
+    # Test for true and false positives when blocking by user only.
+    # With cache enabled. When AXES_ONLY_USER_FAILURES = True
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_blocks_when_same_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_blocks_when_same_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is also locked out from IP 2.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_allows_when_diff_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_ONLY_USER_FAILURES=True)
+    def test_lockout_by_user_allows_when_diff_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    # Test for true and false positives when blocking by user and IP together.
+    # With cache enabled. When LOCK_OUT_BY_COMBINATION_USER_AND_IP = True
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_blocks_when_same_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_allows_when_same_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 can still login from IP 2.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_allows_when_diff_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_allows_when_diff_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(
+        AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True, AXES_FAILURE_LIMIT=2
+    )
+    def test_lockout_by_user_and_ip_allows_when_diff_user_same_ip_using_cache_multiple_attempts(
+        self,
+    ):
+        # User 1 is locked out from IP 1.
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, self.IP_1)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # Second attempt from different IP
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, self.IP_2)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # Second attempt from same IP, different username
+        response = self._login(self.USER_2, self.WRONG_PASSWORD, self.IP_1)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # User 1 is blocked from IP 1
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, ip_addr=self.IP_1)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+        # User 1 is blocked from IP 2
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, ip_addr=self.IP_2)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+        # User 2 can still login from IP 2, only he has 1 attempt left
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP=True)
+    def test_lockout_by_user_and_ip_with_empty_username_allows_other_users_using_cache(
+        self,
+    ):
+        # User with empty username is locked out from IP 1.
+        self._lockout_user_from_ip(username="", ip_addr=self.IP_1)
+
+        # Still possible to access the login page
+        response = self.client.get(reverse("admin:login"), REMOTE_ADDR=self.IP_1)
+        self.assertContains(response, self.LOGIN_FORM_KEY, status_code=200, html=True)
+
+    # Test for true and false positives when blocking by user or IP together.
+    # With cache enabled. When AXES_LOCK_OUT_BY_USER_OR_IP = True
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_lockout_by_user_or_ip_blocks_when_same_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is still blocked from IP 1.
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_lockout_by_user_or_ip_allows_when_same_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 1 is blocked out from IP 1
+        response = self._login(self.USER_1, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_lockout_by_user_or_ip_allows_when_diff_user_same_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 1.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_1)
+        self.assertEqual(response.status_code, self.BLOCKED)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True, AXES_FAILURE_LIMIT=3)
+    def test_lockout_by_user_or_ip_allows_when_diff_user_same_ip_using_cache_multiple_attempts(
+        self,
+    ):
+        # User 1 is locked out from IP 1.
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, self.IP_1)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # Second attempt from different IP
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, self.IP_2)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # User 1 is blocked on all IPs, he reached 2 attempts
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, ip_addr=self.IP_2)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, ip_addr=self.IP_3)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+        # IP 1 has still one attempt left
+        response = self._login(self.USER_2, self.WRONG_PASSWORD, self.IP_1)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # But now IP 1 is blocked for all attempts
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, ip_addr=self.IP_1)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+        response = self._login(self.USER_2, self.WRONG_PASSWORD, ip_addr=self.IP_1)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+        response = self._login(self.USER_3, self.WRONG_PASSWORD, ip_addr=self.IP_1)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True, AXES_FAILURE_LIMIT=3)
+    def test_lockout_by_user_or_ip_allows_when_diff_user_same_ip_using_cache_multiple_failed_attempts(
+        self,
+    ):
+        """ Test, if the failed attempts make also impact on the attempt count """
+        # User 1 is locked out from IP 1.
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, self.IP_1)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # Second attempt from different IP
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, self.IP_2)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # Second attempt from same IP, different username
+        response = self._login(self.USER_2, self.WRONG_PASSWORD, self.IP_1)
+        self.assertEqual(response.status_code, self.ATTEMPT_NOT_BLOCKED)
+
+        # User 1 is blocked from IP 2
+        response = self._login(self.USER_1, self.WRONG_PASSWORD, ip_addr=self.IP_2)
+        self.assertContains(response, self.LOCKED_MESSAGE, status_code=self.BLOCKED)
+
+        # On IP 2 it is only 2. attempt, for user 2 it is also 2. attempt -> allow log in
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_lockout_by_user_or_ip_allows_when_diff_user_diff_ip_using_cache(self):
+        # User 1 is locked out from IP 1.
+        self._lockout_user1_from_ip1()
+
+        # User 2 can still login from IP 2.
+        response = self._login(self.USER_2, self.VALID_PASSWORD, ip_addr=self.IP_2)
+        self.assertEqual(response.status_code, self.ALLOWED)
+
+    @override_settings(AXES_LOCK_OUT_BY_USER_OR_IP=True)
+    def test_lockout_by_user_or_ip_with_empty_username_allows_other_users_using_cache(
+        self,
+    ):
+        # User with empty username is locked out from IP 1.
+        self._lockout_user_from_ip(username="", ip_addr=self.IP_1)
+
+        # Still possible to access the login page
+        response = self.client.get(reverse("admin:login"), REMOTE_ADDR=self.IP_1)
+        self.assertContains(response, self.LOGIN_FORM_KEY, status_code=200, html=True)
+
+
+# Test the same logic with cache handler
+@override_settings(AXES_HANDLER="axes.handlers.cache.AxesCacheHandler")
+class CacheLoginTestCase(DatabaseLoginTestCase):
+    def attempt_count(self):
+        cache = get_cache()
+        keys = cache._cache
+        return len(keys)
+
+    def reset(self, **kwargs):
+        get_cache().delete(make_cache_key_list([kwargs])[0])

+ 109 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_management.py

@@ -0,0 +1,109 @@
+from io import StringIO
+from unittest.mock import patch, Mock
+
+from django.core.management import call_command
+from django.utils import timezone
+
+from axes.models import AccessAttempt, AccessLog
+from tests.base import AxesTestCase
+
+
+class ResetAccessLogsManagementCommandTestCase(AxesTestCase):
+    def setUp(self):
+        self.msg_not_found = "No logs found.\n"
+        self.msg_num_found = "{} logs removed.\n"
+
+        days_3 = timezone.now() - timezone.timedelta(days=3)
+        with patch("django.utils.timezone.now", Mock(return_value=days_3)):
+            AccessLog.objects.create()
+
+        days_13 = timezone.now() - timezone.timedelta(days=9)
+        with patch("django.utils.timezone.now", Mock(return_value=days_13)):
+            AccessLog.objects.create()
+
+        days_30 = timezone.now() - timezone.timedelta(days=27)
+        with patch("django.utils.timezone.now", Mock(return_value=days_30)):
+            AccessLog.objects.create()
+
+    def test_axes_delete_access_logs_default(self):
+        out = StringIO()
+        call_command("axes_reset_logs", stdout=out)
+        self.assertEqual(self.msg_not_found, out.getvalue())
+
+    def test_axes_delete_access_logs_older_than_2_days(self):
+        out = StringIO()
+        call_command("axes_reset_logs", age=2, stdout=out)
+        self.assertEqual(self.msg_num_found.format(3), out.getvalue())
+
+    def test_axes_delete_access_logs_older_than_4_days(self):
+        out = StringIO()
+        call_command("axes_reset_logs", age=4, stdout=out)
+        self.assertEqual(self.msg_num_found.format(2), out.getvalue())
+
+    def test_axes_delete_access_logs_older_than_16_days(self):
+        out = StringIO()
+        call_command("axes_reset_logs", age=16, stdout=out)
+        self.assertEqual(self.msg_num_found.format(1), out.getvalue())
+
+
+class ManagementCommandTestCase(AxesTestCase):
+    def setUp(self):
+        AccessAttempt.objects.create(
+            username="jane.doe", ip_address="10.0.0.1", failures_since_start="4"
+        )
+
+        AccessAttempt.objects.create(
+            username="john.doe", ip_address="10.0.0.2", failures_since_start="15"
+        )
+
+    def test_axes_list_attempts(self):
+        out = StringIO()
+        call_command("axes_list_attempts", stdout=out)
+
+        expected = "10.0.0.1\tjane.doe\t4\n10.0.0.2\tjohn.doe\t15\n"
+        self.assertEqual(expected, out.getvalue())
+
+    def test_axes_reset(self):
+        out = StringIO()
+        call_command("axes_reset", stdout=out)
+
+        expected = "2 attempts removed.\n"
+        self.assertEqual(expected, out.getvalue())
+
+    def test_axes_reset_not_found(self):
+        out = StringIO()
+        call_command("axes_reset", stdout=out)
+
+        out = StringIO()
+        call_command("axes_reset", stdout=out)
+
+        expected = "No attempts found.\n"
+        self.assertEqual(expected, out.getvalue())
+
+    def test_axes_reset_ip(self):
+        out = StringIO()
+        call_command("axes_reset_ip", "10.0.0.1", stdout=out)
+
+        expected = "1 attempts removed.\n"
+        self.assertEqual(expected, out.getvalue())
+
+    def test_axes_reset_ip_not_found(self):
+        out = StringIO()
+        call_command("axes_reset_ip", "10.0.0.3", stdout=out)
+
+        expected = "No attempts found.\n"
+        self.assertEqual(expected, out.getvalue())
+
+    def test_axes_reset_username(self):
+        out = StringIO()
+        call_command("axes_reset_username", "john.doe", stdout=out)
+
+        expected = "1 attempts removed.\n"
+        self.assertEqual(expected, out.getvalue())
+
+    def test_axes_reset_username_not_found(self):
+        out = StringIO()
+        call_command("axes_reset_username", "ivan.renko", stdout=out)
+
+        expected = "No attempts found.\n"
+        self.assertEqual(expected, out.getvalue())

+ 38 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_middleware.py

@@ -0,0 +1,38 @@
+from django.http import HttpResponse, HttpRequest
+from django.test import override_settings
+
+from axes.middleware import AxesMiddleware
+from tests.base import AxesTestCase
+
+
+class MiddlewareTestCase(AxesTestCase):
+    STATUS_SUCCESS = 200
+    STATUS_LOCKOUT = 403
+
+    def setUp(self):
+        self.request = HttpRequest()
+
+    def test_success_response(self):
+        def get_response(request):
+            request.axes_locked_out = False
+            return HttpResponse()
+
+        response = AxesMiddleware(get_response)(self.request)
+        self.assertEqual(response.status_code, self.STATUS_SUCCESS)
+
+    def test_lockout_response(self):
+        def get_response(request):
+            request.axes_locked_out = True
+            return HttpResponse()
+
+        response = AxesMiddleware(get_response)(self.request)
+        self.assertEqual(response.status_code, self.STATUS_LOCKOUT)
+
+    @override_settings(AXES_ENABLED=False)
+    def test_respects_enabled_switch(self):
+        def get_response(request):
+            request.axes_locked_out = True
+            return HttpResponse()
+
+        response = AxesMiddleware(get_response)(self.request)
+        self.assertEqual(response.status_code, self.STATUS_SUCCESS)

+ 36 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_models.py

@@ -0,0 +1,36 @@
+from django.apps.registry import apps
+from django.db import connection
+from django.db.migrations.autodetector import MigrationAutodetector
+from django.db.migrations.executor import MigrationExecutor
+from django.db.migrations.state import ProjectState
+
+from axes.models import AccessAttempt, AccessLog
+from tests.base import AxesTestCase
+
+
+class ModelsTestCase(AxesTestCase):
+    def setUp(self):
+        self.failures_since_start = 42
+
+        self.access_attempt = AccessAttempt(
+            failures_since_start=self.failures_since_start
+        )
+        self.access_log = AccessLog()
+
+    def test_access_attempt_str(self):
+        self.assertIn("Access", str(self.access_attempt))
+
+    def test_access_log_str(self):
+        self.assertIn("Access", str(self.access_log))
+
+
+class MigrationsTestCase(AxesTestCase):
+    def test_missing_migrations(self):
+        executor = MigrationExecutor(connection)
+        autodetector = MigrationAutodetector(
+            executor.loader.project_state(), ProjectState.from_apps(apps)
+        )
+
+        changes = autodetector.changes(graph=executor.loader.graph)
+
+        self.assertEqual({}, changes)

+ 18 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/test_signals.py

@@ -0,0 +1,18 @@
+from unittest.mock import MagicMock
+
+from axes.signals import user_locked_out
+from tests.base import AxesTestCase
+
+
+class SignalTestCase(AxesTestCase):
+    def test_send_lockout_signal(self):
+        """
+        Test if the lockout signal is correctly emitted when user is locked out.
+        """
+
+        handler = MagicMock()
+        user_locked_out.connect(handler)
+
+        self.assertEqual(0, handler.call_count)
+        self.lockout()
+        self.assertEqual(1, handler.call_count)

+ 5 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/urls.py

@@ -0,0 +1,5 @@
+from django.contrib import admin
+from django.urls import path
+
+
+urlpatterns = [path("admin/", admin.site.urls)]

+ 1 - 0
desktop/core/ext-py3/django-axes-5.13.0/tests/urls_empty.py

@@ -0,0 +1 @@
+urlpatterns: list = []