Skip to content

PolicyContext

Defined in: src/policies/types.ts:94

Context available to policies during execution

optional adapter: GatewayAdapter

Defined in: src/policies/types.ts:120

Runtime adapter providing store implementations and runtime-specific capabilities.


debug: (namespace) => DebugLogger

Defined in: src/policies/types.ts:118

Get a debug logger for the given namespace. Returns a no-op when debug is disabled (zero overhead).

string

DebugLogger

const ctx = getGatewayContext(c);
const debug = ctx?.debug("stoma:policy:cache");
debug?.("HIT", cacheKey);

gatewayName: string

Defined in: src/policies/types.ts:100

Gateway name


requestId: string

Defined in: src/policies/types.ts:96

Unique request ID for tracing


routePath: string

Defined in: src/policies/types.ts:102

Matched route path pattern


spanId: string

Defined in: src/policies/types.ts:106

W3C Trace Context - 16-hex span ID for this gateway request.


startTime: number

Defined in: src/policies/types.ts:98

Timestamp when the request entered the gateway


traceId: string

Defined in: src/policies/types.ts:104

W3C Trace Context - 32-hex trace ID (propagated or generated).