Documentation
¶
Overview ¶
Package secretstest is test support for the secrets.Cipher seam: the shared contract suite (contract.go) plus a Dockerized OpenBao dev-mode container started once per test binary, with the transit engine mounted and per-test key names handed out. Production code must never import it. A missing Docker daemon is a hard failure, not a skip: skipped contract tests would silently hollow out the coverage gate (the pgtest rule).
Index ¶
Constants ¶
const Image = "openbao/openbao:2.6.1"
Image is the pinned OpenBao the harness runs — the same release deploy/compose and the helm chart default to, so the contract tests exercise what ships.
const RootToken = "secretstest-root"
RootToken is the dev-mode root token for the throwaway container.
Variables ¶
This section is empty.
Functions ¶
func Addr ¶
Addr returns the dev container's base URL (http://host:port).
func FreshKey ¶
FreshKey returns a transit key name unique to this call. The backend under test is expected to create the key itself.
func Main ¶
Main wraps testing.M: it starts the shared OpenBao dev container (transit engine mounted), runs the suite, and tears the container down. Use from TestMain: os.Exit(secretstest.Main(m)). The start is attempted twice, with a fresh container in between (#265; the retry's rationale is on pgtest.Main, whose rule this follows). It opens by reaping what an earlier killed run left behind, the defer below being unreachable to one (#346; the rationale is in dockertest).
Types ¶
This section is empty.