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) <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell 2026-03-17 07:17:44 -04:00
parent 949ed6e672
commit c00e2a446f
2 changed files with 10 additions and 0 deletions

View File

@ -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
}

View File

@ -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),