Repository navigation
feat(scim): delete users on SCIM DELETE - #23
Merged
Merged
Conversation
A SCIM DELETE only deactivated the user and answered 404 for users that were already inactive. The IdP deletes users when they leave, so the account stayed in Struudel. - DELETE /scim/v2/Users/<id> removes the user and the polls they own, the same as the admin "Delete user" action; 404 only for unknown ids - integration tests for the route - README: describe the behavior Assisted-by: claude-code:claude-opus-5-5 Signed-off-by: Andre Paskowski <andre.paskowski@netways.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A SCIM
DELETEonly deactivated the user and answered404for users that were already inactive. Identity providers sendDELETEwhen a person leaves, so the account stayed in Struudel.Changes
DELETE /scim/v2/Users/<id>now deletes the user viadelete_user_and_artifacts, the same function as the admin "Delete user" action. This also deletes the polls the user owns (required bypolls.created_by_id … ondelete="RESTRICT") and, by cascade, the responses to those polls.404only for unknown ids; inactive users are deleted as well.tests/integration/test_scim_routes.py.Tests
main(2 of 3) and pass with the change.ruff check,ruff format --check,ty checkclean.DELETEremoved the user, one owned poll and its 82 responses; other users and polls were unaffected.Note for reviewers
Deleting a leaving user's polls removes other people's answers to those polls as well. This is the intended behavior for us; if you prefer to keep polls, an alternative would be transferring ownership before deletion.