Skip to content

PolicyContext

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

Context available to policies during execution

optional adapter: GatewayAdapter

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

Runtime adapter providing store implementations and runtime-specific capabilities.


debug: (namespace) => DebugLogger

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

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:43

Gateway name


requestId: string

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

Unique request ID for tracing


routePath: string

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

Matched route path pattern


spanId: string

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

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


startTime: number

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

Timestamp when the request entered the gateway


traceId: string

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

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