Documentation
¶
Overview ¶
Package controlrpc carries the control session credential of one dispatcher and executor pair over gRPC metadata: the metadata keys both channels agree on, the constant-time match each side admits a request with, and the status vocabulary that answers a request it cannot admit. The nonsecret identity and the lease vocabulary stay in controlsession, which holds no transport.
Index ¶
Constants ¶
const ( VersionKey = "debuglet-control-version" IncarnationKey = "debuglet-dispatcher-incarnation" SessionIDKey = "debuglet-session-id" TokenKey = "debuglet-session-token" )
The metadata keys of a control session credential, in the order Keys returns and both channels send them.
Variables ¶
This section is empty.
Functions ¶
func Keys ¶
func Keys() [4]string
Keys names every metadata key a credential occupies. The returned array is a copy, so a caller cannot change what this transport reads or sends.
func Unavailable ¶
func Unavailable() error
Unavailable, Malformed and Denied are the only statuses a credential check answers with. None of them repeats supplied metadata.
Types ¶
type Credentials ¶
type Credentials struct {
Binding controlsession.Binding
Token [32]byte
}
Credentials is private transport state. Never format it or an offer.
func Read ¶
func Read(ctx context.Context) (Credentials, error)
Read takes the credential an incoming request carries. It decides nothing about ownership or leases: the caller matches it against the session it holds.
func (Credentials) Matches ¶
func (c Credentials) Matches(other Credentials) bool
Matches compares the token in constant time, so a rejected request tells a peer nothing about how far its guess reached.
func (Credentials) Outgoing ¶
func (c Credentials) Outgoing(ctx context.Context) context.Context
Outgoing replaces the reserved keys of an outgoing call without mutating the metadata its caller supplied.
func (Credentials) RedactError ¶
func (c Credentials) RedactError(err error) error
A peer can reflect its credential in an otherwise useful operational error. Keep unrelated diagnostics and status codes. A sanitized error contains only the reconstructed safe status, never a token-bearing wrapped original.