Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublicTeam
Assigneeszack

Relationships

#4569 datastore setup extension skips ${{ }} config interpolation that the load path applies — no clean setup for config-only-credential datastores

Opened by kneel · 11/10/2026· Shipped 11/10/2026

Summary

swamp datastore setup extension <ext> --config '{…}' does not run ${{ }} config-value interpolation (${{ env.* }}, ${{ vault.get(vault, key) }}) on the --config argument before it validates the schema, creates the provider, and verifies/migrates against the backend. The literal expression string is handed to the extension verbatim.

The datastore load path does interpolate these expressions — documented under "Config Value Interpolation": "String values in the datastore config object support ${{ }} expression interpolation… resolved during config resolution, before schema validation and provider creation." setup extension performs schema validation and provider creation too, yet skips the interpolation step — so it violates that documented contract.

Impact

For any datastore extension whose credential must come from config (no ambient-credential mode) — e.g. @webframp/azure-blob-datastore with servicePrincipal auth — there is no clean setup path:

  • Passing clientSecret: "${{ vault.get(...) }}" → the literal template is sent as the secret → backend auth fails (Azure AD 401 Unauthorized). Setup fail-safes and the datastore stays on the prior backend.
  • The only workaround is passing the resolved literal secret in --config, which setup then persists verbatim into .swamp.yaml on success — writing the plaintext secret to disk, which is exactly what ${{ vault.get() }} exists to avoid.

Datastores with ambient credentials (@swamp/s3-datastore, @swamp/gcs-datastore relying on AWS/gcloud env) don't hit this, because their --config carries no secret — which is why the gap has stayed invisible.

Steps to reproduce (secret-free)

Run, with SWAMP_UNSET_VAR unset:

swamp datastore setup extension @webframp/azure-blob-datastore \
  --config '{"auth":{"mode":"servicePrincipal","accountName":"<acct>","tenantId":"<tenant>","clientId":"<app>","clientSecret":"${{ env.SWAMP_UNSET_VAR }}"},"container":"<container>","prefix":"swamp"}' \
  --format 2
  • Expected: config resolution throws the documented startup error for an unset env var ("variable is not set or empty") before any provider/backend call.
  • Actual: no such error — the literal string ${{ env.SWAMP_UNSET_VAR }} is passed straight to the extension as clientSecret and used in the backend call (here, Azure AD returns 401). This proves --config is consumed without interpolation.

The same happens with ${{ vault.get(...) }}: a bogus vault name yields the backend auth error, not "vault not found".

Expected fix

setup extension should run the same config resolution the load path runs: resolve ${{ }} for the verify/migrate step, but persist the raw (unresolved) expression into .swamp.yaml — not the resolved literal. Resolve-and-persist- literal would be wrong: it would write the secret to disk, defeating the feature.

Environment

  • swamp 20261109.032610.0-sha.36b062e6 (latest at filing: 20261110.004355.0-sha.e171eaa8; not confirmed whether the newer build changes this behavior).
  • Datastore extension exercised: @webframp/azure-blob-datastore. The extension appears correct — it reads auth.clientSecret verbatim by design and has no ambient-credential mode; the gap is in swamp core's setup handler, not the extension.
  • Platform: Linux.
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 8 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

11/10/2026, 6:26:25 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
kneel moved this from a private collective to public11/10/2026, 3:11:34 AM
zack assigned zack11/10/2026, 4:17:38 PM
Editable. Press Enter to edit.

zack commented 11/10/2026, 6:26:26 PM

Thanks @kneel for reporting this! We shipped: datastore setup extension resolves env and vault expressions in --config locally with the same resolver and managedConfig gate the load path uses, validates and connects with the resolved config, and persists the unresolved expressions to .swamp.yaml so secrets never reach disk. Resolution is injected into the libswamp setup generator through DatastoreSetupDeps. Over serve, a client-supplied config holding an expression is refused rather than resolved with the server's environment and vaults; per-caller authorization is a follow-up issue.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.