From 3d6692331079ed57400e819ec304718ea68f3296 Mon Sep 17 00:00:00 2001 From: Jens L Date: Wed, 15 Nov 2023 21:56:16 +0100 Subject: [PATCH] events: sanitize functions (#7587) Signed-off-by: Jens Langhammer --- authentik/events/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/authentik/events/utils.py b/authentik/events/utils.py index 59919e54d..d910e4a2d 100644 --- a/authentik/events/utils.py +++ b/authentik/events/utils.py @@ -153,6 +153,12 @@ def sanitize_item(value: Any) -> Any: return value.isoformat() if isinstance(value, timedelta): return str(value.total_seconds()) + if callable(value): + return { + "type": "callable", + "name": value.__name__, + "module": value.__module__, + } return value