server

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 25 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiagnosticReportJSON added in v1.4.4

func DiagnosticReportJSON(info *bridge.SessionInfo, stateDir, version string) ([]byte, error)

DiagnosticReportJSON builds the canonical schema-versioned diagnostic report for one session snapshot, as a single JSON document. It is the one builder behind both the DiagnoseSession RPC and the diagnose_session control message, so a local caller and Bridge see the same document. stateDir locates the control client's status/revision files; empty means they are unknown.

Types

type BridgeServer

type BridgeServer struct {
	bridgev1.UnimplementedBridgeServiceServer
	// contains filtered or unexported fields
}

func New

func New(supervisor *bridge.Supervisor, registry *bridge.Registry, logger *slog.Logger, rl RateLimitConfig, serverInstanceID string, providerFallbacks map[string][]string, jwtVerifier *auth.JWTVerifier, certsDir string, version string) *BridgeServer

func (*BridgeServer) AttachSession

func (*BridgeServer) ClaimWriter

func (*BridgeServer) DiagnoseSession added in v1.4.4

DiagnoseSession returns the schema-versioned diagnostic snapshot of one session. It is authorized and rate limited exactly like GetSession, reads only Supervisor state plus the control client's local files, and never consults Bridge, telemetry or terminal output.

func (*BridgeServer) EnrollClient

EnrollClient implements the EnrollClient RPC. It validates the one-time enrollment token, signs the client's CSR with the server's CA, registers the client's JWT public key, and returns the cert + CA bundle.

This RPC is exempt from JWT auth in the interceptor chain. In mTLS mode, the TLS handshake still requires a client certificate, so this RPC is only reachable without a client cert when the server runs in TLS mode. The enrollment token provides application-level authorization.

func (*BridgeServer) GetSession

func (*BridgeServer) Health

func (*BridgeServer) ListProviders

func (*BridgeServer) ListSessions

func (*BridgeServer) RegisterJWTKey

func (*BridgeServer) ReleaseWriter

func (*BridgeServer) ResizeSession

func (*BridgeServer) SetDiagnoseStateDir added in v1.4.4

func (s *BridgeServer) SetDiagnoseStateDir(dir string)

SetDiagnoseStateDir sets the state directory DiagnoseSession reads the control client's status and revision files from. When unset, diagnostics report control status as unknown and wire revisions as null.

func (*BridgeServer) SetEnrollmentStore

func (s *BridgeServer) SetEnrollmentStore(store *enrollment.Store)

SetEnrollmentStore configures the enrollment token store for the EnrollClient RPC. When nil, enrollment is not available.

func (*BridgeServer) StartSession

func (*BridgeServer) StopSession

func (*BridgeServer) WriteInput

type RateLimitConfig

type RateLimitConfig struct {
	GlobalRPS                  float64
	GlobalBurst                int
	StartSessionPerClientRPS   float64
	StartSessionPerClientBurst int
	SendInputPerSessionRPS     float64
	SendInputPerSessionBurst   int
}

Jump to

Keyboard shortcuts

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