From f810fc1cd66af6bf6ed81f7606385848ba324fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 18 May 2023 19:46:48 +0200 Subject: [PATCH] Fixed backward compat issue --- actor/src/udsactor/rest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/actor/src/udsactor/rest.py b/actor/src/udsactor/rest.py index b7fe21ec6..2d149e4bb 100644 --- a/actor/src/udsactor/rest.py +++ b/actor/src/udsactor/rest.py @@ -283,6 +283,24 @@ class UDSServerApi(UDSApi): } r = self._doPost('initialize', payload) os = r['os'] + # * TO BE REMOVED ON FUTURE VERSIONS * + # To keep compatibility, store old values on custom data + # This will be removed in future versions + # The values stored are: + # username=os.get('username'), + # password=os.get('password'), + # new_password=os.get('new_password'), + # domain=os.get('ad'), + # ou=os.get('ou'), + # So update custom data with this info + custom = os.get('custom', {}) + for i in ('username', 'password', 'new_password', 'ad', 'ou'): + # ad is converted to domain + if i not in os: + continue # Skip if not present on os, do not overwrite custom + name = 'domain' if i == 'ad' else i + custom[name] = os[i] # os[i] is present, so force it on custom + return types.InitializationResultType( own_token=r['own_token'], unique_id=r['unique_id'].lower() if r['unique_id'] else None,