fix(datastore): revert strict schema validation for s3 and gcs #269
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/revert-strict-datastores"
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()on S3 and GCS datastoreconfigSchemadefinitions added in #268configSchema rejects unknown keystests from both datastores2026.09.10.1for both extensionsThe swamp runtime passes
namespace(and potentially other keys) through the config object to datastore extensions..strict()rejects these as"Unrecognized key", breaking all namespace-related UAT tests:Vault extensions keep
.strict()since the runtime does not inject extra keys into vault configs.Test plan
deno check,deno lint,deno fmt --checkpass for both s3 and gcs🤖 Generated with Claude Code
Code Review
This PR reverts the
.strict()Zod schema validation added in #268 for both the S3 and GCS datastore extensions, and bumps each manifest version from2026.09.10.0to2026.09.10.1.Blocking Issues
None.
Suggestions
Silent unknown-key stripping may hide misconfiguration. Without
.strict(), Zod's default mode strips unrecognized config keys rather than rejecting them. A user who typos a config key (e.g.,endpiontinstead ofendpoint, orforcePathStylespelled differently) will receive no error — the key is silently dropped and the default behaviour applies. This was the trade-off intentionally reverted, but it is worth documenting in the schema description or a code comment so future authors understand why.strict()was deliberately omitted.Consistency opportunity (non-blocking). The GCS test that was removed used
credentials_fileas the unknown key. That field name suggests there may be user confusion about how to supply GCS credentials to this extension. If that is a common misconfiguration, az.never()or a targeted.refine()with a helpful error message for that specific key could be added to guide users — but this is optional and outside the scope of this revert.Adversarial Review
PR summary: Removes
.strict()from the zod config schemas in both S3 and GCS datastore extensions, reverting the strict validation added inf69c46c73. Removes the corresponding "rejects unknown keys" tests. Bumps manifest versions to2026.09.10.1.Medium
Silent config typos go undetected (
datastore/s3/extensions/datastores/s3.ts:103,datastore/gcs/extensions/datastores/gcs.ts:111)Without
.strict(), zod's default behavior strips unrecognized keys silently. A typo like{ bucket: "prod-bucket", endpont: "http://localhost:4443" }(noteendpont) will parse successfully — the misspelled key is silently dropped, and the extension connects to the real AWS/GCS API instead of the intended local emulator. Same applies toforcePathStlye,reigon,pullConcurency, etc.This was presumably the exact scenario that motivated adding
.strict()inf69c46c73, and the revert presumably has its own justification (e.g., forward compatibility or integration pain). Noting it as medium because this is a deliberate design tradeoff, not an oversight — but the misconfiguration-to-wrong-cloud-endpoint failure mode is worth keeping in mind.Low
No config-level feedback mechanism to replace strict validation (
datastore/s3/extensions/datastores/s3.ts:103,datastore/gcs/extensions/datastores/gcs.ts:111)If strict validation was removed because it broke existing deployments with extra keys (e.g., keys consumed by a wrapper layer), a middle ground like
.passthrough()with a warning log for unrecognized keys would catch typos without breaking compatibility. This is a design suggestion, not a bug.Verdict
PASS — The changes are minimal, correct, and internally consistent. The
.strict()removal, test cleanup, and version bumps are all properly coordinated. No logic errors, no security vulnerabilities, no resource management issues. The silent-typo tradeoff is a known consequence of the design choice, not a defect.