import type { SecurityEvents } from "../incident/SecurityEvents.js"; import { SecretHandle } from "./SecretHandle.js"; import { type ReloadReason, type ReloadReport, type SecretName, type SecretStore } from "./SecretStore.js"; /** The largest secret file the store reads, in bytes. */ export declare const MAX_SECRET_BYTES: number; export interface FileSecretStoreOptions { /** Secret name to the mounted file that holds it. */ readonly files: Readonly>>; readonly events: SecurityEvents; /** Refuse a file another user could read; on by default, off only for development. */ readonly enforcePermissions?: boolean; readonly euid?: number; readonly egid?: number; /** Watch the mount directories for change; on by default. */ readonly watch?: boolean; /** The poll that backs the watch, for filesystems that do not report. */ readonly pollMs?: number; /** How long an old handle stays usable after its replacement is current. */ readonly graceMs?: number; readonly debounceMs?: number; } /** * Secrets read from mounted files, the shape a Kubernetes Secret volume or a * CSI secrets driver gives them, and the only shape production accepts. A * file is checked on the open descriptor before it is read: a regular file, * bounded in size, readable by this process alone or by root and this * process's group. Rotation is detected by watching the mount directory * (a Secret volume swaps a symlink) and by a slow poll behind it; a changed * file becomes current atomically, listeners hear the new handle, and the * old handle is zeroed after a grace so an in-flight use finishes. A file * that fails its checks on reload is refused and the previous handle stays. */ export declare class FileSecretStore implements SecretStore { private readonly events; private readonly sources; private readonly listeners; private readonly watchers; private poll; private debounce; private readonly options; private constructor(); /** Reads every file once; a failure is a `SecretError` naming the variable. */ static open(options: FileSecretStoreOptions): FileSecretStore; has(name: SecretName): boolean; get(name: SecretName): SecretHandle; onRotate(name: SecretName, listener: (next: SecretHandle) => void): () => void; reload(reason: ReloadReason): Promise; close(): void; private startWatching; private scheduleReload; /** * The checks run on the open descriptor, so what is checked is what is * read. Kubernetes mounts a Secret volume owned by root with the pod's * fsGroup, which is the second acceptable shape. */ private static read; /** `null` when acceptable; otherwise the refusal code. */ static permissionRefusal(mode: number, uid: number, gid: number, euid: number, egid: number): "CONFIG_SECRET_FILE_MODE" | "CONFIG_SECRET_FILE_OWNER" | null; } //# sourceMappingURL=FileSecretStore.d.ts.map