Documentation
¶
Overview ¶
Package authorityhttp serves write lease grants and revocations over authenticated HTTPS.
It uses mTLS and is separate from the public database HTTP/RPC surface and from the quorum-member LeaseStore endpoint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHTTPSRequired means the client did not obtain a verified, pinned HTTPS // response. // // It is fatal for a caller: treating it as a temporary controller // outage could hide an identity configuration error. ErrHTTPSRequired = errors.New("meldbase authority HTTP: verified pinned HTTPS is required") // ErrProtocol means an authenticated peer violated this strict control-plane // protocol. // // It is fatal for a caller and never permits a blind retry. ErrProtocol = errors.New("meldbase authority HTTP: invalid protocol response") )
Functions ¶
Types ¶
type Authorize ¶
type Authorize = replicationauth.Authorize
Authorize maps a verified peer certificate to a trusted node or operator identity.
It must never take that identity from an HTTP field.
func NewMTLSAuthorizer ¶
func NewMTLSAuthorizer(config MTLSConfig) (Authorize, error)
NewMTLSAuthorizer creates an authorizer for configured and verified client certificates.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client requests write leases or revocations from an authenticated controller.
It cannot impersonate an owner because the handler derives Owner from its verified mTLS identity.
func NewClient ¶
func NewClient(options ClientOptions) (*Client, error)
NewClient creates an authority client with validated server pins and redirects disabled.
func (*Client) Grant ¶
func (client *Client) Grant(ctx context.Context, databaseID [16]byte, commitSequence uint64) (primarylease.Grant, error)
Grant requests a primary certificate for the caller's configured mTLS node identity.
Use RetryAfter to extract a handoff time from an ErrLeaseActive error.
type ClientOptions ¶
type ClientOptions struct {
Endpoint string
ExpectedServerFingerprint string
ExpectedServerFingerprints []string
HTTPClient *http.Client
}
ClientOptions sets the controller endpoint, expected server certificates, and HTTP client.
HTTPClient carries the caller's mTLS certificate and trusted roots. Exactly one of the legacy single pin or the rotation-aware pin list must be supplied.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves authenticated lease grant and revocation requests for one controller.
It does not expose promotion because promotion must execute a deployment-specific, local history-readiness proof.
func NewHandler ¶
func NewHandler(config HandlerConfig) (*Handler, error)
NewHandler creates an authority handler with separate node and operator authorizers.
type HandlerConfig ¶
type HandlerConfig struct {
Authority *primarylease.Authority
NodeAuthorize Authorize
OperatorAuthorize Authorize
}
HandlerConfig sets the lease controller and separate node and operator authorization rules.
NodeAuthorize maps each verified node certificate to the immutable lease Owner used by Grant. Revoke requires a separately configured operator authorizer; granting node identity alone never conveys the ability to fence another primary.
type MTLSConfig ¶
type MTLSConfig = replicationauth.MTLSConfig
MTLSConfig maps verified certificate fingerprints to trusted peer identities.