localui

package
v0.13.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBind = "localhost:23998"
View Source
const (
	// LocalEnvPublicID is the fixed env_public_id used for Local UI mode.
	LocalEnvPublicID = "env_local"
)

Variables

View Source
var (
	ErrLocalUIDeviceCAMissing     = errors.New("local UI device CA is missing")
	ErrLocalUIDeviceCAInvalid     = errors.New("local UI device CA is invalid")
	ErrLocalUIDeviceCAExpired     = errors.New("local UI device CA is expired")
	ErrLocalUIDeviceCAUntrusted   = errors.New("local UI device CA is not trusted by this OS user")
	ErrLocalUIDeviceCAManual      = errors.New("local UI device CA requires manual trust installation")
	ErrLocalUIDeviceCAExists      = errors.New("local UI device CA already exists")
	ErrLocalUIDeviceCANotYetValid = errors.New("local UI device CA is not yet valid")
)
View Source
var (
	ErrLocalUIDeviceCAInstallFailed   = errors.New("current-user certificate trust installation failed")
	ErrLocalUIDeviceCAInstallCanceled = errors.New("current-user certificate trust installation was canceled")
)

Functions

func ExportLocalUIDeviceCA added in v0.13.0

func ExportLocalUIDeviceCA(stateDir, outputPath string) error

ExportLocalUIDeviceCA writes only the public CA certificate or server chain.

func InstallLocalUIDeviceCAForCurrentUser added in v0.13.0

func InstallLocalUIDeviceCAForCurrentUser(stateDir string) error

InstallLocalUIDeviceCAForCurrentUser is invoked only by the explicit CLI install operation. It never elevates privileges or modifies system-wide trust. Linux distributions expose incompatible user trust stores, so Linux returns a manual-install result instead of guessing or invoking sudo.

func LocalUIDeviceCACertificatePath added in v0.13.0

func LocalUIDeviceCACertificatePath(stateDir string) string

LocalUIDeviceCACertificatePath returns the public certificate path. The CA private key path is intentionally not exposed.

func LocalUIPublicCertificatePEM added in v0.13.0

func LocalUIPublicCertificatePEM(stateDir string) ([]byte, error)

LocalUIPublicCertificatePEM returns the validated public CA or server chain. Private key material never enters the export payload.

func SaveRuntimeAccess added in v0.13.0

func SaveRuntimeAccess(layout config.StateLayout, input RuntimeAccessUpdate) (*config.EnvironmentCatalogAccess, error)

func ValidateLocalUICertificateForBind added in v0.13.0

func ValidateLocalUICertificateForBind(stateDir, rawBind string) error

ValidateLocalUICertificateForBind checks the saved identity without binding the configured port or interrupting the current Runtime. Startup repeats the check against its actual listener authorities.

Types

type BindSpec

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

BindSpec is the parsed Local UI listener configuration.

func ParseBind

func ParseBind(raw string) (BindSpec, error)

func (BindSpec) Host

func (b BindSpec) Host() string

func (BindSpec) IsLoopbackOnly

func (b BindSpec) IsLoopbackOnly() bool

func (BindSpec) IsNetworkExposure added in v0.10.0

func (b BindSpec) IsNetworkExposure() bool

func (BindSpec) IsWildcard

func (b BindSpec) IsWildcard() bool

func (BindSpec) ListenLabel

func (b BindSpec) ListenLabel() string

func (BindSpec) ListenLabelForPort

func (b BindSpec) ListenLabelForPort(port int) string

func (BindSpec) Port

func (b BindSpec) Port() int

type CertificateImport added in v0.13.0

type CertificateImport struct {
	CertificatePEM string `json:"certificate_pem"`
	PrivateKeyPEM  string `json:"private_key_pem"`
}

CertificateImport carries a PEM certificate chain and its matching key only through the privileged maintenance input. It is never part of a status report.

type DeviceCAStatus added in v0.13.0

