refactor: Simplify server logic for clear reparation, reduce slop#359
Merged
Conversation
Entire-Checkpoint: 34c348b255f6
Split get_protected_auth_service into verify_pop_caller (caller identification: PoP JWT validation, registration check, ownership resolution) and get_protected_auth_service (service construction only). Each layer now has a single responsibility; FastAPI caches verify_pop_caller per request so the work is not duplicated. Add OwnershipResolver.resolve_for_principal so both resolution paths (identity-based CLI and principal-based UI) go through the ownership resolver rather than inline registry lookups. Remove four redundant app.state aliases (identity_registry, vault_registry, identity_claim_registry, principal_vault_binding_registry) that shadowed app.state.store.* and caused inconsistent access patterns. All callers now use app.state.store.* directly. Change get_admin_auth_service to use Depends(get_protected_auth_service) instead of calling it directly, and fix resolve_ui_request_identity return type (str | None → None; it never returned non-None). Closes #354 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Entire-Checkpoint: eda543e8686c
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.
Entire-Checkpoint: 34c348b255f6
Description
Remove dead code and simplify server logic
Types of changes
Checklist: