Skip to content

Replace FilterStrategy::Strict with strict: bool flag#6

Merged
oojacoboo merged 2 commits into
masterfrom
feature/strict-as-flag
Apr 16, 2026
Merged

Replace FilterStrategy::Strict with strict: bool flag#6
oojacoboo merged 2 commits into
masterfrom
feature/strict-as-flag

Conversation

@oojacoboo

@oojacoboo oojacoboo commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Strict coverage enforcement and filter matching strategy are orthogonal concerns — coupling them into a third FilterStrategy case prevented legitimate combinations like FirstMatch + deny-uncovered
  • strict is now a bool on #[MultiTenancy], usable alongside any FilterStrategy
  • Reads more naturally: strict: true vs strategy: FilterStrategy::Strict

Before

#[MultiTenancy(
    strategy: FilterStrategy::Strict,
    filters: [...]
)]

After

#[MultiTenancy(
    strict: true,
    filters: [...]
)]

Breaking change

FilterStrategy::Strict removed. Anywhere you had strategy: FilterStrategy::Strict, replace with strict: true (default strategy is AnyMatch, which matches the old Strict behavior).

Test plan

  • All 48 existing tests pass
  • `MultiTenancyTest` covers the new `isStrict()` method + default
  • `FilterStrategyTest` reverted to 2 cases
  • Fixture entities updated to use `strict: true`

Strict coverage enforcement is orthogonal to the matching strategy
(FirstMatch/AnyMatch). Making it a third FilterStrategy case coupled
two unrelated concerns and prevented FirstMatch + deny-uncovered.

Now strict is a bool on #[MultiTenancy], usable alongside any strategy.

BREAKING CHANGE: FilterStrategy::Strict removed. Replace
`strategy: FilterStrategy::Strict` with `strict: true`.
Moves strict mode into its own section rather than nesting it as a
sibling example under FilterStrategy usage. Ambient Context Providers
is now a subsection of Strict Mode, where it's contextually relevant.
@oojacoboo
oojacoboo merged commit 9151cde into master Apr 16, 2026
3 checks passed
@oojacoboo
oojacoboo deleted the feature/strict-as-flag branch April 16, 2026 18:48
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