user deletion after effects#42
Open
praveen-bhosle wants to merge 1 commit into
Open
Conversation
amoghar29
approved these changes
Jun 25, 2026
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.
Description
This PR ensures that when a user is deleted from the system, their license assignment, and access permissions are cleanly purged. Specifically, it removes the user from the
users_listof the single license they are assigned to and deletes their relation tuples from the Ory Keto database to prevent orphaned access rights.What’s Included
users_listupon user deletion.Why This Change
Without this change, deleting a user leaves orphaned references inside its assigned license and stale permission tuples inside the Keto DB. Since a user is tied to exactly one license, ensuring this precise cleanup maintains data consistency across our primary database and authorization layer while closing potential security gaps.
Acceptance Criteria
users_list.How to Test
test_check_accesscorrectly asserts that after a user deletion event, fetching the assigned license returns ausers_listthat no longer contains the deleted user's ID.get_access_relationspost-deletion and asserts that all relation tuples associated with that user have been completely purged from Keto.Tech Guide
test_check_accessto act as an integration test verifying both the DB license array update and the Keto tuple eviction viaget_access_relations.Checklist