type DeviceCAStatus struct {
	Identity    string `json:"identity"`
	Trust       string `json:"trust"`
	NotAfter    string `json:"not_after,omitempty"`
	CertPath    string `json:"certificate_path,omitempty"`
	Remedy      string `json:"remedy,omitempty"`
	Kind        string `json:"certificate_kind,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
}

DeviceCAStatus is the stable, credential-free Local UI trust projection.

func GenerateLocalUIDeviceCA added in v0.13.0

func GenerateLocalUIDeviceCA(stateDir string) (DeviceCAStatus, error)

GenerateLocalUIDeviceCA explicitly creates the persistent device-local CA. Runtime startup never calls this function.

func ImportLocalUICertificate added in v0.13.0

func ImportLocalUICertificate(stateDir string, input CertificateImport) (DeviceCAStatus, error)

func InspectLocalUIDeviceCA added in v0.13.0

func InspectLocalUIDeviceCA(stateDir string) (DeviceCAStatus, error)

InspectLocalUIDeviceCA reports the serving identity and platform-specific client-trust guidance without exposing the CA key or a generated certificate.

func RegenerateLocalUIDeviceCA added in v0.13.0

func RegenerateLocalUIDeviceCA(stateDir string) (DeviceCAStatus, error)

func RemoveLocalUICertificate added in v0.13.0

func RemoveLocalUICertificate(stateDir string) (DeviceCAStatus, error)

type LocalAuthorizationKeyRotationResult added in v0.11.0

type LocalAuthorizationKeyRotationResult struct {
	PreviousVersion int `json:"previous_version"`
	CurrentVersion  int `json:"current_version"`
	RetainedKeys    int `json:"retained_keys"`
}

func RotateLocalAuthorizationKey added in v0.11.0

func RotateLocalAuthorizationKey(stateRoot string) (LocalAuthorizationKeyRotationResult, error)

type Options

type Options struct {
	Logger   *slog.Logger
	Bind     BindSpec
	Protocol string

	DisableSelfUpgrade     bool
	EffectiveRunMode       string
	RemoteEnabled          bool
	ControlplaneBaseURL    string
	ControlplaneProviderID string
	EnvPublicID            string

	// AppServer is the Env App local API and proxy handler mounted under /_redeven_proxy/*.
	AppServer *appserver.Server

	// Agent serves direct sessions (RPC/streams) after a successful E2EE handshake.
	Agent *agent.Agent

	// ConfigPath is the absolute path to the runtime config file.
	// It is used to compute the local permission cap and to render Settings consistently.
	ConfigPath string
	StateRoot  string

	RuntimeControlSocketPath string

	// Version is the runtime build version (used by /api/local/agent/version/latest).
	Version string

	// Diagnostics stores structured debug-only request timing events.
	Diagnostics *diagnostics.Store

	// AccessGate protects the local browser entry when password mode is enabled.
	AccessGate *accessgate.Gate
	// contains filtered or unexported fields
}

type RuntimeAccessUpdate added in v0.13.0

type RuntimeAccessUpdate struct {
	Bind         string `json:"local_ui_bind"`
	Protocol     string `json:"local_ui_protocol"`
	PasswordMode string `json:"local_ui_password_mode"`
	Password     string `json:"local_ui_password"`
}

type Server

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

func New

func New(opts Options) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) DisplayURLs

func (s *Server) DisplayURLs() []string

func (*Server) HandlerForDesktopBridge added in v0.6.8

func (s *Server) HandlerForDesktopBridge() http.Handler

func (*Server) ListenLabel

func (s *Server) ListenLabel() string

func (*Server) LocalUIBridgeTokenForDesktop added in v0.13.0

func (s *Server) LocalUIBridgeTokenForDesktop() string

func (*Server) LocalUIBridgeURLForDesktop added in v0.10.0

func (s *Server) LocalUIBridgeURLForDesktop() string

func (*Server) LocalUIExposure added in v0.10.0

func (s *Server) LocalUIExposure() runtimemanagement.LocalUIExposure

func (*Server) Port

func (s *Server) Port() int

func (*Server) RuntimeAttachStatus added in v0.6.8

func (s *Server) RuntimeAttachStatus() runtimemanagement.RuntimeAttachStatus

func (*Server) RuntimeControlEndpointForDesktopBridge added in v0.6.8

func (s *Server) RuntimeControlEndpointForDesktopBridge() *runtimemanagement.RuntimeControlEndpoint

func (*Server) RuntimeServiceSnapshotForDesktopBridge added in v0.6.8

func (s *Server) RuntimeServiceSnapshotForDesktopBridge() runtimeservice.Snapshot

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) StartOnListeners added in v0.6.8

func (s *Server) StartOnListeners(ctx context.Context, listeners []net.Listener, runtimeControlListener net.Listener) error

Jump to

Keyboard shortcuts

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