/** Destinations denied before any allow entry is consulted: cloud metadata. */ export declare const DEFAULT_EGRESS_DENY: readonly ['169.254.169.254:80', 'metadata.google.internal']; /** Stable machine-readable reasons, reused as the `X-Guard-Reason` code. */ export type EgressReason = 'deny-list' | 'allow-list' | 'unknown-allow' | 'unknown-deny' | 'invalid-target'; /** One parsed destination. The host is lowercase and never carries brackets. */ export interface EgressTarget { host: string; port: number; } /** One decision for a destination; `ask` is impossible at this layer. */ export interface EgressDecision { action: 'allow' | 'deny'; /** False when no entry matched and the configured unknown default applied. */ matched: boolean; reason: EgressReason; /** Stable rule id such as `egress-deny[0]`; never the raw pattern. */ rule?: string; } /** One compiled entry: a host matcher plus an optional fixed port. */ export interface EgressRule { pattern: string; host: string; port?: number; matches(target: EgressTarget): boolean; } export interface EgressPolicyOptions { allow: readonly string[]; deny: readonly string[]; /** Decision for destinations that match no entry. */ unknown: 'allow' | 'deny'; } export interface EgressPolicy { evaluate(target: EgressTarget): EgressDecision; readonly allowCount: number; readonly denyCount: number; readonly ruleCount: number; readonly unknown: 'allow' | 'deny'; } /** Lowercase a host, drop a trailing root dot, and strip IPv6 brackets. */ export declare function normalizeEgressHost(raw: string): string | undefined; /** * Parse one `allow`/`deny` entry: `host`, `host:port`, `[v6]:port`, or a glob * such as `*.example.com`. Unparseable entries are dropped by compilation and * reported through the returned count, never silently matched. */ export declare function parseEgressEntry(raw: string): EgressRule | undefined; /** * Parse a CONNECT authority (`host:port`) or a bare host. CONNECT always * carries a port, so a missing one yields `undefined` rather than a guess. */ export declare function parseEgressAuthority(raw: string): EgressTarget | undefined; /** * Compile entries once at mount. Deny entries win over allow entries, which * keeps a broad allow glob from silently re-admitting a denied destination. */ export declare function createEgressPolicy(options: EgressPolicyOptions): EgressPolicy; //# sourceMappingURL=policy.d.ts.map