Documentation
¶
Overview ¶
Package httpcheck implements POST /v1/check, the engine's own check API (api/engine/v1). It serves proxies without a native protocol (the ingress-nginx Lua plugin, the Traefik plugin), inkwallctl and tests.
The caller describes one client request in a CheckRequest, protobuf (Content-Type: application/x-protobuf) or JSON (application/json), and gets the verdict back in a CheckResponse in the same encoding. Any well-formed check is answered with 200; the verdict is in the body.
The caller is trusted: the engine inspects the request it describes and takes its client_ip as given. Listen only where the proxy alone can reach it (a Unix socket or localhost).
Index ¶
Constants ¶
const ( ContentTypeProtobuf = "application/x-protobuf" ContentTypeJSON = "application/json" )
Content types of the two encodings.
const Path = "/v1/check"
Path is where check requests are sent.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// MaxBodyBytes is how much of a request body is inspected; longer bodies
// are treated as truncated. Zero disables body inspection.
MaxBodyBytes int64
// Logger receives one security event per denied or logged request.
// Nil uses slog.Default().
Logger *slog.Logger
}
Config configures a Handler.