From 86baf7bd69e971e32002071bb7a9c19b310baa98 Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 4 Aug 2022 14:42:17 +0200 Subject: [PATCH] [sso-admin] Add compatibility keys in outgoing API --- dd-sso/admin/src/admin/lib/callbacks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dd-sso/admin/src/admin/lib/callbacks.py b/dd-sso/admin/src/admin/lib/callbacks.py index f197910..3298c20 100644 --- a/dd-sso/admin/src/admin/lib/callbacks.py +++ b/dd-sso/admin/src/admin/lib/callbacks.py @@ -36,6 +36,9 @@ def user_parser(dduser: DDUser) -> DDUser: user["keycloak_id"] = user.pop("id") user["role"] = user["roles"][0] if user.get("roles", []) else None user["groups"] = user.get("groups", user.get("keycloak_groups", [])) + # Compatibility for the API + user["first"] = user["firstname"] + user["last"] = user["lasttname"] return user