Skip to content

refactor: Simplify server logic for clear reparation, reduce slop#359

Merged
manojbajaj95 merged 2 commits into
mainfrom
refactor/simplify-server
Jun 1, 2026
Merged

refactor: Simplify server logic for clear reparation, reduce slop#359
manojbajaj95 merged 2 commits into
mainfrom
refactor/simplify-server

Conversation

@manojbajaj95
Copy link
Copy Markdown
Collaborator

Entire-Checkpoint: 34c348b255f6

Description

Remove dead code and simplify server logic

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Clean refactor

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

@manojbajaj95 manojbajaj95 self-assigned this Jun 1, 2026
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
@manojbajaj95 manojbajaj95 merged commit 136b0a6 into main Jun 1, 2026
3 checks passed
@manojbajaj95 manojbajaj95 deleted the refactor/simplify-server branch June 1, 2026 09:20
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.

1 participant