Delete managed tokens with smartphone containers - #540
Open
frankii91 wants to merge 1 commit into
Open
Conversation
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.
Summary
Make smartphone-container removal an atomic local lifecycle operation:
Problem
A smartphone container is the synchronization and management boundary between privacyIDEA and the authenticator. Previously, deleting or unregistering that boundary could remove only the local container record while retaining the tokens that belonged to it. Likewise, when synchronization received terminal responses indicating that the container was missing (
601) or no longer registered (3001), the app asked the user whether to accept the server-side state.This can turn server-managed tokens into local orphans:
That leaves the app in a state which no longer reflects the administrator-controlled server state.
Why cascading cleanup is preferable
Container membership defines which local token material is managed by that server container. Once the container registration is gone, retaining its former members locally is not a meaningful synchronization state. The client should therefore treat removal of the container and removal of its managed local tokens as one lifecycle operation.
This also makes server-side administration deterministic:
The change does not delete tokens on the privacyIDEA server. Server-side deletion, reassignment, and container membership remain controlled by the administrator. It only reconciles the local projection with the authoritative container lifecycle.
Implementation
resourceNotFoundandcontainerNotRegisteredsynchronization results with silent local cleanup.Validation
git diff --check: passedlib/model/token_folder.dartplus informational diagnosticsRegression coverage includes: