Skip to main content

Module auth

Module auth 

Source
Expand description

Transport authentication helpers.

The TCP and HTTP transports are network-exposed and, unlike the stdio transport, are not implicitly trusted. When an auth token is configured, every TCP connection and HTTP /rpc request must present it.

Functionsยง

constant_time_eq
Constant-time byte comparison to avoid leaking the token via timing.
is_loopback_host
True if host refers to a loopback interface (or localhost).
verify_token
Verify a presented token against the configured secret in constant time.