mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-11 11:41:32 -07:00
keycloak_client: avoid TypeError if result["attributes"]
is a list (#8403)
* fix(keycloak_client): avoid TypeError if attributes is a list As sanitize_cr might be executed after normalise_cr, result['attributes'] can be of type list and we run into: TypeError: list indices must be integers or slices, not str * Update changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
43cb5a0d54
commit
572caeaa39
2 changed files with 5 additions and 2 deletions
|
@ -775,8 +775,9 @@ def sanitize_cr(clientrep):
|
|||
if 'secret' in result:
|
||||
result['secret'] = 'no_log'
|
||||
if 'attributes' in result:
|
||||
if 'saml.signing.private.key' in result['attributes']:
|
||||
result['attributes']['saml.signing.private.key'] = 'no_log'
|
||||
attributes = result['attributes']
|
||||
if isinstance(attributes, dict) and 'saml.signing.private.key' in attributes:
|
||||
attributes['saml.signing.private.key'] = 'no_log'
|
||||
return normalise_cr(result)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue