Secrets Provider Interface

Defines the contract for retrieving secrets from a secure storage.

interface SecretsProvider {
    get(key: string): Promise<undefined | string>;
    getRequired(key: string): Promise<string>;
    has(key: string): Promise<boolean>;
}

Methods

  • Get a secret value

    Parameters

    • key: string

      The key of the secret to retrieve

    Returns Promise<undefined | string>

    The secret value or undefined if not found

  • Get a required secret value

    Parameters

    • key: string

      The key of the secret to retrieve

    Returns Promise<string>

    The secret value

    Error if the secret is not found

  • Check if a secret exists

    Parameters

    • key: string

      The key of the secret to check

    Returns Promise<boolean>

    True if the secret exists, false otherwise