fix(vault,datastore): reject unknown config keys with strict schema validation (#2095) #268
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/strict-config-schemas"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
.strict()to all 6 vault and datastore extensionconfigSchemadefinitions so unknown config keys raise a clearZodErrorwith"Unrecognized key"instead of being silently stripped during parseconfigSchema rejects unknown keystests to all 6 extensions (aws-sm, azure-kv, gcp-sm, 1password, s3, gcs)2026.09.10.0Fixes swamp-club #2095 —
profileand other unsupported keys in vault YAML were silently discarded, causing invisible config drift.Test plan
configSchema rejects unknown keystest passes in all 6 extensionsdeno check,deno lint,deno fmt --check,deno install --frozenpass for all 6🤖 Generated with Claude Code
Code Review
Blocking Issues
None.
Suggestions
GCS test uses a key that looks plausible but may confuse future readers.
credentials_filelooks like it could be an intended field (GCS does use service-account key files). A brief inline comment explaining the choice — e.g.,// credentials_file is not a config key; ADC handles auth— would make the test self-documenting. Same note for the GCP SM test which also usescredentials_file. Minor style preference only.Test error-message check is format-coupled. All six
assertThrowscalls assert on the substring"Unrecognized key", which is part of Zod's internal error formatting ("Unrecognized key(s) in object: '...'"). This is consistent with the existing test style in the repo and will work fine against current Zod, but a Zod major version that changes this wording would silently pass even if the strict behavior broke. Not blocking — just worth noting.Overall the PR is correct and well-scoped. All six config schemas now use
.strict(), the tests exercise the actual rejection path with keys that are genuinely absent from each schema (verified against the schema definitions), and the version bumps are appropriate for the behavioral change. No CLAUDE.md violations, no type issues, no security concerns.Adversarial Review
Critical / High
No critical or high severity findings.
Medium
No medium severity findings.
Low
No low severity findings.
Verdict
PASS — Clean, mechanical change that adds
.strict()to all 8 extension config schemas (GCS, S3, 1Password, AWS SM, Azure KV, GCP SM) with matching tests. Each test uses a plausible-but-invalid key alongside valid required fields and asserts on Zod's"Unrecognized key"substring. Schema placement is correct in all cases (.strict()applied to the outermostz.object()). Version bumps in allmanifest.yamlfiles are consistent (2026.09.10.0). No logic errors, no security issues, no edge cases missed.