Documentation
¶
Overview ¶
Package secrets stores tool secrets in the OS keyring (macOS Keychain or Linux Secret Service) under service "toolshed", account "<group>/<KEY>".
Secrets never go into Claude Code or Codex config files: tools that need them are registered as `toolshed exec <id>`, which reads the keyring and execs the real server with the values in its environment.
Index ¶
Constants ¶
const DisableEnv = "TOOLSHED_NO_KEYRING"
DisableEnv, when non-empty, turns the keyring off: secrets are then written into the client config as plain env vars. For CI and headless machines.
Variables ¶
var ErrNotFound = errors.New("secret not found")
ErrNotFound is returned by Get when no value is stored.
var Service = "toolshed"
Service is the keyring service name. Overridable at build time:
-ldflags "-X github.com/bartdegoede/toolshed/internal/secrets.Service=acme"
Functions ¶
func Available ¶
func Available() bool
Available reports whether the OS keyring works, memoized per process.
The probe is a read, not a write: on macOS a write against a machine with no default keychain pops a modal "Keychain Not Found" dialog. Reads don't, but they also don't detect that state, so on macOS we first check that the default keychain file exists.
func UseMockForTest ¶
func UseMockForTest(avail bool)
UseMockForTest swaps in an in-memory keyring and sets Available.
Types ¶
This section is empty.