policies/reputation: trigger save on update

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-01-05 22:06:20 +01:00
parent 5a2c367e89
commit 91dd33cee6
1 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from structlog.stdlib import get_logger
from authentik.lib.config import CONFIG
from authentik.lib.utils.http import get_client_ip
from authentik.policies.reputation.models import CACHE_KEY_PREFIX
from authentik.policies.reputation.tasks import save_reputation
from authentik.stages.identification.signals import identification_failed
LOGGER = get_logger()
@ -31,6 +32,7 @@ def update_score(request: HttpRequest, identifier: str, amount: int):
LOGGER.warning("failed to set reputation", exc=exc)
LOGGER.debug("Updated score", amount=amount, for_user=identifier, for_ip=remote_ip)
save_reputation.delay()
@receiver(user_login_failed)