From 3891fb3fa8b1354bd39cf2ed3da8e1a4eeee81d0 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 23:24:13 +0100 Subject: [PATCH] events: sanitize functions (cherry-pick #7587) (#7589) events: sanitize functions (#7587) Signed-off-by: Jens Langhammer Co-authored-by: Jens L --- 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