From f55342d8afc0c14e9ebf16d2e7bc13d1d7e31fd5 Mon Sep 17 00:00:00 2001 From: Eike Waldt Date: Sun, 21 Apr 2024 00:25:10 +0200 Subject: [PATCH] keycloak_client: add sorted defaultClientScopes and optionalClientScopes to normalizations (#8223) keycloak_client: add sorted defaultClientScopes and optionalClientScopes to normalizations Signed-off-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']))