Documentation
¶
Overview ¶
Package replicationauth verifies peer identities for server-to-server replication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTLSUnverified = errors.New("replication peer TLS connection is not verified")
ErrTLSUnverified reports a connection without TLS 1.2 or later and a verified peer chain.
Functions ¶
func RequireVerifiedTLS ¶
func RequireVerifiedTLS(state *tls.ConnectionState) error
RequireVerifiedTLS checks for TLS 1.2 or later and a verified peer certificate chain.
Server-side adapters retain an Authorize callback because deployments may use this package's strict mTLS authorizer or an equivalent private identity system.
Types ¶
type Authorize ¶
Authorize verifies a replication peer and returns its server-assigned durable consumer name.
Transport adapters must never take that name from an untrusted frame, URL, or request header.
func NewMTLSAuthorizer ¶
func NewMTLSAuthorizer(config MTLSConfig) (Authorize, error)
NewMTLSAuthorizer creates a peer authorizer using verified client certificate fingerprints.
The enclosing net/http server must require and verify client certificates. This function does not configure TLS: callers must set ClientAuth and trusted roots before a request reaches a replication handler.
type MTLSConfig ¶
MTLSConfig maps verified client certificate fingerprints to durable consumer names.
Fingerprints are lowercase SHA-256 hashes of certificate.Raw. They avoid ambiguous subject/SAN matching and make rotation an explicit configuration change.