import { AbstractStartedContainer, GenericContainer } from "testcontainers"; /** * Testcontainers module for HashiCorp Vault. * * This container exposes Vault on port 8200, sets up a wait strategy using the health check endpoint, and supports: * - Supplying a root token * - Executing post-start CLI init commands */ export declare class VaultContainer extends GenericContainer { private readonly initCommands; private token?; /** * Constructs a VaultContainer with a default image and healthcheck strategy. * * - Sets VAULT_ADDR to internal container address * - Adds IPC_LOCK capability (required by Vault) * - Exposes Vault on port 8200 * - Waits for HTTP 200 response from /v1/sys/health * @param image Docker image to use (e.g. `hashicorp/vault:1.13.0`) */ constructor(image: string); /** * Sets a root token to be used with Vault, passed via environment variables. * * @param token Vault root token * @returns this */ withVaultToken(token: string): this; /** * Registers one or more Vault CLI init commands to be run after container starts. * * Example: * .withInitCommands("secrets enable transit", "kv put secret/foo bar=baz") * * @param commands Vault CLI commands (without `vault` prefix) * @returns this */ withInitCommands(...commands: string[]): this; /** * Starts the Vault container and executes any registered init commands. * * Wraps the base container in a StartedVaultContainer with helper accessors. */ start(): Promise; } /** * A running Vault container, with accessors for port, address, and exec helper. */ export declare class StartedVaultContainer extends AbstractStartedContainer { private readonly token?; constructor(startedTestContainer: AbstractStartedContainer["startedTestContainer"], token?: string | undefined); /** * Returns the mapped host port for Vault (default: 8200). */ getVaultPort(): number; /** * Returns the full Vault HTTP address (e.g., http://localhost:32768). */ getAddress(): string; /** * Returns the root token set at container creation time, if any. */ getRootToken(): string | undefined; /** * Executes Vault CLI commands inside the container after it has started. * * This is typically used to pre-configure secret engines or seed test data. * * @example * await container.execVaultCommands([ * "secrets enable transit", * "write -f transit/keys/my-key", * "kv put secret/my-secret value=123", * ]); * * @param commands Array of Vault CLI commands (without the `vault` prefix) * @throws If the command fails (non-zero exit code) */ execVaultCommands(commands: string[]): Promise; }