PolicyContext
Defined in: src/policies/types.ts:37
Context available to policies during execution
Properties
Section titled “Properties”adapter?
Section titled “adapter?”
optionaladapter:GatewayAdapter
Defined in: src/policies/types.ts:63
Runtime adapter providing store implementations and runtime-specific capabilities.
debug()
Section titled “debug()”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).
Parameters
Section titled “Parameters”namespace
Section titled “namespace”string
Returns
Section titled “Returns”Example
Section titled “Example”const ctx = getGatewayContext(c);const debug = ctx?.debug("stoma:policy:cache");debug?.("HIT", cacheKey);gatewayName
Section titled “gatewayName”gatewayName:
string
Defined in: src/policies/types.ts:43
Gateway name
requestId
Section titled “requestId”requestId:
string
Defined in: src/policies/types.ts:39
Unique request ID for tracing
routePath
Section titled “routePath”routePath:
string
Defined in: src/policies/types.ts:45
Matched route path pattern
spanId
Section titled “spanId”spanId:
string
Defined in: src/policies/types.ts:49
W3C Trace Context — 16-hex span ID for this gateway request.
startTime
Section titled “startTime”startTime:
number
Defined in: src/policies/types.ts:41
Timestamp when the request entered the gateway
traceId
Section titled “traceId”traceId:
string
Defined in: src/policies/types.ts:47
W3C Trace Context — 32-hex trace ID (propagated or generated).