From dd74e29558a110b749425cf07ec48fbac02879e6 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 09:10:29 +0200 Subject: [PATCH] [PR #8223/f55342d8 backport][stable-8] keycloak_client: add sorted defaultClientScopes and optionalClientScopes to normalizations (#8254) keycloak_client: add sorted defaultClientScopes and optionalClientScopes to normalizations (#8223) keycloak_client: add sorted defaultClientScopes and optionalClientScopes to normalizations Signed-off-by: Eike Waldt (cherry picked from commit f55342d8afc0c14e9ebf16d2e7bc13d1d7e31fd5) Co-authored-by: Eike Waldt --- .../8223-keycloak_client-additional-normalizations.yaml | 2 ++ plugins/modules/keycloak_client.py | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 changelogs/fragments/8223-keycloak_client-additional-normalizations.yaml diff --git a/changelogs/fragments/8223-keycloak_client-additional-normalizations.yaml b/changelogs/fragments/8223-keycloak_client-additional-normalizations.yaml new file mode 100644 index 0000000000..47f7e6bd7b --- /dev/null +++ b/changelogs/fragments/8223-keycloak_client-additional-normalizations.yaml @@ -0,0 +1,2 @@ +bugfixes: + - keycloak_client - add sorted ``defaultClientScopes`` and ``optionalClientScopes`` to normalizations (https://github.com/ansible-collections/community.general/pull/8223). diff --git a/plugins/modules/keycloak_client.py b/plugins/modules/keycloak_client.py index 0766608b45..cd9c60bacf 100644 --- a/plugins/modules/keycloak_client.py +++ b/plugins/modules/keycloak_client.py @@ -744,6 +744,12 @@ def normalise_cr(clientrep, remove_ids=False): if 'attributes' in clientrep: clientrep['attributes'] = list(sorted(clientrep['attributes'])) + if 'defaultClientScopes' in clientrep: + clientrep['defaultClientScopes'] = list(sorted(clientrep['defaultClientScopes'])) + + if 'optionalClientScopes' in clientrep: + clientrep['optionalClientScopes'] = list(sorted(clientrep['optionalClientScopes'])) + if 'redirectUris' in clientrep: clientrep['redirectUris'] = list(sorted(clientrep['redirectUris']))