Skip to content

test(security): multi-tenant isolation integration tests#326

Merged
Destynova2 merged 5 commits intomainfrom
test/multi-tenant-isolation-v2
Apr 28, 2026
Merged

test(security): multi-tenant isolation integration tests#326
Destynova2 merged 5 commits intomainfrom
test/multi-tenant-isolation-v2

Conversation

@Destynova2
Copy link
Copy Markdown
Contributor

Adds 7 multi-tenant isolation regression tests. 4 pass today (audit log filter, cache key tenant prefix, spend journal tenant tag, JWT claim resolution); 4 land as #[ignore] regression targets with TODOs documenting the codebase gaps they fail against (per-tenant budget enforcement, tenant-scoped SecretBackend, strict_tenant config flag, ToolSpikeDetector from PR #308). See file header for full audit context.

🤖 Generated with Claude Code

Clément LIARD added 4 commits April 28, 2026 22:41
CI re-runs the full test suite (incl. doctests) on every PR via the
.github/workflows/ci.yml tests job, so local pre-push duplication
adds ~20 min per push without catching anything new. Pre-push hooks
should be fast-fail; expensive checks belong on the CI server.

Closes audit finding: silent productivity tax (pre-push duplication).
Documents the three-state intent (true/false/absent) of ProviderConfig.is_enabled
and the dependency on deny_unknown_fields (added in the next commit) to
reject typos like enbaled = false at parse time. Behaviour is unchanged;
this is purely contractual clarity to support the silent-typo-killer audit.

Closes audit finding: silent typo killer on provider config.
Adds #[serde(deny_unknown_fields)] to AppConfig and the major
sub-structs (ProviderConfig, ModelConfig, TierConfig, RouterConfig,
ScoringConfig, CacheConfig, BudgetConfig, DlpConfig, SecurityConfig).

Without this guard, a typo like enbaled = false in a [[providers]]
block silently parses (the unknown key is dropped) and the provider
remains enabled with the wrong intent. With the guard, parsing fails
loudly and the operator gets an actionable error pointing at the
offending key.

Tested with the full nextest suite (1268 tests) plus all doctests:
no fixture, preset or example carries a stale field, so this is a
pure tightening with no migration cost.

Closes audit finding: silent typo killer on TOML config.
Each entry in DENIED_SECTIONS / DENIED_KEYS now carries a short
justification table covering why it can not be hot-reloaded — either
because the data is sensitive (credentials, DLP rules) or because the
consumer is constructed once at process start (TLS listener, secret
backend, TEE attestation, FIPS gate).

Adds tee, fips, server.tls and secrets.backend to the deny-list so
the documented "static-init" rationale matches actual behaviour. Also
emits an INFO log on every denied attempt telling the operator to
restart instead of expecting the silent reload to apply.

Adds two unit tests covering the new deny entries (tee/fips sections
and server.tls / secrets.backend keys) and asserts that sibling keys
in the same sections remain editable.

Closes audit finding: hot-reload UX (silent ignore of denied edits).
@Destynova2 Destynova2 enabled auto-merge (squash) April 28, 2026 20:59
Adds 7 regression tests covering tenant boundaries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Destynova2 Destynova2 merged commit 59d3bcb into main Apr 28, 2026
43 checks passed
@Destynova2 Destynova2 deleted the test/multi-tenant-isolation-v2 branch April 28, 2026 21:19
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