class SecretsService
implements ISecretManager
Since 0.1.0

Secret manager backed by a pluggable provider with a read-through cache.

The committed ISecretManager.get throws when a secret is absent; providers signal absence with null, and this service performs the null → throw conversion so the throw contract lives in one place.

Constructors

SecretsService(
provider: SecretProvider,
)
Parameters
provider: SecretProvider

The backing provider adapter

optional
options: SecretsServiceOptions

Cache TTL and clock

Methods

get(name: string): Promise<string>

Retrieves a secret, serving a fresh cache entry when present.

has(name: string): Promise<boolean>

Reports whether a secret exists and is accessible.

rotate(
name: string,
value: string
): Promise<void>

Rotates a secret to a new value and refreshes the cache entry.

Usage

import { SecretsService } from "secrets-plugin/src/index.ts";