mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
[PR #11444/ccf61224 backport][stable-12] keycloak_client: 11443: Fix false change detection for null client attributes (#11451)
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.
---------
(cherry picked from commit ccf61224f1)
Co-authored-by: thomasbargetz <thomas.bargetz@gmail.com>
Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user