[sso-admin] Add compatibility keys in outgoing API

mejoras_instalacion
Evilham 2022-08-04 14:42:17 +02:00
parent 822ed98ab4
commit 86baf7bd69
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
1 changed files with 3 additions and 0 deletions

View File

@ -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