Documentation
¶
Overview ¶
Package grpcwire reads gRPC request messages without their schema: it splits a body into gRPC messages and finds the text in each protobuf message, for rules to inspect.
Protobuf's wire format doesn't say which length-delimited fields are strings, bytes or nested messages. A field whose bytes are a whole protobuf message is read as one (its fields get their own names); a field whose bytes are printable UTF-8 is text. Some bytes are both, and give both. Numbers, binary bytes and anything that fails to parse give nothing.
Index ¶
Constants ¶
const FrameHeader = 5
FrameHeader is a gRPC message's prefix: a compressed flag (0 or 1) and the message length, 4 bytes big-endian.
Variables ¶
var DefaultLimits = Limits{Depth: 16, Fields: 1024}
DefaultLimits are those the pipeline uses.
Functions ¶
Types ¶
type Field ¶
Field is text found in a message: Name is the path of field numbers from the message, dot-separated ("2.1": field 1 of the message in field 2).
type Limits ¶
type Limits struct {
// Depth is how deep nested messages are read.
Depth int
// Fields is how many text fields are returned.
Fields int
}
Limits bound the work on one body.