rdp

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceNTLM int = iota
	SourceSmartCard
	SourceCurrent
	SourceBasic
	SourceUserSelect
	SourceCookie
)
View Source
const (
	CRLF = "\r\n"
)

Variables

This section is empty.

Functions

func NormalizeRdpKey

func NormalizeRdpKey(s string) string

NormalizeRdpKey returns the canonical, URL-friendly form of an rdp tag (lowercase, no whitespace). Used to look up fields by query parameter name and to compare entries in the operator-supplied allow-list. For example, "use multimon", "Use Multimon" and "usemultimon" all normalize to "usemultimon".

Types

type Builder

type Builder struct {
	Settings RdpSettings
	Metadata mapstructure.Metadata
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder() *Builder

func NewBuilderFromFile

func NewBuilderFromFile(filename string) (*Builder, error)

func (*Builder) ApplyOverrides

func (rb *Builder) ApplyOverrides(values map[string][]string, allowed []string) error

ApplyOverrides applies a set of caller-supplied RDP option overrides onto the Builder's settings. Each input key is normalized via NormalizeRdpKey and matched against the rdp struct tags of RdpSettings. Keys that do not match any field are ignored (so passing the entire request query is safe). Keys that match a field but are not present in allowed return an error: the allow-list is opt-in by design and empty by default.

Values are validated against the field's Go type: bools accept 0/1 or true/false; ints must parse as base-10 integers; strings are taken verbatim. Overridden fields are tracked so they always serialize, even when the new value equals the field's default.

func (*Builder) String

func (rb *Builder) String() string

type RdpSettings

type RdpSettings struct {
	AllowFontSmoothing                    bool   `rdp:"allow font smoothing" default:"0"`
	AllowDesktopComposition               bool   `rdp:"allow desktop composition" default:"0"`
	DisableFullWindowDrag                 bool   `rdp:"disable full window drag" default:"0"`
	DisableMenuAnims                      bool   `rdp:"disable menu anims" default:"0"`
	DisableThemes                         bool   `rdp:"disable themes" default:"0"`
	DisableCursorSetting                  bool   `rdp:"disable cursor setting" default:"0"`
	GatewayHostname                       string `rdp:"gatewayhostname"`
	FullAddress                           string `rdp:"full address"`
	AlternateFullAddress                  string `rdp:"alternate full address"`
	Username                              string `rdp:"username"`
	Domain                                string `rdp:"domain"`
	GatewayCredentialsSource              int    `rdp:"gatewaycredentialssource" default:"0"`
	GatewayCredentialMethod               int    `rdp:"gatewayprofileusagemethod" default:"0"`
	GatewayUsageMethod                    int    `rdp:"gatewayusagemethod" default:"0"`
	GatewayAccessToken                    string `rdp:"gatewayaccesstoken"`
	PromptCredentialsOnce                 bool   `rdp:"promptcredentialonce" default:"true"`
	AuthenticationLevel                   int    `rdp:"authentication level" default:"3"`
	EnableCredSSPSupport                  bool   `rdp:"enablecredsspsupport" default:"true"`
	EnableRdsAasAuth                      bool   `rdp:"enablerdsaadauth" default:"false"`
	DisableConnectionSharing              bool   `rdp:"disableconnectionsharing" default:"false"`
	AlternateShell                        string `rdp:"alternate shell"`
	AutoReconnectionEnabled               bool   `rdp:"autoreconnection enabled" default:"true"`
	BandwidthAutodetect                   bool   `rdp:"bandwidthautodetect" default:"true"`
	NetworkAutodetect                     bool   `rdp:"networkautodetect" default:"true"`
	Compression                           bool   `rdp:"compression" default:"true"`
	VideoPlaybackMode                     bool   `rdp:"videoplaybackmode" default:"true"`
	ConnectionType                        int    `rdp:"connection type" default:"2"`
	AudioCaptureMode                      bool   `rdp:"audiocapturemode" default:"false"`
	EncodeRedirectedVideoCapture          bool   `rdp:"encode redirected video capture" default:"true"`
	RedirectedVideoCaptureEncodingQuality int    `rdp:"redirected video capture encoding quality" default:"0"`
	AudioMode                             int    `rdp:"audiomode" default:"0"`
	CameraStoreRedirect                   string `rdp:"camerastoredirect" default:"false"`
	DeviceStoreRedirect                   string `rdp:"devicestoredirect" default:"false"`
	DriveStoreRedirect                    string `rdp:"drivestoredirect" default:"false"`
	KeyboardHook                          int    `rdp:"keyboardhook" default:"2"`
	RedirectClipboard                     bool   `rdp:"redirectclipboard" default:"true"`
	RedirectComPorts                      bool   `rdp:"redirectcomports" default:"false"`
	RedirectLocation                      bool   `rdp:"redirectlocation" default:"false"`
	RedirectPrinters                      bool   `rdp:"redirectprinters" default:"true"`
	RedirectSmartcards                    bool   `rdp:"redirectsmartcards" default:"true"`
	RedirectWebAuthn                      bool   `rdp:"redirectwebauthn" default:"true"`
	UsbDeviceStoRedirect                  string `rdp:"usbdevicestoredirect"`
	UseMultimon                           bool   `rdp:"use multimon" default:"false"`
	SelectedMonitors                      string `rdp:"selectedmonitors"`
	MaximizeToCurrentDisplays             bool   `rdp:"maximizetocurrentdisplays" default:"false"`
	SingleMonInWindowedMode               bool   `rdp:"singlemoninwindowedmode" default:"0"`
	ScreenModeId                          int    `rdp:"screen mode id" default:"2"`
	SmartSizing                           bool   `rdp:"smart sizing" default:"false"`
	DynamicResolution                     bool   `rdp:"dynamic resolution" default:"true"`
	DesktopSizeId                         int    `rdp:"desktop size id"`
	DesktopHeight                         int    `rdp:"desktopheight"`
	DesktopWidth                          int    `rdp:"desktopwidth"`
	DesktopScaleFactor                    int    `rdp:"desktopscalefactor"`
	BitmapCacheSize                       int    `rdp:"bitmapcachesize" default:"1500"`
	BitmapCachePersistEnable              bool   `rdp:"bitmapcachepersistenable" default:"true"`
	RemoteApplicationCmdLine              string `rdp:"remoteapplicationcmdline"`
	RemoteAppExpandWorkingDir             bool   `rdp:"remoteapplicationexpandworkingdir" default:"true"`
	RemoteApplicationFile                 string `rdp:"remoteapplicationfile" default:"true"`
	RemoteApplicationIcon                 string `rdp:"remoteapplicationicon"`
	RemoteApplicationMode                 bool   `rdp:"remoteapplicationmode" default:"false"`
	RemoteApplicationName                 string `rdp:"remoteapplicationname"`
	RemoteApplicationProgram              string `rdp:"remoteapplicationprogram"`
}

Directories

Path Synopsis
koanf

Jump to

Keyboard shortcuts

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