[PR #8823/ea389e70 backport][stable-8] bugfix(keycloak): fix parameters for realm key creation (#8839)

bugfix(keycloak): fix parameters for realm key creation (#8823)

* bugfix(keycloak): fix parameters for realm key creation

* supply changelog fragment

* fix formatting

* fix formatting

* Update changelogs/fragments/8823-keycloak-realm-key.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit ea389e7045)

Co-authored-by: Björn Bösel <bjoernboesel@gmail.com>
This commit is contained in:
patchback[bot] 2024-09-08 14:45:55 +02:00 committed by GitHub
parent 8fe7cdd864
commit ae4358d189
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 385 additions and 3 deletions

View file

@ -68,7 +68,7 @@ options:
type: bool
parent_id:
description:
- The parent_id of the realm key. In practice the ID (name) of the realm.
- The parent_id of the realm key. In practice the name of the realm.
type: str
required: true
provider_id:
@ -300,7 +300,7 @@ def main():
kc = KeycloakAPI(module, connection_header)
params_to_ignore = list(keycloak_argument_spec().keys()) + ["state", "force"]
params_to_ignore = list(keycloak_argument_spec().keys()) + ["state", "force", "parent_id"]
# Filter and map the parameters names that apply to the role
component_params = [x for x in module.params
@ -371,7 +371,7 @@ def main():
parent_id = module.params.get('parent_id')
# Get a list of all Keycloak components that are of keyprovider type.
realm_keys = kc.get_components(urlencode(dict(type=provider_type, parent=parent_id)), parent_id)
realm_keys = kc.get_components(urlencode(dict(type=provider_type)), parent_id)
# If this component is present get its key ID. Confusingly the key ID is
# also known as the Provider ID.