From c00e2a446f0efe79cbd9f607a50537100e58c031 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Tue, 17 Mar 2026 07:17:44 -0400 Subject: [PATCH] feat: wire RDP service into Wails app Register RDPService on WraithApp with a mock backend factory and expose it as a Wails service in main.go so the frontend can call RDP methods via bindings. The factory will be swapped to a FreeRDP purego backend when running on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/app/app.go | 9 +++++++++ main.go | 1 + 2 files changed, 10 insertions(+) diff --git a/internal/app/app.go b/internal/app/app.go index 8b4e183..7f39988 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -12,6 +12,7 @@ import ( "github.com/vstockwell/wraith/internal/credentials" "github.com/vstockwell/wraith/internal/db" "github.com/vstockwell/wraith/internal/plugin" + "github.com/vstockwell/wraith/internal/rdp" "github.com/vstockwell/wraith/internal/session" "github.com/vstockwell/wraith/internal/settings" "github.com/vstockwell/wraith/internal/sftp" @@ -32,6 +33,7 @@ type WraithApp struct { Plugins *plugin.Registry SSH *ssh.SSHService SFTP *sftp.SFTPService + RDP *rdp.RDPService Credentials *credentials.CredentialService unlocked bool } @@ -66,6 +68,12 @@ func New() (*WraithApp, error) { }) sftpSvc := sftp.NewSFTPService() + // RDP service with mock backend factory for development. + // In production on Windows, the factory will return a FreeRDP-backed implementation. + rdpSvc := rdp.NewRDPService(func() rdp.RDPBackend { + return rdp.NewMockBackend() + }) + // CredentialService requires the vault to be unlocked, so it starts nil. // It is created lazily after the vault is unlocked via initCredentials(). @@ -83,6 +91,7 @@ func New() (*WraithApp, error) { Plugins: pluginReg, SSH: sshSvc, SFTP: sftpSvc, + RDP: rdpSvc, }, nil } diff --git a/main.go b/main.go index f81e181..1940ae1 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ func main() { application.NewService(wraith.Settings), application.NewService(wraith.SSH), application.NewService(wraith.SFTP), + application.NewService(wraith.RDP), }, Assets: application.AssetOptions{ Handler: application.BundledAssetFileServer(assets),