Skip to main content
← Back to list
01Issue
BugShippedSwamp CLITeam
Assigneesstack72

Relationships

#984 MethodContext docs/comments mention context.putSecret but runtime exposes vaultService.put

Opened by evrardjp · 7/6/2026· Shipped 7/6/2026

Summary

There is a discrepancy in Swamp around model method secret-writing APIs. Some code/comments and extension assumptions refer to a context.putSecret API, but the current canonical MethodContext and runtime contexts expose vault writes through context.vaultService.put(...) instead.

Environment

  • Swamp version: 20260705.211241.0-sha.a2f45922
  • Source fetched with swamp source fetch for that version.

Evidence

Canonical MethodContext (src/domain/models/model.ts) includes:

vaultService?: VaultService;

and does not define putSecret or deleteSecret.

buildMethodContext (src/domain/models/method_context.ts) passes vaultService through but does not add top-level putSecret/deleteSecret.

Remote worker context (src/worker/remote_method_context.ts) builds a vaultService proxy with methods like:

put: async (vaultName, secretKey, secretValue) => { ... }

But src/serve/capability_service.ts contains a comment saying:

// Secrets are not model-type-scoped: any method may write to any vault
// key via the context.putSecret API ...

That comment/API name appears stale or inconsistent with the runtime surface.

Reproduction / impact

An extension using context.putSecret fails at runtime with an error equivalent to:

This Swamp runtime does not expose context.putSecret

The expected in-process API seems to be context.vaultService.put(vaultName, key, value).

Expected behavior

Please clarify and align the extension-author-facing MethodContext contract and implementation:

  • Either expose top-level context.putSecret/context.deleteSecret if that is the intended API; or
  • Update stale comments/docs/examples to point extension authors at context.vaultService.put/delete; and
  • Ideally ensure the testing package types match the documented extension-author API for secret writes.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

7/6/2026, 7:18:53 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/6/2026, 6:18:29 PM
Editable. Press Enter to edit.

stack72 commented 7/6/2026, 7:19:01 PM

Thanks @evrardjp for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.