@grow-codes/openbao - v0.1.2
    Preparing search index...

    Class OpenBaoClient

    Client for OpenBao.

    const client = OpenBaoClient.fromEnv();          // BAO_ADDR / BAO_TOKEN / GROW_OPENBAO_*
    await client.kv().write("app/db", { password: "s3cret" });
    const secret = await client.kv().read("app/db");
    await client.close();
    Index
    auth: AuthApi

    Logins, token self-service and token renewal.

    The immutable configuration.

    leases: LeaseManager

    Lease renew/revoke/lookup and automatic lease renewal.

    sys: Sys

    System backend (health, seal status, policies, mounts, auth methods, AppRole admin).

    wrapping: Wrapping

    Response wrapping.

    • Stops token renewers, managed leases and secret watchers, then releases connections. Idempotent.

      Returns Promise<void>

    • Unauthenticated health: GET /v1/sys/health (answers 200 in every node state). healthy is true only for an active, unsealed node; status is active, standby, perfstandby, sealed or uninitialized (unreachable on any error). details holds version, initialized, sealed, standby and clusterName (when set); on errors error (and httpStatus). Never throws except for CANCELLED and CONFIG.

      Parameters

      Returns Promise<HealthStatus>

    • KV mount with auto-detected version (default mount config.kvMount). The same instance is returned for the same mount.

      Parameters

      • mount: string = ...

      Returns KvMount

    • KV version 1 mount (no detection).

      Parameters

      • mount: string = ...

      Returns KvV1

    • KV version 2 mount (no detection).

      Parameters

      • mount: string = ...

      Returns KvV2

    • Authenticated round trip (GET /v1/auth/token/lookup-self, allowed for every valid token). Returns the latency in ms; a missing, invalid or revoked token raises AuthenticationError.

      Parameters

      Returns Promise<number>

    • PKI engine (default mount pki).

      Parameters

      • mount: string = "pki"

      Returns Pki

    • Calls any OpenBao API path (/v1/<path>) with the client token, namespace, retries and error mapping. Use it for endpoints this SDK has no method for.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • method: "GET" | "PUT" | "DELETE" | "POST" | "PATCH"
      • path: string
      • options: RawRequestOptions = {}

      Returns Promise<RawResponse<T>>

    • Replaces the client token (undefined removes it).

      Parameters

      • token: string | Secret | undefined

      Returns void

    • Transit engine (default mount transit).

      Parameters

      • mount: string = "transit"

      Returns Transit