import type { RouteDefinition } from "../http/Routes.js"; import type { SecurityEvents } from "../incident/SecurityEvents.js"; import type { PeerIdentity } from "./PeerIdentity.js"; import type { Principal, PrincipalRegistry } from "./PrincipalRegistry.js"; import type { LockoutRule, RateLimiter, RateLimitRule } from "./RateLimiter.js"; import { type WorkloadJwtVerifier } from "./WorkloadJwtVerifier.js"; export type AuthMethod = "bearer" | "jwt" | "mtls" | "none"; export interface AuthenticationInput { readonly authorization: string | undefined; /** The client certificate the connection presented, or null when it presented none. */ readonly peer: PeerIdentity | null; readonly route: RouteDefinition; } export interface AuthenticatedPrincipal { readonly principal: Principal; readonly method: AuthMethod; } /** A refusal at the door: a status and a code, never a message from the request. */ export declare class AuthError extends Error { readonly status: number; readonly code: string; constructor(status: number, code: string); } export interface AuthenticatorOptions { readonly registry: PrincipalRegistry; readonly jwt: WorkloadJwtVerifier | null; /** The executor's own audience; a principal may name its own instead. */ readonly audience: string | null; readonly limits: RateLimiter; readonly unauthenticated: RateLimitRule; readonly lockout: LockoutRule | null; /** Legacy mode with a client CA: every caller must present a certificate and the token. */ readonly requireCertificate: boolean; readonly events: SecurityEvents; } /** The key of the one window for requests that never became a principal. */ export declare const UNAUTHENTICATED_KEY = "*"; /** * The one chokepoint every non-public request passes, in a fixed, * fail-closed order: the window for failed attempts; a certificate and a * bearer together, which is ambiguous and refused; the certificate, by SAN * URI and optional pin; the bearer, by digest across every bearer principal * in constant time, then as a workload token; the lock, only once the * principal is known so no lock is an existence oracle; the principal's * own window; the route's role; the route's scope. Every refusal is one * `AUTH_FAILED` event with the method and the code, and nothing else. */ export declare class Authenticator { private readonly options; constructor(options: AuthenticatorOptions); authenticate(input: AuthenticationInput): Promise; private identify; /** The bearer path alone: the digest scan, and nothing after it. */ private bearer; private workload; private static presented; } //# sourceMappingURL=Authenticator.d.ts.map