fix(vault,datastore): reject unknown config keys with strict schema validation (#2095) #268

Merged
stack72 merged 1 commit from fix/strict-config-schemas into main 2026-09-10 14:06:00 +00:00
Owner

Summary

  • Add .strict() to all 6 vault and datastore extension configSchema definitions so unknown config keys raise a clear ZodError with "Unrecognized key" instead of being silently stripped during parse
  • Add configSchema rejects unknown keys tests to all 6 extensions (aws-sm, azure-kv, gcp-sm, 1password, s3, gcs)
  • Bump all 6 manifest versions to 2026.09.10.0

Fixes swamp-club #2095profile and other unsupported keys in vault YAML were silently discarded, causing invisible config drift.

Test plan

  • New configSchema rejects unknown keys test passes in all 6 extensions
  • All existing test suites pass (68 aws-sm, 33 azure-kv, 45 gcp-sm, 47 1password, 278 s3, 268 gcs)
  • deno check, deno lint, deno fmt --check, deno install --frozen pass for all 6
  • CI matrix covers all modified extensions

🤖 Generated with Claude Code

## Summary - Add `.strict()` to all 6 vault and datastore extension `configSchema` definitions so unknown config keys raise a clear `ZodError` with `"Unrecognized key"` instead of being silently stripped during parse - Add `configSchema rejects unknown keys` tests to all 6 extensions (aws-sm, azure-kv, gcp-sm, 1password, s3, gcs) - Bump all 6 manifest versions to `2026.09.10.0` Fixes swamp-club #2095 — `profile` and other unsupported keys in vault YAML were silently discarded, causing invisible config drift. ## Test plan - [x] New `configSchema rejects unknown keys` test passes in all 6 extensions - [x] All existing test suites pass (68 aws-sm, 33 azure-kv, 45 gcp-sm, 47 1password, 278 s3, 268 gcs) - [x] `deno check`, `deno lint`, `deno fmt --check`, `deno install --frozen` pass for all 6 - [ ] CI matrix covers all modified extensions 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(vault,datastore): reject unknown config keys with strict schema validation (#2095)
All checks were successful
CI: Reviews / CI Security Review (pull_request) Has been skipped
CI: Datastores / datastore/s3 - test (pull_request) Successful in 1m19s
CI: Vaults / vault/1password - check (pull_request) Successful in 33s
CI: Vaults / vault/aws-sm - check (pull_request) Successful in 38s
CI: Vaults / vault/azure-kv - check (pull_request) Successful in 33s
CI: Vaults / vault/gcp-sm - check (pull_request) Successful in 24s
CI: Vaults / vault/1password - fmt (pull_request) Successful in 31s
CI: Vaults / vault/aws-sm - fmt (pull_request) Successful in 30s
CI: Vaults / vault/azure-kv - fmt (pull_request) Successful in 22s
CI: Vaults / vault/gcp-sm - fmt (pull_request) Successful in 30s
CI: Vaults / vault/1password - lint (pull_request) Successful in 28s
CI: Vaults / vault/aws-sm - lint (pull_request) Successful in 23s
CI: Vaults / vault/azure-kv - lint (pull_request) Successful in 41s
CI: Vaults / vault/gcp-sm - lint (pull_request) Successful in 41s
CI: Vaults / vault/1password - test (pull_request) Successful in 39s
CI: Vaults / vault/azure-kv - test (pull_request) Successful in 38s
CI: Vaults / vault/gcp-sm - test (pull_request) Successful in 40s
CI: Vaults / vault/aws-sm - test (pull_request) Successful in 44s
CI: Vaults / vault/1password - lockfile up to date (pull_request) Successful in 23s
CI: Vaults / vault/azure-kv - lockfile up to date (pull_request) Successful in 34s
CI: Vaults / vault/aws-sm - lockfile up to date (pull_request) Successful in 35s
CI: Vaults / vault/gcp-sm - lockfile up to date (pull_request) Successful in 25s
CI / Actions Audit (pull_request) Successful in 34s
CI: Reviews / Claude Code Review (pull_request) Successful in 1m59s
CI: Datastores / Gate: Datastores (pull_request) Successful in 1s
CI: Vaults / Gate: Vaults (pull_request) Successful in 1s
CI: Reviews / Adversarial Code Review (pull_request) Successful in 1m59s
CI: Reviews / Gate: Reviews (pull_request) Successful in 0s
CI / Dependency Audit (pull_request) Successful in 4m24s
CI / Gate: Audit (pull_request) Successful in 0s
868fffdc48
All vault and datastore extension configSchemas used plain z.object()
which silently strips unknown keys during parse. This caused config
drift — keys like `profile` in vault YAML looked authoritative but were
silently discarded, with no error or warning.

Add .strict() to all 6 extension configSchemas (aws-sm, azure-kv,
gcp-sm, 1password, s3, gcs) so unknown keys raise a clear validation
error at create/edit time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

Code Review

Blocking Issues

None.

Suggestions

  1. GCS test uses a key that looks plausible but may confuse future readers. credentials_file looks 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 uses credentials_file. Minor style preference only.

  2. Test error-message check is format-coupled. All six assertThrows calls 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.

## Code Review ### Blocking Issues None. ### Suggestions 1. **GCS test uses a key that looks plausible but may confuse future readers.** `credentials_file` looks 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 uses `credentials_file`. Minor style preference only. 2. **Test error-message check is format-coupled.** All six `assertThrows` calls 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.
Author
Owner

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 outermost z.object()). Version bumps in all manifest.yaml files are consistent (2026.09.10.0). No logic errors, no security issues, no edge cases missed.

## 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 outermost `z.object()`). Version bumps in all `manifest.yaml` files are consistent (`2026.09.10.0`). No logic errors, no security issues, no edge cases missed.
stack72 deleted branch fix/strict-config-schemas 2026-09-10 14:06:00 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
swamp-club/swamp-extensions!268
No description provided.