Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloak_user_federation: add module arg to make mapper removal optout #8764

Conversation

fgruenbauer
Copy link
Contributor

SUMMARY

The keycloak_user_federation module removes mappers that are not specified/listed in the module arguments. In order to keep the default mappers created by keycloak, they have to be specified in the module arguments. This could break something silently if keycloak changes the default mappers in the future and adds an mapper thats important.

The argument removeUnspecifiedMappers added by the changes would allow users to disable or enable the removal of unspecified mappers, picking the desired behavior.

The default is to enable the removal for now. But I'm not sure whether that's the right way and need some input.

ISSUE TYPE
  • Bugfix Pull Request
  • Feature Pull Request
COMPONENT NAME

keycloak_user_federation

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added WIP Work in progress bug This issue/PR relates to a bug module module plugins plugin (any type) labels Aug 14, 2024
@fgruenbauer
Copy link
Contributor Author

@https://github.com/canon-cmre-benoit-lecardonnel - Could you check if you get the original behavior when the removal is disabled?

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch labels Aug 15, 2024
plugins/modules/keycloak_user_federation.py Outdated Show resolved Hide resolved
plugins/modules/keycloak_user_federation.py Outdated Show resolved Hide resolved
plugins/modules/keycloak_user_federation.py Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Aug 19, 2024
@ansibullbot ansibullbot added module_utils module_utils tests tests unit tests/unit labels Aug 20, 2024
@fgruenbauer fgruenbauer force-pushed the keycloak-user-federation-make-mapper-removal-configurable branch from 6bafd0a to fe7fec2 Compare August 20, 2024 10:18
@fgruenbauer
Copy link
Contributor Author

^ Sorry, made a bad rebase. You can ignore the mentions.

Should be fixed now.

@fgruenbauer fgruenbauer marked this pull request as ready for review August 20, 2024 10:34
@ansibullbot ansibullbot removed the WIP Work in progress label Aug 20, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (as much as I can judge this :) ). If nobody objects I'll merge this on the weekend.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Aug 24, 2024
@felixfontein felixfontein merged commit 7dc4429 into ansible-collections:main Aug 24, 2024
147 checks passed
@felixfontein
Copy link
Collaborator

@fgruenbauer thanks for your contribution!

@felixfontein felixfontein added backport-9 Automatically create a backport for the stable-9 branch and removed backport-9 Automatically create a backport for the stable-9 branch labels Aug 26, 2024
Copy link

patchback bot commented Aug 26, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/7dc4429c9c56c6c281dc7216fa02abf77025078e/pr-8764

Backported as #8804

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 26, 2024
#8764)

* add module arg to make mapper removal optout

* change parameter name to snake case: remove_unspecified_mappers

* add period to parameter description

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

* use dict indexing to get parameter instead of `.get()`

* add changelog fragment

* Update changelogs/fragments/8764-keycloak_user_federation-make-mapper-removal-optout.yml

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

* add `version_added` to argument description

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

* Update plugins/modules/keycloak_user_federation.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7dc4429)
felixfontein pushed a commit that referenced this pull request Aug 26, 2024
…module arg to make mapper removal optout (#8804)

keycloak_user_federation: add module arg to make mapper removal optout (#8764)

* add module arg to make mapper removal optout

* change parameter name to snake case: remove_unspecified_mappers

* add period to parameter description

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

* use dict indexing to get parameter instead of `.get()`

* add changelog fragment

* Update changelogs/fragments/8764-keycloak_user_federation-make-mapper-removal-optout.yml

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

* add `version_added` to argument description

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

* Update plugins/modules/keycloak_user_federation.py

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

---------

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

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
aioue pushed a commit to aioue/community.general that referenced this pull request Oct 1, 2024
ansible-collections#8764)

* add module arg to make mapper removal optout

* change parameter name to snake case: remove_unspecified_mappers

* add period to parameter description

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

* use dict indexing to get parameter instead of `.get()`

* add changelog fragment

* Update changelogs/fragments/8764-keycloak_user_federation-make-mapper-removal-optout.yml

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

* add `version_added` to argument description

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

* Update plugins/modules/keycloak_user_federation.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
TobiasZeuch181 pushed a commit to TobiasZeuch181/zypper_repository_add_list that referenced this pull request Oct 2, 2024
ansible-collections#8764)

* add module arg to make mapper removal optout

* change parameter name to snake case: remove_unspecified_mappers

* add period to parameter description

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

* use dict indexing to get parameter instead of `.get()`

* add changelog fragment

* Update changelogs/fragments/8764-keycloak_user_federation-make-mapper-removal-optout.yml

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

* add `version_added` to argument description

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

* Update plugins/modules/keycloak_user_federation.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
ansible-collections#8764)

* add module arg to make mapper removal optout

* change parameter name to snake case: remove_unspecified_mappers

* add period to parameter description

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

* use dict indexing to get parameter instead of `.get()`

* add changelog fragment

* Update changelogs/fragments/8764-keycloak_user_federation-make-mapper-removal-optout.yml

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

* add `version_added` to argument description

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

* Update plugins/modules/keycloak_user_federation.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch bug This issue/PR relates to a bug module_utils module_utils module module plugins plugin (any type) tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants