tabby-rdp 0.5.3 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,125 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.6
4
+
5
+ **Fixed**
6
+ - **Profiles for one address sign in as their own users** ([#104](https://github.com/meanaverage/tabby-rdp/issues/104)).
7
+ A saved password was kept for the address, so every remote desktop profile for it signed in with the first one
8
+ saved, whatever user name the profile gave. Each user's password is now saved on its own, profiles for different
9
+ users open side by side rather than bringing the first one's tab forward (for Windows, `Alice` and `alice` are one
10
+ user), and editing or removing one profile leaves the others' passwords and the address's certificate. A password
11
+ saved before goes to the profile of the user it is for the first time that profile connects; the others ask once,
12
+ and so do profiles for the same user name in different domains when it was saved without one. Signing in from a
13
+ profile's form as someone else keeps that login for that user, not as the profile's. A profile that names no user
14
+ signs in with the address's password, as before.
15
+
16
+ **Changed**
17
+ - **No shrinkwrap is published.** The plugin's runtime dependencies, `semver` and `ws`, are pinned to exact versions
18
+ in `package.json`, and packing refuses a runtime dependency that isn't exact or that brings dependencies of its own,
19
+ so `package.json` alone decides what npm installs. The development lock is `package-lock.json`, which npm never
20
+ publishes. Release checks still compare the packed package with the tagged commit.
21
+
22
+ **Documentation**
23
+ - Saved accounts are described as what they are, a login defined once to pick in any desktop, rather than mainly a
24
+ way to share one, and the README says that several profiles for one address each keep their own user's password.
25
+
26
+ **Compatibility notes**
27
+ - **Going back to 0.5.5 or earlier** after 0.5.6 has saved passwords for profiles that name a user: those versions
28
+ look for a profile's password under its address alone, so such profiles ask for it again there, and removing one of
29
+ them there leaves the password 0.5.6 saved for its user behind. It is listed in Tabby's Vault (as the address and
30
+ user), or under `tabby-rdp` in the system keychain, where it can be deleted.
31
+
32
+ ## 0.5.5
33
+
34
+ **Fixed**
35
+ - **The development Angular dependency is updated to 21.2.25**, replacing the vulnerable 15.2.10 pin. The complete
36
+ locked dependency tree passes the npm advisory audit, including the seven Angular advisories reported against
37
+ 0.5.4. This updates the plugin's build dependency; Tabby's bundled Angular remains controlled by Tabby.
38
+ - **Published dependency metadata includes only the plugin's runtime dependencies.** Build/test dependencies and
39
+ build scripts stay in the source checkout. The published shrinkwrap retains exact runtime versions, download URLs
40
+ and integrity hashes, and omits development-only entries. Playwright's browser installer helpers no longer belong
41
+ to the published plugin's dependency graph.
42
+ - **Publication checks verify the exact metadata transformation against the tagged source**, and still compare all
43
+ other packaged source files and vendor binaries. CI audits all development dependencies and tests the packed plugin
44
+ in native Tabby on macOS, Windows and Linux.
45
+
46
+ Version 0.5.4 was deprecated and unpublished from npm while these findings were addressed; its GitHub release was
47
+ returned to draft. The scanner's separate warning about the presence of a shrinkwrap remains an intentional packaging
48
+ tradeoff; this release retains the reviewed runtime lock.
49
+
50
+ ## 0.5.4
51
+
52
+ Expanded Linux desktop qualification, cross-platform visual QA and RDP security hardening.
53
+
54
+ **Added**
55
+ - **Cross-platform visual QA against real desktops:** native Tabby clients on macOS, Windows and Linux cover
56
+ Ubuntu 24.04 / GNOME 46, Fedora 44 / GNOME 50, Debian 13.7 / GNOME 48, Rocky Linux 9 / Xfce with xrdp, and
57
+ Windows 11. Checks capture desktop pixels, keyboard input, resize, tab return and reconnect with reviewed baselines
58
+ and recorded client, server and plugin identities. RDP qualification currently uses ARM64 clients.
59
+ - **A local visual QA dashboard** runs tests and opens screenshot evidence, HTML reports and traces. It includes
60
+ history, scheduling, retention, automatic failure investigation and optional AI review. Credentials, private target
61
+ configuration and run artifacts stay outside the published package and repository.
62
+ - **Tests of the visual tests:** controlled defect injection verifies that the deterministic checks detect all 13
63
+ tested defects on all three client platforms. Optional AI review remains advisory, with its misses recorded.
64
+ - **Hosted native smoke checks on macOS, Windows and Linux** validate plugin loading and settings in CI. Real RDP
65
+ tests use separately configured machines; hosted smoke results do not stand in for desktop qualification.
66
+ - **An experimental Fedora KDE / KRDP testbed** covers H.264 with FreeRDP 3.32.1 on the server, using two opt-in
67
+ server patches for color and authentication compatibility. The fixed-monitor profile passes on all three native
68
+ client platforms. Stock server variants and live remote monitor resizing remain unqualified. The plugin's RDP
69
+ client remains IronRDP; Rocky Linux's tested traditional desktop stack is Xfce with xrdp.
70
+
71
+ **Changed**
72
+ - **Standard dialogs use Tabby's own window drag region**, available in Tabby 1.0.238
73
+ ([upstream #11766](https://github.com/Eugeny/tabby/pull/11766)). The plugin no longer adds a fallback to host dialogs.
74
+ Older Tabby versions still work, but need updating to move the window while a standard dialog is open.
75
+ The plugin's custom settings overlays retain their own drag strips.
76
+
77
+ **Security** (the rest of the review of 0.5.3-rc.1; all of these were in 0.5.2 too)
78
+ - **The RD Gateway's NTLM sign-in is always bound to its TLS connection.** A challenge without the target information
79
+ or the time that the binding goes with is refused, rather than answered without the binding and the integrity code.
80
+ - **A server can no longer fill Tabby's memory with clipboard answers it doesn't read.** The local proxy stopped
81
+ reading the client when the server fell behind, so answers piled up uncounted in the window until it crashed. It
82
+ now goes on reading, counts what waits for the server against the room file transfers already keep within, and
83
+ ends the connection once 104 MB waits.
84
+ - **H.264 decoders are held to 16 per desktop**, including decoders still finishing frames after their surfaces end.
85
+ A surface gets one only with a key frame. IronRDP owns admission, accounting and cleanup through its public decoder
86
+ configuration; the earlier wrapper that evicted surfaces by editing private decoder state is removed.
87
+ Exceeding the cap fails H.264 and takes the existing reconnect-without-H.264 path.
88
+ - **A shared folder's listing gives the server at most 10,000 names**, read a few at a time, rather than the whole
89
+ folder for each listing the server asks for. A name past those is still there to open by its path, though not to
90
+ find by a query of the folder. How many listings the server may have open at once (one per folder handle) isn't
91
+ bounded yet, so this slows what a server can have the desktop keep rather than ends it.
92
+
93
+ **Additional security hardening** (#77–87)
94
+
95
+ - **CredSSP requires version 5 or later** before authentication continues. Servers offering only versions 2–4
96
+ must be updated; accepting their TLS certificate does not enable the legacy authentication binding.
97
+ - **Graphics decoding and caches have dimension, allocation and retained-state limits.** Static and dynamic
98
+ virtual-channel reassembly also has per-message limits and an aggregate incomplete-dynamic-message budget.
99
+ These limits are per session, not a total memory ceiling for Tabby's window.
100
+ - **Clipboard format lists are bounded and supported formats are selected in one pass.** Shared-drive work is
101
+ limited to 1,024 queued or in-flight requests and 64 MiB of encoded request data, with a resource error when full.
102
+ - **Generated GNOME credentials are stored per machine identifier.** Each host rotates to fresh credentials when
103
+ next set up; this does not isolate hosts from someone who can read or modify their shared home directory.
104
+ - **Runtime dependencies are pinned and shipped with an npm shrinkwrap.** Testbed images require verified hashes,
105
+ WinRM dependencies and the Electron CI tree are locked, and testbed credential media is privately staged and cleaned.
106
+ The internal-name CI check receives its secret only on protected branch pushes; it is inactive on an unprotected RC.
107
+
108
+ **EGFX/H.264 integration** (#88)
109
+
110
+ - **Graphics work waiting behind asynchronous decoding is bounded by count and bytes.** PDUs are processed
111
+ incrementally, AVC regions and frames per message are limited, and completions no longer scan the command queue.
112
+ - **Browser decoder input, creation rate, picture readbacks and decoded-pixel events have separate budgets.**
113
+ Surface deletion/reset closes ended streams even without a later H.264 frame. Failure and close release retained
114
+ pictures and suppress late readback callbacks. These budgets are per session and add together; they are not one
115
+ total renderer memory ceiling.
116
+ - **The combined patch series is rebuilt into the shipped JavaScript/WASM**, including the public decoder-cap
117
+ integration and bounded key-frame admission tests.
118
+
119
+ **Known limits:** the aggregate open-listing limit above and live Windows H.264/shared-folder checks remain pending.
120
+ The visual QA matrix does not qualify those paths; KDE qualification is limited to the patched, fixed-monitor profile.
121
+ See [visual QA coverage](docs/visual-qa.md) for the checks actually performed.
122
+
3
123
  ## 0.5.3
4
124
 
5
125
  **Added**
package/README.md CHANGED
@@ -25,7 +25,8 @@ remote desktop profiles can also connect directly or through an RD Gateway.
25
25
 
26
26
  - **Linux desktops without a monitor or a login.** The plugin starts a headless GNOME session for your SSH user with
27
27
  GNOME Remote Desktop, on the fly, without root. A server in a rack works as well as a workstation.
28
- - **Other Linux desktops** (KDE, XFCE, MATE, Cinnamon, …) through xrdp, where it runs: the plugin finds it by itself.
28
+ - **Other Linux desktops** through xrdp, including tested Rocky Linux 9 with Xfce. KDE, MATE, Cinnamon and
29
+ other desktops can also run in xrdp sessions; the plugin finds the server by itself.
29
30
  - **Windows desktops** behind any SSH host, such as a VM on your build server, and the desktop of a Windows machine
30
31
  you SSH into.
31
32
  - **Remote desktop profiles** for machines you reach without SSH (LAN, VPN): in Tabby's profile list, in a tab of their
@@ -62,6 +63,7 @@ Making it work with GNOME took fixes in IronRDP, which we contribute upstream ([
62
63
  - [desk: the console on the desktop](#desk-the-console-on-the-desktop)
63
64
  - [Settings](#settings)
64
65
  - [Requirements](#requirements)
66
+ - [Tested environments](#tested-environments)
65
67
  - [Built on IronRDP](#built-on-ironrdp)
66
68
  - [Development](#development)
67
69
  - [Limitations](#limitations)
@@ -112,6 +114,17 @@ The first connection to a machine takes a few seconds while it prepares GNOME Re
112
114
  ones take well under a second. The same shortcut switches between the desktop and the console, and the desktop keeps
113
115
  running in the background until you disconnect or close the tab.
114
116
 
117
+ GNOME's generated password and TLS key belong to each SSH user and machine. They are kept under
118
+ `~/.local/share/tabby-rdp/hosts/<machine-id>/`, with private directory/file permissions. Linux needs a valid,
119
+ initialized `/etc/machine-id`; cloned machines must have distinct IDs. On the first connection after this change,
120
+ each machine gets new credentials and GNOME Remote Desktop restarts, disconnecting any existing RDP clients.
121
+ Reconnect to **every** machine using a shared home to rotate all active credentials. Old home-wide credential files
122
+ are preserved for machines still using an earlier version, but this version never imports them.
123
+
124
+ Separate credentials prevent accidental reuse across machines; they do not isolate machines that let the same
125
+ account read or write the shared home. That account can still read every machine's stored secrets and GNOME's own
126
+ shared configuration. Use separate accounts or host-local homes when those machines need independent trust.
127
+
115
128
  A machine without GNOME but with [xrdp](https://github.com/neutrinolabs/xrdp) running (the usual RDP server for KDE,
116
129
  XFCE, MATE and the rest) gets xrdp's desktop instead: sign in with your Linux password, which the plugin can remember
117
130
  in the system keychain. xrdp takes the password without Network Level Authentication, and that the machine's desktop
@@ -154,7 +167,7 @@ connecting again.
154
167
  | **Screenshots** | **Save a screenshot** in the desktop's menus saves the remote screen at its full resolution as a PNG in Downloads, and copies it to the clipboard. |
155
168
  | **Connection status** | Optionally, a small line in the corner of the desktop with the throughput each way, frames per second, the SSH round trip, and how it is connected (desktop, host, resolution, graphics mode, sharpness). |
156
169
  | **Reconnecting** | After sleep or a network change, the desktop reconnects by itself once the connection is back. |
157
- | **Sign-in** | GNOME desktops need none: the plugin manages their credentials. Windows and xrdp desktops ask for the account once and can remember it, in Tabby's Vault when that is on and in the system keychain otherwise; **Sign in again…** in the menu replaces it. Desktops that share an account can use a [saved account](#saved-accounts), whose password is kept once. |
170
+ | **Sign-in** | GNOME desktops need none: the plugin manages their credentials. Windows and xrdp desktops ask for the account once and can remember it, in Tabby's Vault when that is on and in the system keychain otherwise; **Sign in again…** in the menu replaces it. A [saved account](#saved-accounts) defines a login once, to pick in any desktop. |
158
171
  | **Shortcuts** | Switching between the desktop and the console, view only, a screenshot, Ctrl+Alt+Del, typing into or pasting to all desktops of a tab, the connection status and Disconnect each have a hotkey, set on the settings page or in Tabby's Hotkeys. They work while the desktop has the keyboard; a key another hotkey has is refused. |
159
172
  | **Certificates** | GNOME desktops accept only the certificate the plugin made for them. A desktop you connect to directly, and an RD Gateway, connect without a question when their certificate is valid for their name by the certificate authorities this computer trusts; any other is shown, with why it can't be verified, its fingerprint and what it says of itself (whom it was issued to and by, and its dates), and connected only once you trust it. What it says of itself is its own word, unless its chain leads to an authority this computer trusts (another machine's certificate then shows that machine's name) and the TLS library didn't refuse it for a reason of its own (a limit set on the authority, say): an issuer you would expect there proves nothing, since anyone can make a certificate that names it; only the fingerprint, checked with whoever runs the server some other way, does. Desktops behind an SSH host remember theirs on first use. A different certificate later stops the connection and asks, but for one an authority vouches for in place of one it vouched for (a renewal); and one remembered on an authority's word is asked about again once it no longer validates. |
160
173
  | **Passwords stay with servers that know them** | Windows signs in with Network Level Authentication: a proof both ways, where the password only reaches a server that knows it already. A Windows desktop whose server doesn't use it would get the password as it is, so the connection stops and asks first, before your password or user name is sent. xrdp signs in that way by design, so desktops you made xrdp ones aren't asked about; one that is xrdp only by a host's word (a VM it lists, a machine reached through it, the host's own desktop) is asked about once. The answer is kept with the certificate of the server you gave it for: another certificate, a new address or a forgotten certificate asks again. |
@@ -233,7 +246,10 @@ xrdp or GNOME Remote Desktop), and optionally the user name and domain. It then
233
246
  SSH profiles do, and opens in a tab of its own that the desktop fills; there is no console under it. Sign-in, the
234
247
  keychain, certificates, resize, sharpness, clipboard, files, sound, microphone, **Send keys**, view only, screenshots
235
248
  and reconnecting work as in SSH tabs. After **Disconnect**, the tab offers **Connect**. In the profile selector you can
236
- also type `user@host:port` and pick **Quick connect (REMOTE DESKTOP (RDP))**.
249
+ also type `user@host:port` and pick **Quick connect (REMOTE DESKTOP (RDP))**. Several profiles can lead to one address,
250
+ each signing in as another user: each user's password is saved on its own, their desktops open side by side, and
251
+ editing or removing one profile leaves the others' passwords and the address's certificate alone. A profile that names
252
+ no user asks who, and signs in with the password saved for the address by another such profile.
237
253
 
238
254
  **Import an .rdp file…** (in the menu's **Settings**, or **Remote desktop: import an .rdp file…** in Tabby's command
239
255
  palette) makes such a profile from a file saved by Remote Desktop Connection or handed out by an admin: its address,
@@ -342,8 +358,10 @@ and one-time codes at the gateway are not supported.
342
358
 
343
359
  ## Saved accounts
344
360
 
345
- Several desktops often share one account: a domain admin, a lab user. A saved account keeps that user name (and
346
- domain) under a name, with its password stored once, so when the password changes it is entered once for all of them.
361
+ A saved account is a login defined on its own: a name, a user name (and domain), and its password, stored once. Any
362
+ desktop can pick it instead of typing a user name into its profile, and both ways work: a profile's own user name keeps
363
+ its own saved password, per user, for that address. An account is handy for keeping logins in one place, and for one
364
+ used on several desktops (a domain admin, a lab user), whose password is then changed once for all of them.
347
365
 
348
366
  **Settings › Remote Desktop › Accounts** lists them, with the desktops that use each one (click a name to open its
349
367
  settings), and adds, edits and removes them. A desktop picks its account in its profile's **Account** field, or in the
@@ -556,15 +574,35 @@ are local to this computer:
556
574
  - **Windows desktops:** Windows 10 or 11 Pro, or Windows Server, with Remote Desktop turned on, reachable from an SSH
557
575
  host or running OpenSSH Server itself.
558
576
 
559
- Tested with Ubuntu 24.04 (GNOME Remote Desktop 46.3) and Windows 11 (Pro and Enterprise), from Tabby on macOS,
560
- Windows 11 and Ubuntu 24.04 (arm64). Recent host compatibility tests cover official Tabby **1.0.238** on macOS
561
- with xterm 5, and upstream xterm 6 builds on macOS and Linux. The new package installation dialog is tested on
562
- macOS with Tabby 1.0.238; Windows qualification of these changes remains pending. See the
563
- [host test matrix](test/README.md#host-qualification) for the exact builds and coverage.
564
-
565
577
  The plugin checks the host's available features through a shared compatibility layer. Connection logs include the
566
578
  host and runtime versions, declared xterm dependency and observed capabilities to help diagnose forks and nightlies.
567
579
 
580
+ ## Tested environments
581
+
582
+ The visual QA matrix runs real remote desktops in native Tabby clients on **macOS, Windows and Linux**. The current
583
+ RDP matrix uses ARM64 Tabby 1.0.236 / Electron 43.7.0 on all three client platforms:
584
+
585
+ | Remote desktop | Server stack | Visual QA coverage |
586
+ |---|---|---|
587
+ | Ubuntu 24.04 | GNOME 46 / GNOME Remote Desktop | Desktop pixels, keyboard input, resize, tab return and reconnect |
588
+ | Fedora 44 | GNOME 50 / GNOME Remote Desktop | Same RDP lifecycle checks |
589
+ | Debian 13.7 | GNOME 48 / GNOME Remote Desktop | Same RDP lifecycle checks |
590
+ | Rocky Linux 9 | Xfce 4.18 / xrdp 0.10.6.1 / xorgxrdp 0.10.5 | Same RDP lifecycle checks |
591
+ | Windows 11 | Windows Remote Desktop | Same RDP lifecycle checks, with H.264 disabled |
592
+ | Fedora 44 KDE Plasma | KRDP / KPipeWire 6.7.5, FreeRDP 3.32.1; two opt-in server patches | H.264 pixels, input, tab return, reconnect and fixed-monitor client fitting |
593
+
594
+ The KDE row is experimental: the tested profile needs server-side color and authentication compatibility patches.
595
+ Stock KDE builds and live remote monitor resizing are not qualified. FreeRDP is a dependency of that KRDP server;
596
+ tabby-rdp's client continues to use IronRDP. Rocky's Xfce desktop uses **xrdp**, a different RDP server.
597
+ The testbed includes the opt-in KDE patches and reproducible setup instructions; see the
598
+ [visual QA guide](docs/visual-qa.md) for exact identities, evidence and remaining gaps.
599
+
600
+ Hosted CI also runs native settings and plugin smoke checks on macOS, Windows and Linux; those checks do not qualify
601
+ x86_64 RDP sessions. Recent host compatibility tests cover official Tabby **1.0.238** on macOS with xterm 5, and
602
+ upstream xterm 6 builds on macOS and Linux. The package installation dialog is tested on macOS with Tabby 1.0.238;
603
+ Windows qualification of that dialog remains pending. See the [host test matrix](test/README.md#host-qualification).
604
+ These focused checks do not establish clipboard, shared-folder, audio or microphone coverage across every matrix cell.
605
+
568
606
  ## Built on IronRDP
569
607
 
570
608
  The desktop is [IronRDP](https://github.com/Devolutions/IronRDP)'s web client: an RDP implementation in Rust, compiled
@@ -604,11 +642,15 @@ npm ci --ignore-scripts
604
642
  npm run build # TypeScript to dist/
605
643
  npm run typecheck # plugin and test TypeScript
606
644
  npm run test:unit # standard unit suite; no remote machine needed
645
+ npm run pack:release # publishable package with runtime-only dependency metadata
607
646
  scripts/sandbox.sh # a separate Tabby with this plugin linked in (macOS), DevTools on port 9334
608
647
  npm test # end-to-end suites against a test machine: see test/README.md
609
648
  npm run build:ironrdp # rebuild vendor/ from IronRDP and ironrdp/patches: see ironrdp/README.md
610
649
  ```
611
650
 
651
+ - [docs/visual-qa.md](docs/visual-qa.md): the local visual QA dashboard, native client/server matrix, reviewed screenshot
652
+ baselines, defect injection, optional AI review, scheduling and evidence retention. Run `npm run test:qa` for its
653
+ service tests; follow the guide to configure real desktop targets. Private credentials and run artifacts stay local.
612
654
  - [docs/architecture.md](docs/architecture.md): how the pieces fit, the remote setup, and security notes.
613
655
  - [docs/desk.md](docs/desk.md): `desk` and trd-pty.
614
656
  - [test/README.md](test/README.md) and [testbed/README.md](testbed/README.md): the tests, and setting up test
@@ -24,6 +24,7 @@ const targets_1 = require("./targets");
24
24
  const deskScript_1 = require("./deskScript");
25
25
  const audio_1 = require("./audio");
26
26
  const ironrdp_1 = require("./ironrdp");
27
+ const h264_1 = require("./h264");
27
28
  const clipboard_1 = require("./clipboard");
28
29
  const connectionStatus_1 = require("./connectionStatus");
29
30
  const microphone_1 = require("./microphone");
@@ -83,6 +84,8 @@ const vendorFile = (f) => path.join(__dirname, '..', 'vendor', f);
83
84
  const vendor = (f) => (0, url_1.pathToFileURL)(vendorFile(f)).href;
84
85
  const STYLE = `
85
86
  .trd-overlay { position: absolute; inset: 0; z-index: 30; display: flex; background: #111; }
87
+ /* Only full-window settings overlays expose their drag strip (see settingsPage.ts). */
88
+ .trd-form-dragbar { display: none; }
86
89
  .trd-host { flex: auto; min-width: 0; min-height: 0; display: flex; }
87
90
  .trd-host iron-remote-desktop { flex: auto; }
88
91
  .trd-last-frame { max-width: 100%; max-height: 100%; object-fit: contain; align-self: center; margin: auto; }
@@ -186,19 +189,38 @@ class DesktopSession {
186
189
  return this.spec.hyperv ? this.key.replace(/#hyperv:[^#]*$/, '#hyperv') : this.key;
187
190
  }
188
191
  /**
189
- * Where a saved password is kept: under authKey, and whenever the desktop is reached through an RD Gateway, that
190
- * gateway too (see gatewayScope), whether the gateway takes the desktop's sign-in or an account of its own: a
191
- * password saved for one gateway (or for a connection without one) is never sent through a different gateway named
192
- * for the same address without asking. The certificate and the "without NLA" decision stay keyed by authKey: those
193
- * are the desktop's, not the gateway's.
192
+ * Where a saved password is kept: under authKey, for a direct desktop the user it signs in as (see userScope), and
193
+ * whenever the desktop is reached through an RD Gateway, that gateway too (see gatewayScope), whether the gateway
194
+ * takes the desktop's sign-in or an account of its own: a password saved for one gateway (or for a connection
195
+ * without one) is never sent through a different gateway named for the same address without asking, and one saved
196
+ * for one user is never another profile's for the same address. The certificate and the "without NLA" decision
197
+ * stay keyed by authKey: those are the server's, whoever signs in, not the gateway's.
194
198
  */
195
199
  get credentialKey() {
196
- return this.authKey + (0, signin_1.gatewayScope)(this.spec.gateway);
200
+ return this.credentialKeyFor(this.user);
201
+ }
202
+ /** Where a password for `user` (see signsInAs) is kept for this desktop: its credentialKey, for that user. */
203
+ credentialKeyFor(user) {
204
+ return this.authKey + (0, desktops_1.userScope)(user) + (0, signin_1.gatewayScope)(this.spec.gateway);
197
205
  }
198
- /** `key`: see sessionKey(); one desktop per key. */
199
- constructor(container, key, spec) {
206
+ /**
207
+ * Where a direct desktop that names its user kept its saved password before 0.5.6: under the address alone,
208
+ * whoever it was for (see adoptCredentials). Null for one that doesn't name a user: its key is still that one.
209
+ */
210
+ get formerCredentialKey() {
211
+ return this.user ? this.authKey + (0, signin_1.gatewayScope)(this.spec.gateway) : null;
212
+ }
213
+ /**
214
+ * `key`: see sessionKey(). `user`: who a direct desktop's saved password is for (see signsInAs), '' for any other.
215
+ * `who`: who it signs in as (its saved account's name, else `user`, or whoever its form signed in as instead): one
216
+ * desktop per key and user, since each user of a server (a Windows server's, xrdp's) has a session of their own
217
+ * there.
218
+ */
219
+ constructor(container, key, spec, user = '', who = user) {
200
220
  this.key = key;
201
221
  this.spec = spec;
222
+ this.user = user;
223
+ this.who = who;
202
224
  this.state = 'connecting';
203
225
  this.visible = false;
204
226
  this.proxy = null;
@@ -1217,11 +1239,29 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1217
1239
  * desktop as it was unused, until it can be read while this window is open (see forgetLater). That is said, of that
1218
1240
  * store. After a new address the certificate stays at the old one as well as going along (below), whichever
1219
1241
  * passwords stayed there.
1220
- */
1221
- async desktopEdited(fromId, toId, accountChanged, direct, gateways) {
1242
+ *
1243
+ * A direct desktop (an RDP profile, `users` given) keeps a password for each user at an address (see
1244
+ * credentialKey), and other profiles can lead to the same address: its password goes as above only where it was
1245
+ * for the user it signed in as before (`users.from`, see signsInAs), and only where no other profile (the edited
1246
+ * one, `users.except`, aside) signs in with it; another user's, a profile's whose user is now another, stays for
1247
+ * the profiles that still sign in as them. Its saved account, if it has one, is the account's, whatever the edit. Nor
1248
+ * do the certificate, sharpness and "without NLA" decision leave an address another profile still leads to.
1249
+ */
1250
+ async desktopEdited(fromId, toId, accountChanged, direct, gateways, users) {
1222
1251
  const scope = (0, signin_1.gatewayScope)(gateways.from);
1252
+ const inUse = users ? this.directInUse(users.except) : null;
1223
1253
  let waiting = [];
1224
- if (accountChanged || scope !== (0, signin_1.gatewayScope)(gateways.to)) {
1254
+ if (users && inUse) {
1255
+ const which = { direct: true, user: (0, desktops_1.userScope)(users.from), owns: (c) => (0, desktops_1.isLoginOf)(c.username, users.from), scope, keep: inUse.keys };
1256
+ // A profile that names no user keeps the address's password: a new domain or account drops it, as before.
1257
+ if (users.from !== users.to || scope !== (0, signin_1.gatewayScope)(gateways.to) || accountChanged && !users.from) {
1258
+ waiting = await (0, signin_1.forgetCredentialsFor)(fromId, which);
1259
+ }
1260
+ else if (fromId !== toId) {
1261
+ waiting = await (0, signin_1.moveCredentialsFor)(fromId, toId, which, key => this.trustedCertificates().some(e => e.desktop === key));
1262
+ }
1263
+ }
1264
+ else if (accountChanged || scope !== (0, signin_1.gatewayScope)(gateways.to)) {
1225
1265
  waiting = await (0, signin_1.forgetCredentialsFor)(fromId, { direct, scope });
1226
1266
  }
1227
1267
  else if (fromId !== toId) {
@@ -1244,6 +1284,8 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1244
1284
  return id === fromId && (direct ? target === desktops_1.DIRECT_KEY : target !== desktops_1.DIRECT_KEY && target !== 'gateway');
1245
1285
  };
1246
1286
  const store = this.config.store.remoteDesktop;
1287
+ // Another profile still leads to the old address: what is kept there stays for it, as well as going along.
1288
+ const stays = !!inUse?.ids.has(fromId);
1247
1289
  // The certificates go along and stay at the old address too. What is kept there still goes only to the machine
1248
1290
  // it was saved for, and another machine answering there meets the certificate question rather than being
1249
1291
  // trusted as a first use: the password of another desktop at that address, reached another way (a certificate
@@ -1255,7 +1297,7 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1255
1297
  // entry is dropped rather than put next to it, where either could be the one found.
1256
1298
  const isMoved = (e) => typeof e?.desktop === 'string' && moved(e.desktop);
1257
1299
  const taken = new Set(store[list].filter((e) => !isMoved(e)).map((e) => e?.desktop));
1258
- const kept = list === 'trustedCertificates';
1300
+ const kept = list === 'trustedCertificates' || stays;
1259
1301
  store[list] = store[list].flatMap((e) => {
1260
1302
  if (!isMoved(e)) {
1261
1303
  return [e];
@@ -1265,7 +1307,7 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1265
1307
  });
1266
1308
  }
1267
1309
  }
1268
- if (Array.isArray(store.withoutNla)) {
1310
+ if (Array.isArray(store.withoutNla) && !stays) {
1269
1311
  store.withoutNla = store.withoutNla.filter((e) => !(typeof e?.desktop === 'string' && moved(e.desktop)));
1270
1312
  }
1271
1313
  this.config.save();
@@ -1552,18 +1594,62 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1552
1594
  * password from going to a machine that isn't the one it was saved for, where a desktop behind a host trusts the
1553
1595
  * first certificate it meets unasked. The user is told, and can forget them in Settings › Remote Desktop ›
1554
1596
  * Certificates. `what` names the desktop for that.
1555
- */
1556
- async forgetDesktop(id, direct, what) {
1557
- const waiting = await (0, signin_1.forgetCredentialsFor)(id, direct ? { direct: true } : {});
1597
+ *
1598
+ * A direct desktop (an RDP profile, `users` given) whose address another profile (`users.except`, the one going,
1599
+ * aside) still leads to takes only the passwords of its own user (`users.user`, see signsInAs) that no such
1600
+ * profile signs in with, and leaves the certificate to them.
1601
+ */
1602
+ async forgetDesktop(id, direct, what, users) {
1603
+ const inUse = direct && users ? this.directInUse(users.except) : null;
1604
+ const shared = !!inUse?.ids.has(id);
1605
+ const own = shared && users ? { user: (0, desktops_1.userScope)(users.user), owns: (c) => (0, desktops_1.isLoginOf)(c.username, users.user), keep: inUse.keys } : {};
1606
+ const waiting = await (0, signin_1.forgetCredentialsFor)(id, direct ? { direct: true, ...own } : {});
1558
1607
  if (waiting.length) {
1559
1608
  this.notifications.info(`If a password was saved for ${what}, ${this.passwordWaits(waiting)} Its remembered certificate stays, ` +
1560
1609
  'so that the password can only go to that machine: Settings › Remote Desktop › Certificates can forget it.');
1561
1610
  return;
1562
1611
  }
1612
+ if (shared) {
1613
+ return;
1614
+ }
1563
1615
  this.forgetCertificatesFor(id, direct);
1564
1616
  this.config.save();
1565
1617
  this.changed$.next();
1566
1618
  }
1619
+ /**
1620
+ * What the direct desktops (RDP profiles of their own, not through an SSH host) other than the profile `except`
1621
+ * use, as Tabby opens them (their group's defaults included): the keys of their saved passwords (see
1622
+ * credentialKey: each user's, for each gateway), their addresses, and each one's address, user (see signsInAs) and
1623
+ * gateway (see gatewayScope). A profile in a shape nothing reads is left out.
1624
+ */
1625
+ directInUse(except) {
1626
+ const keys = new Set();
1627
+ const ids = new Set();
1628
+ const found = [];
1629
+ const profiles = this.config.store.profiles;
1630
+ for (const p of Array.isArray(profiles) ? profiles : []) {
1631
+ if (p?.type !== targets_1.RDP_PROFILE_TYPE || except !== undefined && p.id === except) {
1632
+ continue;
1633
+ }
1634
+ let options = p.options;
1635
+ try {
1636
+ options = this.profiles.getConfigProxyForProfile(p).options;
1637
+ }
1638
+ catch { }
1639
+ try {
1640
+ const spec = options?.host && !(0, desktops_1.configText)(options.via) ? (0, desktops_1.specOf)({ ...options, wake: undefined }) : null;
1641
+ if (spec) {
1642
+ const who = (0, desktops_1.signsInAs)(spec);
1643
+ const scope = (0, signin_1.gatewayScope)(spec.gateway);
1644
+ ids.add(spec.id);
1645
+ keys.add(`${desktops_1.DIRECT_KEY}#${spec.id}${(0, desktops_1.userScope)(who)}${scope}`);
1646
+ found.push({ id: spec.id, who, scope });
1647
+ }
1648
+ }
1649
+ catch { }
1650
+ }
1651
+ return { keys, ids, profiles: found };
1652
+ }
1567
1653
  /**
1568
1654
  * What becomes of a desktop's saved password that couldn't be removed from `waiting`, the stores that can't be read
1569
1655
  * just now (see forgetCredentialsFor), as the end of a sentence.
@@ -1614,9 +1700,10 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1614
1700
  }
1615
1701
  this.lastUsed.set(target.key, spec.id);
1616
1702
  const key = (0, desktops_1.sessionKey)(target, spec);
1617
- // One desktop per key: another client would only get an extra, empty monitor (GNOME), or take
1703
+ const { user, who } = this.signsInAs(target, spec);
1704
+ // One desktop per key and user: another client would only get an extra, empty monitor (GNOME), or take
1618
1705
  // over the session (Windows).
1619
- const existing = this.paneWithDesktopFor(key);
1706
+ const existing = this.paneWithDesktopFor(key, who);
1620
1707
  if (existing) {
1621
1708
  if (existing.parent instanceof tabby_core_1.SplitTabComponent && existing.parent === pane.parent) {
1622
1709
  // Next to it, moving the focus there would go unnoticed.
@@ -1632,7 +1719,7 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1632
1719
  this.selectPane(existing);
1633
1720
  return this.showDesktop(existing);
1634
1721
  }
1635
- const created = new DesktopSession(pane.element.nativeElement, key, spec);
1722
+ const created = new DesktopSession(pane.element.nativeElement, key, spec, user, who);
1636
1723
  created.onHelp = message => this.help.explain(message);
1637
1724
  // The remote it is opened on, from the start: reopening one whose connection ended before it got as far as
1638
1725
  // a sign-in (cancelled, or a setup that failed) goes there again, not to the tab's own host.
@@ -1969,11 +2056,27 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
1969
2056
  if (!target || this.has(pane)) {
1970
2057
  return false;
1971
2058
  }
1972
- return !!this.paneWithDesktopFor((0, desktops_1.sessionKey)(target, spec ?? this.defaultDesktop(target)));
2059
+ const desktop = spec ?? this.defaultDesktop(target);
2060
+ return !!this.paneWithDesktopFor((0, desktops_1.sessionKey)(target, desktop), this.signsInAs(target, desktop).who);
2061
+ }
2062
+ /**
2063
+ * Who a desktop opened from `target` signs in as, where that tells desktops at one address apart (see
2064
+ * DesktopSession's `user` and `who`): a direct one's own user (see signsInAs), and its saved account's sign-in name,
2065
+ * if it has one, in any case for Windows, whose user names and domains are (`Alice` is alice, and signing in as
2066
+ * her takes her session over). Nobody for one behind an SSH host, which is the only desktop at its address there
2067
+ * (its form refuses a second, see addressTaken).
2068
+ */
2069
+ signsInAs(target, spec) {
2070
+ if (target.key !== desktops_1.DIRECT_KEY) {
2071
+ return { user: '', who: '' };
2072
+ }
2073
+ const user = (0, desktops_1.signsInAs)(spec);
2074
+ const account = spec.account ? this.accounts().find(a => a.id === spec.account) : undefined;
2075
+ return { user, who: whoOf(spec, account ? (0, accounts_1.signInName)(account) : user) };
1973
2076
  }
1974
- paneWithDesktopFor(key) {
2077
+ paneWithDesktopFor(key, who = '') {
1975
2078
  for (const [pane, session] of this.sessions) {
1976
- if (session.key === key && session.state !== 'ended') {
2079
+ if (session.key === key && session.who === who && session.state !== 'ended') {
1977
2080
  return pane;
1978
2081
  }
1979
2082
  }
@@ -2874,6 +2977,23 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
2874
2977
  const again = this.askAgain.delete(pane);
2875
2978
  // A desktop whose account is gone asks, rather than falling back to a login of its own saved earlier.
2876
2979
  let saved = retryError || again || spec.account && !account ? null : await (0, signin_1.loadCredentials)(account ? (0, accounts_1.accountKey)(account.id) : session.credentialKey);
2980
+ // Saved before 0.5.6, under the address alone, by whichever profile for it signed in first: this desktop's
2981
+ // once it is for this desktop's user (another profile's is left for that one), and from now on kept as such.
2982
+ if (saved && !account && session.user && !(0, desktops_1.isLoginOf)(saved.username, session.user)) {
2983
+ // Kept for this desktop's user by a version that saved another login there: not this desktop's.
2984
+ session.log.push(`sign-in: the saved password is for ${saved.username}, not ${session.user}; asking`);
2985
+ saved = null;
2986
+ }
2987
+ // A password saved before 0.5.6 named its user without a domain where the profile gave the domain on its own: one
2988
+ // another profile at the address could be for too (alice, of another domain) stays where it is, and this asks.
2989
+ const former = session.formerCredentialKey;
2990
+ if (!saved && !retryError && !again && !spec.account && former) {
2991
+ const others = this.directInUse().profiles.filter(p => p.id === spec.id && p.scope === (0, signin_1.gatewayScope)(spec.gateway) && p.who !== session.user);
2992
+ saved = await (0, signin_1.adoptCredentials)(former, session.credentialKey, found => (0, desktops_1.isLoginOf)(found.username, session.user) && !others.some(p => (0, desktops_1.isLoginOf)(found.username, p.who)));
2993
+ if (saved) {
2994
+ session.log.push(`sign-in: the password saved for this address as ${saved.username}, now kept for that user`);
2995
+ }
2996
+ }
2877
2997
  if (saved && account && saved.username !== (0, accounts_1.signInName)(account)) {
2878
2998
  // Kept for an earlier user name of the account (its change didn't reach the store): not this one's.
2879
2999
  session.log.push(`sign-in: the account's saved password is for ${saved.username}, not ${(0, accounts_1.signInName)(account)}; asking`);
@@ -2905,9 +3025,16 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
2905
3025
  setTimeout(() => session.visible && this.showsInFront(session) && session.focusDesktop());
2906
3026
  }
2907
3027
  const entered = await asked;
3028
+ // Signed in as another user than the desktop names: kept for that user, not as this desktop's own, and that
3029
+ // user's desktop from now on (see paneWithDesktopFor).
3030
+ const as = entered && !account && session.user ? (0, desktops_1.signsInAs)({ username: entered.username, domain: spec.domain }) : '';
3031
+ if (as && as !== session.user) {
3032
+ session.who = whoOf(spec, as);
3033
+ }
2908
3034
  return entered && {
2909
3035
  host: spec.host, port: spec.port, credentials: entered, remember: entered.remember, domain: account ? account.domain ?? '' : undefined,
2910
3036
  saveKey: account && (0, accounts_1.accountKey)(account.id), saveLabel: account && `saved account ${account.name}`, saveFor: account && (0, accounts_1.signInName)(account),
3037
+ ...as && as !== session.user ? { saveUser: as } : {},
2911
3038
  hyperv, mark, accountRevision,
2912
3039
  };
2913
3040
  }
@@ -3671,7 +3798,9 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
3671
3798
  return { connected: false };
3672
3799
  }
3673
3800
  if (h264) {
3674
- session.h264 = new rdp.WebCodecsH264Decoder({ onFailure: (reason) => session.log.push(`h264: failed: ${reason}`) });
3801
+ // The vendor owns surface retirement and all resource accounting; its public option bounds the
3802
+ // browser decoders without wrapping away lifecycle notifications (see h264.ts).
3803
+ session.h264 = (0, h264_1.createH264Decoder)(rdp.WebCodecsH264Decoder, { onFailure: (reason) => session.log.push(`h264: failed: ${reason}`) });
3675
3804
  config.withExtension(rdp.h264Decoder(session.h264));
3676
3805
  }
3677
3806
  // GNOME Remote Desktop requires the graphics pipeline. Windows (and xrdp) do better with bitmaps than with
@@ -3772,13 +3901,13 @@ let RemoteDesktopService = RemoteDesktopService_1 = class RemoteDesktopService {
3772
3901
  const key = endpoint.saveKey;
3773
3902
  (0, signin_1.saveCredentialsIf)(key, credentials, () => this.accountCurrent(key, endpoint.saveFor, endpoint.accountRevision), endpoint.saveLabel).then(saved => session.log.push(saved ? `sign-in: saved as the account's password in ${(0, signin_1.storeName)()}` : 'sign-in: not saved: the account changed meanwhile'), e => session.log.push(`sign-in: ${(0, signin_1.storeName)()}: ${e?.message ?? e}`));
3774
3903
  }
3775
- else if (endpoint.remember && endpoint.mark !== undefined && (0, signin_1.forgottenSince)(session.credentialKey, endpoint.mark)) {
3904
+ else if (endpoint.remember && endpoint.mark !== undefined && (0, signin_1.forgottenSince)(endpoint.saveUser !== undefined ? session.credentialKeyFor(endpoint.saveUser) : session.credentialKey, endpoint.mark)) {
3776
3905
  // Edited (its user name, gateway or address) or removed while the server delayed the sign-in: what was
3777
3906
  // forgotten then stays forgotten, and the desktop asks the next time.
3778
3907
  session.log.push('sign-in: not saved: the desktop was changed or removed meanwhile');
3779
3908
  }
3780
3909
  else if (endpoint.remember) {
3781
- const key = endpoint.saveKey ?? session.credentialKey;
3910
+ const key = endpoint.saveKey ?? (endpoint.saveUser !== undefined ? session.credentialKeyFor(endpoint.saveUser) : session.credentialKey);
3782
3911
  const writing = (0, signin_1.forgetMark)();
3783
3912
  (0, signin_1.saveCredentials)(key, credentials, endpoint.saveLabel).then(() => {
3784
3913
  // A forget that came while it was being written (an edit, a removal) found nothing to forget
@@ -3844,46 +3973,17 @@ exports.RemoteDesktopService = RemoteDesktopService = RemoteDesktopService_1 = _
3844
3973
  tabby_core_1.SelectorService,
3845
3974
  tabby_core_1.PlatformService])
3846
3975
  ], RemoteDesktopService);
3976
+ /** A desktop's `who` (see DesktopSession) as compared: in any case for Windows, whose user names and domains are. */
3977
+ function whoOf(spec, who) {
3978
+ return spec.kind === 'windows' ? who.toLowerCase() : who;
3979
+ }
3847
3980
  let styleInstalled = false;
3848
- function installStyle(compat) {
3981
+ function installStyle() {
3849
3982
  if (styleInstalled) {
3850
3983
  return;
3851
3984
  }
3852
3985
  styleInstalled = true;
3853
3986
  const style = document.createElement('style');
3854
- style.textContent = STYLE + signin_1.STYLE + fileTransfer_1.STYLE + connectionStatus_1.STYLE + osd_1.OSD_STYLE + DRAGBAR_STYLE + accountForm_1.STYLE;
3987
+ style.textContent = STYLE + signin_1.STYLE + fileTransfer_1.STYLE + connectionStatus_1.STYLE + osd_1.OSD_STYLE + accountForm_1.STYLE;
3855
3988
  document.head.appendChild(style);
3856
- keepWindowDraggable(compat);
3857
- }
3858
- /** A strip the height of the tab bar that stays a window drag region over a dialog (the plugin's, and Tabby's). */
3859
- const DRAGBAR_STYLE = `
3860
- .trd-form-dragbar { display: none; }
3861
- .modal > .trd-form-dragbar { display: block; position: fixed; left: 0; right: 0; top: 0; height: var(--tabs-height, 38px); -webkit-app-region: drag; }
3862
- `;
3863
- /**
3864
- * Older Tabby dialogs cover the tab bar without a drag region. Supply their fallback strip, deferring to the host's
3865
- * modal pseudo-element when it provides one. The plugin's own dialogs still need their strips (see settingsPage.ts).
3866
- */
3867
- function keepWindowDraggable(compat) {
3868
- const strip = (modal) => {
3869
- if (compat.hasNativeModalDragRegion(modal)) {
3870
- return;
3871
- }
3872
- if (!modal.querySelector(':scope > .trd-form-dragbar')) {
3873
- const bar = document.createElement('div');
3874
- bar.className = 'trd-form-dragbar';
3875
- modal.prepend(bar);
3876
- }
3877
- };
3878
- // ng-bootstrap appends each dialog (ngb-modal-window.modal) to the body itself: only the body's children are watched.
3879
- document.querySelectorAll('body > .modal').forEach(strip);
3880
- new MutationObserver(records => {
3881
- for (const record of records) {
3882
- record.addedNodes.forEach(node => {
3883
- if (node instanceof Element && node.classList.contains('modal')) {
3884
- strip(node);
3885
- }
3886
- });
3887
- }
3888
- }).observe(document.body, { childList: true });
3889
3989
  }