Setu-TS
    Preparing search index...

    Class EnvProvider

    Environment-first secret provider with an optional config fallback.

    0.1.0

    Implements

    • SecretProvider
    Index
    • Parameters

      • env: Readonly<Record<string, string | undefined>>

        The runtime environment map (IRuntimeServices.env)

      • Optionaloptions: { config?: Pick<IConfig, "get">; prefix?: string }

        Provider options

        • Optionalconfig?: Pick<IConfig, "get">

          Config snapshot consulted only when env lacks a string value

        • Optionalprefix?: string

          Prefix prepended to the derived env key

      Returns EnvProvider

    • Reads the derived key from the environment first, then config. Environment strings are returned unchanged, including empty strings and ${NAME} references. Config values must be strings; no coercion is performed.

      Parameters

      • name: string

        Secret name/path

      Returns Promise<string | null>

      The string value, or null when neither source supplies a string

    • Lifecycle truth (M90b): environment variables are process state, so the only honest reachability answer is readiness.

      Returns Promise<boolean>

      true — the environment is always reachable

      0.5.0

    • Always rejects — this provider is read-only.

      The rejection is branded with a 501 HTTP status hint (X20-2, M90f), so an application running errorHandler answers the write attempt with 501 Not Implemented in its configured format rather than the masked 500 an unbranded rejection from this depth would produce. It REJECTS — never throws synchronously — so a caller using .catch() observes it either way.

      SecretsService.rotate() reaches this same site by delegating to set, which is what makes both public write operations answer identically.

      Parameters

      • _name: string

        Secret name (unused)

      • _value: string

        New value (unused)

      Returns Promise<void>

      A rejected promise carrying ReadOnlySecretProviderError