PolicyInput
Defined in: src/core/protocol.ts:69
Protocol-agnostic view of what’s being processed.
Constructed by each runtime from its native message type:
- HTTP runtime builds it from Hono’s
Context - ext_proc runtime builds it from gRPC
ProcessingRequest - WebSocket runtime builds it from the upgrade request or message frame
Properties
Section titled “Properties”attributes
Section titled “attributes”attributes:
Map<string,unknown>
Defined in: src/core/protocol.ts:127
Cross-policy attribute bag.
Policies read attributes set by upstream policies and set
attributes for downstream policies via AttributeMutation.
Runtime-populated attributes use the runtime.* namespace
(e.g. runtime.matched_route, runtime.upstream_name).
optionalbody:string|ArrayBuffer
Defined in: src/core/protocol.ts:109
Message body, present only during body phases.
May be the full buffered body or a streaming chunk, depending on the runtime’s buffering mode.
clientIp?
Section titled “clientIp?”
optionalclientIp:string
Defined in: src/core/protocol.ts:101
Client IP address, extracted by the runtime from protocol-specific
sources (e.g. CF-Connecting-IP, X-Forwarded-For, gRPC peer address).
headers
Section titled “headers”headers:
Headers
Defined in: src/core/protocol.ts:95
Headers (HTTP) or metadata (gRPC).
Treat as read-only - express modifications via PolicyResult mutations, not by mutating this object.
method
Section titled “method”method:
string
Defined in: src/core/protocol.ts:79
Request method or action.
- HTTP:
"GET","POST", etc. - gRPC: Full method name, e.g.
"users.UserService/GetUser"
path:
string
Defined in: src/core/protocol.ts:87
Request path or resource identifier.
- HTTP: URL path, e.g.
"/users/123" - gRPC: Service path, e.g.
"/users.UserService/GetUser"
phase:
ProcessingPhase
Defined in: src/core/protocol.ts:71
Current processing phase.
protocol
Section titled “protocol”protocol:
ProtocolType
Defined in: src/core/protocol.ts:130
The protocol runtime that constructed this input.
trailers?
Section titled “trailers?”
optionaltrailers:Headers
Defined in: src/core/protocol.ts:117
Trailers, present only during trailer phases.
Relevant for gRPC (which uses trailers for status codes and error details) and HTTP/2.