Documentation
¶
Overview ¶
Package guard protects the platform port with the installation's internal secret: the console relay presents it, the SDK checks it. Health stays open for Consul checks and probes. An empty secret disables the guard. While the secret rotates the previous one is accepted too.
Index ¶
Constants ¶
const ( Header = "bp-internal-secret" HTTPHeader = "Bp-Internal-Secret" )
Header carries the secret: gRPC metadata key and, canonicalized, HTTPHeader.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard checks the secret.
func New ¶
New creates a guard accepting secret and, during a rotation, the previous ones; an empty secret allows everything whatever the previous ones are.
func (Guard) Authorize ¶
Authorize checks the secret in incoming gRPC metadata; health is exempt. The error is a gRPC status and is returned as is.
func (Guard) ServerOptions ¶
func (g Guard) ServerOptions() []grpc.ServerOption
ServerOptions installs the guard on a gRPC server.