Merged
Conversation
Ignore default fallback candidates during consensus unless they are the only source, and share correlation scopes between middleware and MediatR to prevent duplicate scopes. Switch resolution strategy to scoped and add regression tests for consensus fallback and HTTP scope handling.
Bind tenant filters to the concrete DbContext for safer model caching and throw when tenant-scoped entities lack the tenant property in shared database mode. BREAKING CHANGE: shared database setups without a TenantId property and UseShadowTenantId=false now throw during model building; add the property, enable UseShadowTenantId, or mark entities as global.
Return Default as the source when only fallback candidates are present so the resolver applies configured fallback tenant details. Add regression coverage for fallback-only consensus.
Treat optional requirements as required when AllowAnonymous is false, while keeping RequireTenantByDefault for unannotated requests. Update tests and clarify the option intent.
Aggregate same-type claims so the core resolver can detect ambiguous tenant candidates. Add regression coverage for multiple claim values.
Note that auto wiring is intended for host/header resolution and manual ordering is required for route/claim and exception handling.
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
AllowAnonymous, aggregate duplicate claims for ambiguity, and clarify auto middleware ordering for header/host vs route/claim usage.Testing
dotnet testChecklist
Notes