mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
keycloak_client: 11443: Fix false change detection for null client attributes (#11444)
* 11443: fix diff for keycloak_client module for non existing client attributes * 11443: code cleanup * 11443: add changelog fragment * Adjust changelog fragment. --------- Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
53e1e86bcc
commit
ccf61224f1
2 changed files with 7 additions and 1 deletions
|
|
@ -1319,7 +1319,11 @@ def main():
|
|||
new_param_value = flow_binding_from_dict_to_model(new_param_value, realm, kc)
|
||||
elif client_param == "attributes" and "attributes" in before_client:
|
||||
attributes_copy = copy.deepcopy(before_client["attributes"])
|
||||
attributes_copy.update(new_param_value)
|
||||
# Merge client attributes while excluding null-valued attributes that are not present in Keycloak's response.
|
||||
# This ensures idempotency by treating absent attributes and null attributes as equivalent.
|
||||
attributes_copy.update(
|
||||
{key: value for key, value in new_param_value.items() if value is not None or key in attributes_copy}
|
||||
)
|
||||
new_param_value = attributes_copy
|
||||
elif client_param in ["clientScopesBehavior", "client_scopes_behavior"]:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue