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

    Interface SecretsProvider

    The secrets interface every secrets service implements (SPEC §3).

    interface SecretsProvider {
        delete(name: string, options?: DeleteOptions): Promise<void>;
        exists(name: string, options?: GetOptions): Promise<boolean>;
        get(name: string, options?: GetOptions): Promise<SecretValue | null>;
        getAll(
            path?: string,
            options?: SignalOptions,
        ): Promise<Map<string, SecretValue>>;
        getBool(name: string, options?: GetOptions): Promise<boolean | null>;
        getJson<T = unknown>(name: string, options?: GetOptions): Promise<T | null>;
        getMany(
            names: readonly string[],
            options?: GetOptions,
        ): Promise<Map<string, SecretValue>>;
        getNumber(name: string, options?: GetOptions): Promise<number | null>;
        getString(name: string, options?: GetOptions): Promise<string | null>;
        list(
            prefixOrPath?: string,
            options?: SignalOptions,
        ): Promise<SecretMetadata[]>;
        loadEnv(
            source: string | Readonly<Record<string, string>>,
            options?: LoadEnvOptions,
        ): Promise<Record<string, string>>;
        metadata(
            name: string,
            options?: GetOptions,
        ): Promise<SecretMetadata | null>;
        require(name: string, options?: GetOptions): Promise<SecretValue>;
        set(
            name: string,
            value: SecretInput,
            options?: SetOptions,
        ): Promise<string>;
        watch(
            name: string,
            intervalMs: number,
            onChange: WatchCallback,
            options?: WatchOptions,
        ): WatchHandle;
    }

    Implemented by

    Index
    • Boolean (true/false/1/0/yes/no/on/off), or null when missing.

      Parameters

      Returns Promise<boolean | null>

    • Parsed JSON, or null when missing (ValidationError when not JSON).

      Type Parameters

      • T = unknown

      Parameters

      Returns Promise<T | null>

    • Number, or null when missing (ValidationError when not a number).

      Parameters

      Returns Promise<number | null>

    • UTF-8 text, or null when missing.

      Parameters

      Returns Promise<string | null>

    • Sets environment variables from secrets: a path (one variable per secret directly under it) or a mapping { ENV_NAME: "secret/name" }. Returns { envName: secretName } for the variables that were set (never values).

      Parameters

      • source: string | Readonly<Record<string, string>>
      • Optionaloptions: LoadEnvOptions

      Returns Promise<Record<string, string>>