[PR #8812/5d9a7ab2 backport][stable-8] keycloak_user_federation: remove `lastSync` param from kc API responses (#8976)
keycloak_user_federation: remove `lastSync` param from kc API responses (#8812)
* remove `lastSync` param from kc API responses
* add blank line to satisfy sanity check
* add changelog fragment
* fix NoneType error introduced by changed normalize func return value
(cherry picked from commit 5d9a7ab240
)
Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
pull/8985/head
parent
715e6706cc
commit
214f0be60d
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- keycloak_user_federation - remove ``lastSync`` parameter from Keycloak responses to minimize diff/changes (https://github.com/ansible-collections/community.general/pull/8812).
|
|
@ -714,12 +714,15 @@ from copy import deepcopy
|
|||
|
||||
|
||||
def normalize_kc_comp(comp):
|
||||
# kc completely removes the parameter `krbPrincipalAttribute` if it is set to `''`; the unset kc parameter is equivalent to `''`;
|
||||
# to make change detection and diff more accurate we set it again in the kc responses
|
||||
if 'config' in comp:
|
||||
# kc completely removes the parameter `krbPrincipalAttribute` if it is set to `''`; the unset kc parameter is equivalent to `''`;
|
||||
# to make change detection and diff more accurate we set it again in the kc responses
|
||||
if 'krbPrincipalAttribute' not in comp['config']:
|
||||
comp['config']['krbPrincipalAttribute'] = ['']
|
||||
|
||||
# kc stores a timestamp of the last sync in `lastSync` to time the periodic sync, it is removed to minimize diff/changes
|
||||
comp['config'].pop('lastSync', None)
|
||||
|
||||
|
||||
def sanitize(comp):
|
||||
compcopy = deepcopy(comp)
|
||||
|
|
Loading…
Reference in New Issue