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

Handle users deleted through the Keycloak management API, as well as through the Keycloak UI #4563

Merged
merged 6 commits into from
Sep 25, 2024

Conversation

evankanderson
Copy link
Member

Summary

It turns out that users deleted through the Keycloak API don't show up in the "User Events" queue, but instead show up in a different "admin events" queue. We should handle those deletions as well.

Fixes https://github.com/stacklok/minder-stories/issues/29

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Manual testing and added a unit test. Note that the code generally follows the same form as user events, but with a different schema and different URL endpoint. I did not make a lot of effort to de-duplicate the two codepaths.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@eleftherias
Copy link
Contributor

I'll manually test this in a bit, note that there's a lint error in identity_events_test.go

@coveralls
Copy link

coveralls commented Sep 20, 2024

Coverage Status

coverage: 52.96% (-0.02%) from 52.978%
when pulling bdb1af2 on evankanderson:cleanup-admin-delete
into 68d91f6 on stacklok:main.

eleftherias
eleftherias previously approved these changes Sep 20, 2024
Copy link
Contributor

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

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

Tested and works as expected when deleting a user from a different Keycloak client.

@evankanderson
Copy link
Member Author

Fixed the lint and (in a different PR) fixed the data race that was causing tests to fail.

@evankanderson evankanderson merged commit 155d73f into mindersec:main Sep 25, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants