From e4cef5cb24114356bae07b568a1e20f41b096573 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 09:10:33 +0200 Subject: [PATCH] [PR #8223/f55342d8 backport][stable-7] keycloak_client: add sorted defaultClientScopes and optionalClientScopes to normalizations (#8253) 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 b151e4541f..93e8a14d65 100644 --- a/plugins/modules/keycloak_client.py +++ b/plugins/modules/keycloak_client.py @@ -742,6 +742,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']))