Documentation
¶
Index ¶
- Constants
- Variables
- func RunLoginDisplayPower(ctx context.Context) error
- func RunLoginMediaPython(root, worker string) error
- func RunLoginScreenService(ctx context.Context, config LoginServiceConfig) error
- func RunLoginServiceManagement(parent context.Context, input io.Reader, output io.Writer) int
- func RunLoginTextPython(root, session, compositor string) error
- func VerifyLoginServiceAdmission(ctx context.Context, path string, proof LoginServiceAdmissionProof) (string, error)
- func WriteHostDesktopCommand(writer io.Writer, command HostDesktopCommand) error
- func WriteHostDesktopMessage(writer io.Writer, message HostDesktopMessage) error
- type HostDesktopCapabilities
- type HostDesktopCommand
- type HostDesktopCursorPosition
- type HostDesktopDisplay
- type HostDesktopInput
- type HostDesktopMessage
- type HostDesktopPicture
- type HostDesktopServiceStatus
- type LoginScreenConnection
- func (c *LoginScreenConnection) Close() error
- func (c *LoginScreenConnection) Control() <-chan HostDesktopMessage
- func (c *LoginScreenConnection) Done() <-chan struct{}
- func (c *LoginScreenConnection) Media() <-chan HostDesktopMessage
- func (c *LoginScreenConnection) Send(command HostDesktopCommand, _ bool) error
- type LoginServiceAdmissionProof
- type LoginServiceConfig
- type LoginServiceDeploymentCommand
- type LoginServiceDeploymentControl
- type LoginServiceDeploymentEvent
- type LoginServiceDeploymentRequest
- type LoginServicePolicy
- type ServiceStatus
Constants ¶
const ( ServiceUnsupported = "unsupported" ServiceNotInstalled = "not_installed" ServiceAuthorization = "authorization_required" ServiceInstalling = "installing" ServiceActive = "active" ServiceStopped = "stopped" ServiceFailed = "failed" ServiceUninstalling = "uninstalling" )
const HostDesktopDefaultFrameWindow = 4
An absent window preserves the original protocol's four-frame limit. Extended delivery requires an explicit capability and matching picture offer.
const HostDesktopMaxFrameWindow = 6
const HostDesktopProtocolVersion = 1
Physical desktop sessions are independent of private application desktops. Consumers authorize a session; native adapters own its current OS target.
const LoginScreenService = "login-screen"
const LoginServiceManagementVersion = 2
const LoginServiceSocket = "/run/redeven-desktop/desktop.sock"
Variables ¶
var ( ErrServiceUnsupported = errors.New("login-screen service is unsupported") ErrServiceAuthorization = errors.New("administrator authorization is required") ErrServiceNotInstalled = errors.New("login-screen service is not installed") ErrServiceUpdateRequired = errors.New("desktop service update required") )
var ErrHostDesktopProtocol = errors.New("invalid host desktop protocol")
Functions ¶
func RunLoginDisplayPower ¶
RunLoginDisplayPower is a fixed child operation, never a renderer-selected command. The daemon changes credentials before starting this copy of itself; all inherited capabilities are removed before contacting the user session bus. Mutter's PowerSaveMode wakes display output without unlocking or injecting input, and -1 explicitly means unsupported and must never be changed.
func RunLoginMediaPython ¶ added in v0.22.28
RunLoginMediaPython executes only the immutable installation selected by the daemon. Thread pinning keeps capability removal and exec on the same thread.
func RunLoginScreenService ¶
func RunLoginScreenService(ctx context.Context, config LoginServiceConfig) error
func RunLoginServiceManagement ¶ added in v0.23.0
RunLoginServiceManagement owns one bounded transaction. Typed stdin never contains credentials. A heartbeat loss cancels even through a PTY.
func RunLoginTextPython ¶ added in v0.22.33
func VerifyLoginServiceAdmission ¶ added in v0.23.0
func VerifyLoginServiceAdmission(ctx context.Context, path string, proof LoginServiceAdmissionProof) (string, error)
VerifyLoginServiceAdmission authenticates from the calling Runtime process. It does not open an attachment, inspect a display or request Portal consent.
func WriteHostDesktopCommand ¶
func WriteHostDesktopCommand(writer io.Writer, command HostDesktopCommand) error
WriteHostDesktopCommand writes one validated native command. It never retries a partial input write; its caller must revoke that connection on an error.
func WriteHostDesktopMessage ¶
func WriteHostDesktopMessage(writer io.Writer, message HostDesktopMessage) error
Types ¶
type HostDesktopCapabilities ¶
type HostDesktopCapabilities struct {
FrameWindow int `json:"frame_window,omitempty"`
Authorization string `json:"authorization,omitempty"`
Backend string `json:"backend"`
State string `json:"state"`
Reason string `json:"reason,omitempty"`
Screen bool `json:"screen"`
Input bool `json:"input"`
Clipboard bool `json:"clipboard"`
TextInput bool `json:"text_input,omitempty"`
Audio bool `json:"audio"`
Unattended bool `json:"unattended"`
Unlock bool `json:"unlock"`
LockedScreen bool `json:"locked_screen,omitempty"`
Service string `json:"service,omitempty"`
Encoder string `json:"encoder,omitempty"`
Displays []HostDesktopDisplay `json:"displays"`
}
type HostDesktopCommand ¶
type HostDesktopCommand struct {
Version int `json:"version"`
ID uint64 `json:"id"`
Method string `json:"method"`
Generation uint64 `json:"generation,omitempty"`
FrameID uint64 `json:"frame_id,omitempty"`
DisplayID string `json:"display_id,omitempty"`
Mode string `json:"mode,omitempty"`
Unattended bool `json:"unattended,omitempty"`
Picture *HostDesktopPicture `json:"picture,omitempty"`
Input *HostDesktopInput `json:"input,omitempty"`
Text *string `json:"text,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Service string `json:"service,omitempty"`
}
func ParseHostDesktopCommand ¶
func ParseHostDesktopCommand(data []byte) (HostDesktopCommand, error)
func (HostDesktopCommand) Valid ¶
func (command HostDesktopCommand) Valid() bool
type HostDesktopCursorPosition ¶ added in v0.22.28
type HostDesktopCursorPosition struct {
X int `json:"x"`
Y int `json:"y"`
Width int `json:"width"`
Height int `json:"height"`
}
Cursor positions name the image's top-left in physical capture coordinates, not a guessed click hotspot or a compositor's logical desktop coordinates.
type HostDesktopDisplay ¶
type HostDesktopInput ¶
type HostDesktopInput struct {
Kind string `json:"kind"`
X float64 `json:"x"`
Y float64 `json:"y"`
DX float64 `json:"dx"`
DY float64 `json:"dy"`
Button int `json:"button,omitempty"`
Clicks int `json:"clicks,omitempty"`
Key string `json:"key,omitempty"`
Code string `json:"code,omitempty"`
Pressed bool `json:"pressed,omitempty"`
Repeat bool `json:"repeat,omitempty"`
Location int `json:"location,omitempty"`
Shift bool `json:"shiftKey,omitempty"`
Control bool `json:"ctrlKey,omitempty"`
Alt bool `json:"altKey,omitempty"`
Meta bool `json:"metaKey,omitempty"`
Text string `json:"text,omitempty"`
}
HostDesktopInput uses normalized selected-display coordinates. Code names are physical KeyboardEvent.code names; text and clipboard are explicit operations.
type HostDesktopMessage ¶
type HostDesktopMessage struct {
Authorization string `json:"authorization,omitempty"`
Version int `json:"version"`
Type string `json:"type"`
ID uint64 `json:"id,omitempty"`
Code string `json:"code,omitempty"`
State string `json:"state,omitempty"`
Mode string `json:"mode,omitempty"`
Capabilities *HostDesktopCapabilities `json:"capabilities,omitempty"`
Service string `json:"service,omitempty"`
ServiceStatus *HostDesktopServiceStatus `json:"service_status,omitempty"`
Displays []HostDesktopDisplay `json:"displays,omitempty"`
DisplayID string `json:"display_id,omitempty"`
Generation uint64 `json:"generation,omitempty"`
FrameID uint64 `json:"frame_id,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Codec string `json:"codec,omitempty"`
Profile string `json:"profile,omitempty"`
Description string `json:"description,omitempty"`
Encoder string `json:"encoder,omitempty"`
Cursor string `json:"cursor,omitempty"`
CursorPosition *HostDesktopCursorPosition `json:"cursor_position,omitempty"`
CursorVisible *bool `json:"cursor_visible,omitempty"`
HotspotValid *bool `json:"hotspot_valid,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
HotX int `json:"hot_x,omitempty"`
HotY int `json:"hot_y,omitempty"`
Key bool `json:"key,omitempty"`
SampleRate int `json:"sample_rate,omitempty"`
Channels int `json:"channels,omitempty"`
Text *string `json:"text,omitempty"`
Bytes int `json:"bytes,omitempty"`
Data []byte `json:"-"`
}
HostDesktopMessage carries control metadata or one encoded media packet. Data is binary on media transports; credentials and content are not diagnostics.
func ReadHostDesktopMessage ¶
func ReadHostDesktopMessage(reader io.Reader) (HostDesktopMessage, error)
ReadHostDesktopMessage reads bounded native framing without starting a helper, owning a session, retrying input or granting paint acknowledgement.
type HostDesktopPicture ¶
type HostDesktopPicture struct {
FrameWindow int `json:"frame_window,omitempty"`
Mode string `json:"mode"`
MaxDimension int `json:"max_dimension"`
FrameRate int `json:"frame_rate"`
Audio bool `json:"audio"`
NativePixels bool `json:"native_pixels,omitempty"`
Codecs []string `json:"codecs,omitempty"`
}
func (HostDesktopPicture) FrameCapacity ¶ added in v0.22.48
func (p HostDesktopPicture) FrameCapacity() int
FrameCapacity resolves an omitted protocol-v1 offer to the legacy window.
type HostDesktopServiceStatus ¶
type HostDesktopServiceStatus struct {
State string `json:"state"`
Reason string `json:"reason,omitempty"`
Backend string `json:"backend,omitempty"`
}
HostDesktopServiceStatus is the stable, redacted status of the optional login-screen service. It intentionally contains no installation path or credential material.
type LoginScreenConnection ¶
type LoginScreenConnection struct {
// contains filtered or unexported fields
}
LoginScreenConnection is the existing physical-desktop protocol carried over the local service socket. Authentication is a short-lived, single-use ticket tied to the live Runtime UID, PID, start time and administrator-pinned image. Close revokes the attachment, releasing its held kernel input devices.
func OpenLoginScreenSession ¶
func OpenLoginScreenSession(ctx context.Context, path string) (*LoginScreenConnection, error)
func (*LoginScreenConnection) Close ¶
func (c *LoginScreenConnection) Close() error
func (*LoginScreenConnection) Control ¶
func (c *LoginScreenConnection) Control() <-chan HostDesktopMessage
func (*LoginScreenConnection) Done ¶
func (c *LoginScreenConnection) Done() <-chan struct{}
func (*LoginScreenConnection) Media ¶
func (c *LoginScreenConnection) Media() <-chan HostDesktopMessage
func (*LoginScreenConnection) Send ¶
func (c *LoginScreenConnection) Send(command HostDesktopCommand, _ bool) error
type LoginServiceAdmissionProof ¶ added in v0.23.2
type LoginServiceConfig ¶
type LoginServiceConfig struct {
SocketPath string
WorkerPath string
MediaRoot string
RuntimeUID, RuntimeGID uint32
RuntimeSHA256 string
PolicyDigest string
DeploymentJournal string
Seat string
}
LoginServiceConfig contains administrator-installed, root-owned policy only. It is never populated from a viewer request. No credential belongs here.
type LoginServiceDeploymentCommand ¶ added in v0.23.0
type LoginServiceDeploymentControl ¶ added in v0.23.0
type LoginServiceDeploymentControl func(context.Context, LoginServiceDeploymentEvent) error
Control waits for confirmation or authenticated Runtime proof. An error cancels the single manager-owned transaction; credentials never belong here.
type LoginServiceDeploymentEvent ¶
type LoginServiceDeploymentEvent struct {
Stage string `json:"stage"`
Code string `json:"code,omitempty"`
Rollback string `json:"rollback,omitempty"`
OperationID string `json:"operation_id,omitempty"`
ChallengeID string `json:"challenge_id,omitempty"`
ServiceGeneration string `json:"service_generation,omitempty"`
PolicyDigest string `json:"policy_digest,omitempty"`
ActiveConnections *int `json:"active_connections,omitempty"`
}
type LoginServiceDeploymentRequest ¶
type LoginServiceDeploymentRequest struct {
Operation string `json:"operation"`
SourceDirectory string `json:"source_directory,omitempty"`
RuntimeUID uint32 `json:"runtime_uid,omitempty"`
RuntimeGID uint32 `json:"runtime_gid,omitempty"`
RuntimeSHA256 string `json:"runtime_sha256,omitempty"`
ServiceSHA256 string `json:"service_sha256,omitempty"`
WorkerSHA256 string `json:"worker_sha256,omitempty"`
MediaSHA256 string `json:"media_sha256,omitempty"`
Version int `json:"version,omitempty"`
OperationID string `json:"operation_id,omitempty"`
RuntimePID uint32 `json:"runtime_pid,omitempty"`
RuntimeStart string `json:"runtime_start,omitempty"`
}
LoginServiceDeploymentRequest is resolved by the trusted SSH adapter after explicit authorization. The manager is already privileged and never elevates.
type LoginServicePolicy ¶ added in v0.23.0
type LoginServicePolicy struct {
RuntimeUID uint32 `json:"runtime_uid,omitempty"`
RuntimeGID uint32 `json:"runtime_gid,omitempty"`
RuntimeSHA256 string `json:"runtime_sha256,omitempty"`
ServiceSHA256 string `json:"service_sha256,omitempty"`
WorkerSHA256 string `json:"worker_sha256,omitempty"`
MediaSHA256 string `json:"media_sha256,omitempty"`
}
LoginServicePolicy is the persistent administrator-owned allowlist.
type ServiceStatus ¶
type ServiceStatus = HostDesktopServiceStatus
func InstalledLoginServiceStatus ¶
func InstalledLoginServiceStatus(ctx context.Context, path string) (ServiceStatus, error)
InstalledLoginServiceStatus is read-only. A running service is not a claim that any particular scanout layout is supported; attachment capture reports that independently, without requesting Portal consent or elevation.
func ManageLoginScreenServiceControlled ¶ added in v0.23.0
func ManageLoginScreenServiceControlled(ctx context.Context, request LoginServiceDeploymentRequest, report func(LoginServiceDeploymentEvent), control LoginServiceDeploymentControl) (ServiceStatus, error)
Source Files
¶
- deployment.go
- deployment_driver_linux.go
- deployment_health_linux.go
- deployment_linux.go
- deployment_media_linux.go
- deployment_protocol.go
- deployment_transaction_linux.go
- login_authority_linux.go
- login_capture_linux.go
- login_client.go
- login_compositor_linux.go
- login_display_power_linux.go
- login_identity_linux.go
- login_maintenance.go
- login_maintenance_linux.go
- login_media_linux.go
- login_media_socket_linux.go
- login_seat_linux.go
- login_service.go
- login_service_linux.go
- login_text_linux.go
- protocol.go
- service_status.go
- uinput_linux.go