controlplane

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PublicURL  string
	AdminToken string
	SigningKey []byte
	// APNs provider credentials are optional. When configured, the Relay can
	// forward Host-published Live Activity snapshots to ActivityKit push
	// tokens registered by authorized clients.
	APNsKeyID      string
	APNsTeamID     string
	APNsBundleID   string
	APNsPrivateKey []byte
	APNsProduction bool
	APNsEndpoint   string
	APNsHTTPClient *http.Client
	DataURL        string
	// PairingTTL controls how long a Host pairing code remains valid. The
	// code is deliberately reusable during this window so one generated link
	// can provision more than one client.
	PairingTTL time.Duration
	// PairingTicketTTL controls how long the client-facing pairing link remains
	// valid after the code is exchanged. A ticket can be exchanged repeatedly
	// during this window; each exchange gets its own refresh-capability family.
	PairingTicketTTL time.Duration
	// EnrollmentKeyTTL and EnrollmentKeyMaxUses are the defaults used by the
	// administrator batch key endpoint when a request omits those fields.
	EnrollmentKeyTTL     time.Duration
	EnrollmentKeyMaxUses int
	AccessTTL            time.Duration
	AllowedOrigin        string
	TunnelBaseDomain     string
	// RefreshTTL controls optional expiry. Zero means the capability remains
	// valid until its device association or Host is explicitly revoked.
	RefreshTTL   time.Duration
	MaxBodyBytes int64
	// RateLimitWindow and the operation limits are fixed-window admission
	// controls. A zero operation limit selects the secure default; negative
	// values are rejected rather than silently disabling abuse protection.
	RateLimitWindow  time.Duration
	PairingRateLimit int
	ClientRateLimit  int
	PublicRateLimit  int
	UpgradeRateLimit int
	Logger           *slog.Logger
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config Config) (*Server, error)

func (*Server) ServeHTTP

func (server *Server) ServeHTTP(response http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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