From f6af725ef63549e0483aaacc9602a2f45e79558f Mon Sep 17 00:00:00 2001 From: Juha Louhiranta Date: Tue, 24 Mar 2026 16:06:17 +0200 Subject: [PATCH 1/2] chore: bump commitlint Refs: PT-2026 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61feaefe..28c6f379 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: # Run the formatter. - id: ruff-format - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.22.0 + rev: v9.24.0 hooks: - id: commitlint stages: [ commit-msg, manual ] From c62e9b0787f7da61e0813f525126058b65a32da9 Mon Sep 17 00:00:00 2001 From: Juha Louhiranta Date: Tue, 24 Mar 2026 15:44:29 +0200 Subject: [PATCH 2/2] feat: django-axes prefers forwarded ip address Prioritize `HTTP_X_FORWARDED_FOR` for django-axes similar to audit logs with the get_client_ip. Refs: PT-2026 --- palvelutarjotin/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/palvelutarjotin/settings.py b/palvelutarjotin/settings.py index 29c98682..8ca46cb6 100644 --- a/palvelutarjotin/settings.py +++ b/palvelutarjotin/settings.py @@ -447,6 +447,8 @@ def sentry_traces_sampler(sampling_context: SamplingContext) -> float: AXES_FAILURE_LIMIT = 5 AXES_COOLOFF_TIME = 1 # hour after locked out, user will be able to attempt login +AXES_IPWARE_META_PRECEDENCE_ORDER = ["HTTP_X_FORWARDED_FOR", "REMOTE_ADDR"] +AXES_IPWARE_PROXY_COUNT = 1 LOGGING = { "version": 1,