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: remove lastSync param from kc API responses #8812

Conversation

fgruenbauer
Copy link
Contributor

@fgruenbauer fgruenbauer commented Aug 28, 2024

SUMMARY

Keycloak stores a timestamp of the last ldap sync in the parameter lastSync. Once the parameter is set after a sync (periodic or manual), the module always detects a change and shows a diff similar to the one below.

--- before
+++ after
@@ -18,7 +18,6 @@
         "kerberosRealm": "EXAMPLE.NET",
         "keyTab": "/mnt/ad2",
         "krbPrincipalAttribute": "test",
-        "lastSync": "1724663435",
         "pagination": "false",
         "priority": "0",
         "rdnLDAPAttribute": "sAMAccountName",

changed: [kc1]

The parameter seems to be used to time the periodic syncs, so i don't think changing it is good idea. The API does allow changing it though. But I did not find a way to view or change the parameter in the web GUI.

It looks like the parameter is only used by kc internally, so it should be safe to ignore it and remove it entirely from all API responses.

Fixes 5842

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

community.general.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 28, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-8 Automatically create a backport for the stable-8 branch backport-9 Automatically create a backport for the stable-9 branch labels Aug 28, 2024
@ansibullbot ansibullbot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci CI is older than 7 days, rerun before merging has_issue labels Sep 10, 2024
@fgruenbauer fgruenbauer force-pushed the keycloak-user-federation-ignore-lastSync-value branch from 7b4dd2e to 1007345 Compare October 1, 2024 13:24
@ansibullbot ansibullbot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci CI is older than 7 days, rerun before merging labels Oct 1, 2024
@ansibullbot

This comment was marked as outdated.

@fgruenbauer fgruenbauer force-pushed the keycloak-user-federation-ignore-lastSync-value branch from 1007345 to 5deecbf Compare October 1, 2024 13:36
@fgruenbauer fgruenbauer marked this pull request as ready for review October 1, 2024 14:00
@ansibullbot ansibullbot removed the WIP Work in progress label Oct 1, 2024
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

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

LGTM

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Oct 3, 2024
@felixfontein felixfontein merged commit 5d9a7ab into ansible-collections:main Oct 3, 2024
141 checks passed
Copy link

patchback bot commented Oct 3, 2024

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/5d9a7ab2400badc11a236c86076affa4327acb72/pr-8812

Backported as #8976

🤖 @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 Oct 3, 2024
…es (#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 5d9a7ab)
@felixfontein
Copy link
Collaborator

@fgruenbauer thanks for your contribution!
@russoz thanks for reviewing!

Copy link

patchback bot commented Oct 3, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/5d9a7ab2400badc11a236c86076affa4327acb72/pr-8812

Backported as #8977

🤖 @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 Oct 3, 2024
…es (#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 5d9a7ab)
felixfontein pushed a commit that referenced this pull request Oct 3, 2024
…ve `lastSync` param from kc API responses (#8976)

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 5d9a7ab)

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
felixfontein pushed a commit that referenced this pull request Oct 3, 2024
…ve `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 5d9a7ab)

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
…es (ansible-collections#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8 Automatically create a backport for the stable-8 branch backport-9 Automatically create a backport for the stable-9 branch bug This issue/PR relates to a bug has_issue module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

keycloak_user_federation shows changed because of "lastSync" value
4 participants