mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-08 19:50:30 -07:00
[PR #8812/5d9a7ab2 backport][stable-9] keycloak_user_federation: remove lastSync
param from kc API responses (#8977)
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>
This commit is contained in:
parent
2e72051b6c
commit
566ec0a002
2 changed files with 7 additions and 2 deletions
|
@ -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):
|
||||||
# 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:
|
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']:
|
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…
Add table
Reference in a new issue