Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface {
Authorize(ctx context.Context, remoteAddr string, backend string) (*auth.AuthResult, error)
}
Authorizer abstracts the identity check so that tests can supply a mock while production wiring uses the real Tailscale local client.
type PostgresProxy ¶
type PostgresProxy struct {
Backend string
Name string
Auth Authorizer
Tracker *restrict.Tracker
Provisioner *provision.Provisioner
Metrics *metrics.Metrics
PGConfig *config.PostgresAdmin
RevalInterval time.Duration
Logger *slog.Logger
Dialer func(ctx context.Context, network, addr string) (net.Conn, error)
BytesRead *atomic.Int64 // optional: aggregate byte counter
BytesWritten *atomic.Int64 // optional: aggregate byte counter
}
PostgresProxy handles PG-aware proxying with Tailscale auth, dynamic user provisioning, and mid-session revalidation.
func (*PostgresProxy) HandleConn ¶
func (p *PostgresProxy) HandleConn(ctx context.Context, clientConn net.Conn)
HandleConn processes a single inbound PostgreSQL connection.
type TCPProxy ¶
type TCPProxy struct {
Backend string
Name string
Auth Authorizer
Tracker *restrict.Tracker
Metrics *metrics.Metrics
Logger *slog.Logger
Dialer func(ctx context.Context, network, addr string) (net.Conn, error)
BytesRead *atomic.Int64 // optional: aggregate byte counter
BytesWritten *atomic.Int64 // optional: aggregate byte counter
}
TCPProxy handles raw TCP proxying with Tailscale auth and limits.
type TailscaleAuthorizer ¶
TailscaleAuthorizer implements Authorizer using the Tailscale local API.
func (*TailscaleAuthorizer) Authorize ¶
func (a *TailscaleAuthorizer) Authorize(ctx context.Context, remoteAddr string, backend string) (*auth.AuthResult, error)
Authorize delegates to auth.Authorize with the embedded local client.
Click to show internal directories.
Click to hide internal directories.