replicationauth

package
v0.1.0-alpha.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package replicationauth verifies peer identities for server-to-server replication.

Index

Constants

This section is empty.

Variables

View Source
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

type Authorize func(*http.Request) (consumerName string, err error)

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

type MTLSConfig struct {
	PeerConsumers map[string]string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL