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 valuepull/8983/head
parent
d4fb6bf8a6
commit
5d9a7ab240
|
@ -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).
|
|
@ -722,12 +722,15 @@ from copy import deepcopy
|
||||||
|
|
||||||
|
|
||||||
def normalize_kc_comp(comp):
|
def normalize_kc_comp(comp):
|
||||||
|
if 'config' in comp:
|
||||||
# kc completely removes the parameter `krbPrincipalAttribute` if it is set to `''`; the unset kc parameter is equivalent to `''`;
|
# 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
|
# to make change detection and diff more accurate we set it again in the kc responses
|
||||||
if 'config' in comp:
|
|
||||||
if 'krbPrincipalAttribute' not in comp['config']:
|
if 'krbPrincipalAttribute' not in comp['config']:
|
||||||
comp['config']['krbPrincipalAttribute'] = ['']
|
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):
|
def sanitize(comp):
|
||||||
compcopy = deepcopy(comp)
|
compcopy = deepcopy(comp)
|
||||||
|
|
Loading…
Reference in New Issue