Repository navigation
fix(auth): enforce tenant isolation and authorization boundaries across auth flows - #1700
Closed
harryjupiter148 wants to merge 1 commit into
Closed
harryjupiter148 wants to merge 1 commit into
harryjupiter148 wants to merge 1 commit into
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
Enforces strict authorization boundaries and tenant isolation across sign-in, refresh, verification, logout, and recovery flows in
meridian-api/src/auth:token_subjects) and enforces tenant boundaries on token revocation and verification. Revoking tokens for Tenant A no longer revokes tokens belonging to other tenants.verify_access_for_subject). Forged subjects are rejected before advancing state.paired_accesstracking so rotating a refresh token in one browser tab invalidates only that tab's access token while preserving concurrent sessions on other tabs/devices.logout_for_subjectto verify session ownership before modifying state.request_recoveryandcomplete_recovery, preventing cross-tenant recovery hijacking, token tampering, and unauthorized request cancellation.AuthErrorvariants and zero side effects.Type
Related Issue
Closes #1643
Testing
Test Suite Execution
cargo test: 142 passed, 0 failed, 0 warnings (all 128 existing tests + 14 new regression tests covering allowed, denied, forged-identity, and cross-tenant scenarios).cargo clippy: Passed with 0 warnings.Screenshots (if UI change)
N/A — Backend / API authorization boundary security fix.