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/dist/signin.js CHANGED
@@ -18,6 +18,7 @@ exports.gatewayScope = gatewayScope;
18
18
  exports.isFor = isFor;
19
19
  exports.forgetCredentialsFor = forgetCredentialsFor;
20
20
  exports.moveCredentialsFor = moveCredentialsFor;
21
+ exports.adoptCredentials = adoptCredentials;
21
22
  exports.forgetFormerKey = forgetFormerKey;
22
23
  exports.askCredentials = askCredentials;
23
24
  /**
@@ -68,8 +69,9 @@ function vaultKey(key) {
68
69
  return { key };
69
70
  }
70
71
  function vaultName(key) {
71
- const { target, desktopId, gateway } = (0, desktops_1.keyParts)(key);
72
- const where = `${desktopId}${gateway ? gateway.replace('@gateway#', ' through gateway ') : ''}`;
72
+ const { target, desktopId, user, gateway } = (0, desktops_1.keyParts)(key);
73
+ const as = user ? ` as ${user.slice('@user#'.length).replace(/%([0-9A-F]{2})/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))}` : '';
74
+ const where = `${desktopId}${as}${gateway ? gateway.replace('@gateway#', ' through gateway ') : ''}`;
73
75
  return target === 'account' ? `saved account` : target === desktops_1.DIRECT_KEY ? `${where} (direct)` : desktopId ? `${where} behind ${target}` : target;
74
76
  }
75
77
  // The system keychain can keep a call waiting indefinitely: on Linux, a locked or missing keyring waits for an unlock
@@ -208,12 +210,6 @@ async function keychainOnce(mark, forgets) {
208
210
  await keychain(store => store.setPassword(KEYCHAIN_SERVICE, mark, 'done'));
209
211
  return true;
210
212
  }
211
- /**
212
- * Forgets that couldn't be done when they were asked for (see forgetLater), each of one store's part: the Vault's
213
- * (`inVault`), or the keychain's. Each is done the next time its store is used and can be read (see used, doLater),
214
- * and what it would forget isn't looked up in that store meanwhile (see withheld). `saved`: keys a password was saved
215
- * under in that store since, which is a new one, and stays. Kept in this window's memory, for as long as it is open.
216
- */
217
213
  const later = [];
218
214
  let laterRunning = null;
219
215
  /**
@@ -318,20 +314,17 @@ async function loadCredentials(key) {
318
314
  return null;
319
315
  }
320
316
  async function loadSaved(key) {
321
- if (vaultOn() && !withheld(key, true)) {
322
- try {
323
- const secret = await vault.getSecret(exports.VAULT_SECRET_TYPE, vaultKey(key));
324
- const found = parseCredentials(secret?.value);
325
- if (found) {
326
- return found;
327
- }
328
- }
329
- catch { }
330
- }
331
- if (withheld(key, false)) {
317
+ return await loadIn(true, key) ?? await loadIn(false, key);
318
+ }
319
+ /** What one store (the Vault while it is on, or with `inVault` false the keychain) has under `key`, or null. */
320
+ async function loadIn(inVault, key) {
321
+ if (withheld(key, inVault)) {
332
322
  return null;
333
323
  }
334
324
  try {
325
+ if (inVault) {
326
+ return vaultOn() ? parseCredentials((await vault.getSecret(exports.VAULT_SECRET_TYPE, vaultKey(key)))?.value) : null;
327
+ }
335
328
  return parseCredentials(await keychain(store => store.getPassword(KEYCHAIN_SERVICE, key)));
336
329
  }
337
330
  catch {
@@ -532,8 +525,13 @@ async function entriesOf(inVault) {
532
525
  */
533
526
  async function forgetListed(inVault, entries, forgets, kept) {
534
527
  let done = true;
535
- for (const key of new Set(entries.map(({ account }) => account))) {
536
- if (!kept?.has(key) && forgets(key)) {
528
+ const seen = new Set();
529
+ for (const { account: key, password } of entries) {
530
+ if (seen.has(key)) {
531
+ continue;
532
+ }
533
+ seen.add(key);
534
+ if (!kept?.has(key) && forgets(key, password)) {
537
535
  try {
538
536
  await forgetIn(inVault, key);
539
537
  }
@@ -556,14 +554,17 @@ function gatewayScope(gateway) {
556
554
  return parsed ? `@gateway#${parsed.host}:${parsed.port}` : '';
557
555
  }
558
556
  /**
559
- * Whether a credential key is one of a desktop's saved passwords (see SavedFor). Anchored on the key's parts, so an
560
- * unrelated key that merely ends in `#<id>` (a gateway pin, or a desktop whose own id is a suffix of another's) isn't
561
- * matched; a gateway suffix on the key doesn't change the id.
557
+ * Whether a credential key is one of a desktop's saved passwords (see SavedFor), with `stored`, the login saved there,
558
+ * where it is at hand (see Forgets). Anchored on the key's parts, so an unrelated key that merely ends in `#<id>` (a
559
+ * gateway pin, or a desktop whose own id is a suffix of another's) isn't matched; a user or gateway suffix on the key
560
+ * doesn't change the id.
562
561
  */
563
- function isFor(account, desktopId, which) {
564
- const { target, desktopId: id, gateway } = (0, desktops_1.keyParts)(account);
562
+ function isFor(account, desktopId, which, stored) {
563
+ const { target, desktopId: id, user, gateway } = (0, desktops_1.keyParts)(account);
564
+ const unscoped = user === '' && which.user !== undefined && which.user !== '';
565
+ const owned = !unscoped || !which.owns || stored === undefined || (c => !!c && which.owns(c))(parseCredentials(stored));
565
566
  return id === desktopId && (which.direct ? target === desktops_1.DIRECT_KEY : target !== desktops_1.DIRECT_KEY && target !== 'gateway' && target !== 'account') &&
566
- (which.scope === undefined || gateway === which.scope);
567
+ (which.user === undefined || user === which.user || unscoped) && owned && (which.scope === undefined || gateway === which.scope) && !which.keep?.has(account);
567
568
  }
568
569
  /**
569
570
  * Forgets a desktop's saved passwords (see SavedFor; by default those behind any SSH host, for any gateway), from each
@@ -573,7 +574,7 @@ function isFor(account, desktopId, which) {
573
574
  * Returns the stores whose part waits (none, as a rule).
574
575
  */
575
576
  async function forgetCredentialsFor(desktopId, which = {}) {
576
- const forgets = (key) => isFor(key, desktopId, which);
577
+ const forgets = (key, stored) => isFor(key, desktopId, which, stored);
577
578
  noteForget(forgets);
578
579
  await used();
579
580
  const waiting = [];
@@ -609,7 +610,7 @@ async function forgetCredentialsFor(desktopId, which = {}) {
609
610
  * certificate stays (see RemoteDesktopService.desktopEdited).
610
611
  */
611
612
  async function moveCredentialsFor(fromId, toId, which = {}, known = () => false) {
612
- const forgets = (key) => isFor(key, fromId, which);
613
+ const forgets = (key, stored) => isFor(key, fromId, which, stored);
613
614
  noteForget(forgets);
614
615
  await used();
615
616
  const stores = [];
@@ -623,8 +624,8 @@ async function moveCredentialsFor(fromId, toId, which = {}, known = () => false)
623
624
  for (const { account, password } of entries ?? []) {
624
625
  const credentials = parseCredentials(password);
625
626
  const { target, gateway } = (0, desktops_1.keyParts)(account);
626
- if (forgets(account) && credentials) {
627
- const to = `${target}#${toId}${gateway}`;
627
+ if (forgets(account, password) && credentials) {
628
+ const to = `${target}#${toId}${(0, desktops_1.keyParts)(account).user}${gateway}`;
628
629
  const pinned = target === desktops_1.DIRECT_KEY || known(`${target}#${fromId}`);
629
630
  try {
630
631
  if (!taken.has(to) && !known(`${target}#${toId}`) && pinned && !withheld(account, inVault)) {
@@ -648,6 +649,30 @@ async function moveCredentialsFor(fromId, toId, which = {}, known = () => false)
648
649
  }
649
650
  return waiting;
650
651
  }
652
+ /**
653
+ * A direct desktop's saved password from before passwords were kept for each user at an address (0.5.6): under the
654
+ * address alone (`from`), where any profile for that address found it, whoever it was for. Taken to `to`, the key of
655
+ * the desktop's own user (see userScope), where `ours` says it is for that user, and forgotten at `from` in the store
656
+ * it was found in only: the other store (the keychain beside a synced Vault, say) can hold another user's there. Left
657
+ * where it is otherwise, for the desktop it is for. Null where there is none to take.
658
+ */
659
+ async function adoptCredentials(from, to, ours) {
660
+ await used();
661
+ for (const inVault of [true, false]) {
662
+ const found = await loadIn(inVault, from);
663
+ if (found && ours(found)) {
664
+ // Forgotten there only once saved here: should the store refuse, it is found there again next time.
665
+ try {
666
+ await saveCredentials(to, found);
667
+ noteForget(key => key === from);
668
+ await forgetIn(inVault, from);
669
+ }
670
+ catch { }
671
+ return found;
672
+ }
673
+ }
674
+ return null;
675
+ }
651
676
  /**
652
677
  * A target's key changed from `from`, a key no target has any more, whose saved passwords nothing moves (see
653
678
  * RemoteTargets.keyChanged): those under it (its own desktop's and those of the desktops behind it, see rekeyed) are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabby-rdp",
3
- "version": "0.5.3",
3
+ "version": "0.5.6",
4
4
  "description": "Remote desktops in Tabby's SSH tabs: Linux (GNOME) and Windows, through the SSH connection, with clipboard, files and sound. Built on IronRDP.",
5
5
  "keywords": [
6
6
  "tabby-plugin",
@@ -37,34 +37,13 @@
37
37
  "engines": {
38
38
  "node": ">=18"
39
39
  },
40
- "scripts": {
41
- "build": "tsc -p tsconfig.json",
42
- "watch": "tsc -p tsconfig.json --watch --sourceMap",
43
- "typecheck": "tsc -p tsconfig.json --noEmit && npm run typecheck:test",
44
- "typecheck:test": "tsc -p tsconfig.test.json",
45
- "test": "tsx test/run.ts",
46
- "test:smoke": "tsx test/run.ts --packed --hidden smoke-host smoke-rdp direct",
47
- "test:unit": "tsx --test test/unit/*.ts",
48
- "build:ironrdp": "scripts/build-ironrdp.sh",
49
- "prepublishOnly": "npm run build"
50
- },
51
40
  "dependencies": {
52
- "semver": "^7.8.5",
53
- "ws": "^8.21.1"
54
- },
55
- "devDependencies": {
56
- "@angular/core": "15.2.10",
57
- "@types/node": "^20.19.0",
58
- "@types/semver": "^7.8.0",
59
- "rxjs": "7.8.2",
60
- "tabby-core": "1.0.231-nightly.0",
61
- "tabby-settings": "1.0.231-nightly.0",
62
- "tabby-terminal": "1.0.231-nightly.0",
63
- "tsx": "^4.23.15",
64
- "typescript": "~5.9.3"
41
+ "semver": "7.8.5",
42
+ "ws": "8.21.3"
65
43
  },
66
44
  "tabbyRdp": {
67
45
  "minimumTabbyVersion": "1.0.236",
68
- "rollbackFloor": "0.5.3"
46
+ "rollbackFloor": "0.5.3",
47
+ "packageFormat": 2
69
48
  }
70
49
  }
package/vendor/SHA256SUMS CHANGED
@@ -20,8 +20,38 @@ a9029bbb677deb208eda1202daec144b6a9e033fc987480eab4bf8b8e0ac70d6 ironrdp/patche
20
20
  459b08a00dc1e0341e1e80c0dab9b724b952b886964042ebe6ed9d80be5880c4 ironrdp/patches/0015-feat-web-drive-redirection-through-a-JavaScript-file.patch
21
21
  d67aa6029edb142daa1e5069fa79ab1917687474a89a61bd221081f204ba8e12 ironrdp/patches/0016-fix-svc-send-chunked-messages-without-CHANNEL_FLAG_S.patch
22
22
  35a592496b2c735d78450cf417e16a260143af2490817e57cd6a13b5f5b340c4 ironrdp/patches/0017-perf-web-read-H.264-regions-that-are-far-apart-one-b.patch
23
+ 1715a443e12656a5f6ba7646bfecb7e9c4125649c0769822e744b108e68bfb1f ironrdp/patches/0018-fix-svc-bound-the-reassembly-of-chunked-static-chann.patch
24
+ 5928118be28c813dd3a937d809351dde34cbf8b9f1687c224205319744588a89 ironrdp/patches/0019-fix-dvc-bound-the-reassembly-of-fragmented-dynamic-c.patch
25
+ 1911fc562afef57b93d19116acfb85ac98784f2b01fb98c6f8f69d637ab1c3ae ironrdp/patches/0020-fix-web-bound-the-drive-requests-waiting-for-the-fil.patch
26
+ 2c861bec8e42f7cc6d5bfafa24aac3b00a68e9c2e37b98e08c79f8ea77ef0544 ironrdp/patches/0025-fix-connector-require-nonce-bound-CredSSP-version-5-.patch
27
+ 097ea5fb18d690c0792a63722efdbcff6c3ee1aae4dc6f6d779dabe690284156 ironrdp/patches/0027-fix-cliprdr-cap-the-formats-and-format-names-a-Forma.patch
28
+ 35f11dcfb3d3b09359efd08050452cbc0448f2381332fbc16870177e6d7d5d80 ironrdp/patches/0028-fix-web-go-through-a-remote-format-list-once-fetchin.patch
29
+ 5d258f721c90dd8a327a4ddbefb1c4ca674102b76c3e27f0b60cc94a943359d6 ironrdp/patches/0031-fix-graphics-egfx-cap-RDP6-planar-images-at-8192-pix.patch
30
+ 99bbd5a95db8f511c638873d1beada8863776c3dbe55ea6ca0e6ce410e533ea3 ironrdp/patches/0032-fix-pdu-graphics-decode-ClearCodec-bands-one-V-bar-a.patch
31
+ 08a31eb5a9e4f205a9d49ef63e78b9d50bf950e0c4037e747816316666933ad4 ironrdp/patches/0033-fix-graphics-refuse-pointers-larger-than-384x384.patch
32
+ 1c685f7d29696f7f52ffd9314394ab4a31a6f5ce19f6b5c41b0aa65e2bc49b95 ironrdp/patches/0034-fix-session-keep-pointers-only-in-the-32-pointer-cac.patch
33
+ 71ce56fe6a22512791ed3643da9afbf31f5ed0fcb4010c2a803463f2e5577aea ironrdp/patches/0035-fix-graphics-cap-the-memory-the-Progressive-decoder-.patch
34
+ e9f46da71a587208e23483441161a4c22352cfa380b22715b37fd189595da62c ironrdp/patches/0036-fix-graphics-limit-the-tiles-one-Progressive-bitmap-.patch
35
+ 7c405811f17eae21f0ce7124a02bb090a3c8a8fcc8f46a40b0b626fd51e91710 ironrdp/patches/0037-fix-pdu-graphics-read-Progressive-bitmap-streams-one.patch
36
+ 868eb376e5b48659f174c48d39ec28ff04db26373280d5b56135591aa4d30c8c ironrdp/patches/0038-fix-graphics-egfx-allocate-the-ClearCodec-image-fall.patch
37
+ 8f83041ed062bdf91e6e1c07ba51413c1ac4ed99d8ed7e5928b6c6a9c2ecbc65 ironrdp/patches/0039-fix-pdu-graphics-decode-ClearCodec-residual-subcodec.patch
38
+ a856b1f8cd209f2b9b65f2af23cc26da1d0865198c747c4a947bfd84de013987 ironrdp/patches/0040-fix-graphics-decode-ClearCodec-NSCodec-regions-strai.patch
39
+ c6dbaa82813c7ba99eabaeacdb221a175971b0afd65f75e5ba07795cac9d8412 ironrdp/patches/0041-fix-graphics-bound-how-much-ClearCodec-subcodec-regi.patch
40
+ a285a1ba35dd4d009f7d4f017699ecfe5a73f5259d83c6304e0d8c6f853f02c8 ironrdp/patches/0042-fix-egfx-track-only-the-surfaces-the-compositor-can-.patch
41
+ e9cfa61b65dac322e9c0fe62c1731bd282db2d67f2637458209bc828ecc48952 ironrdp/patches/0043-fix-egfx-bound-the-region-rectangles-of-an-H.264-fra.patch
42
+ fcd90483a5b1453e763af51675994f55a6c13abf456670d0cc430ab209cbe71b ironrdp/patches/0044-fix-egfx-bound-what-waits-for-the-external-H.264-dec.patch
43
+ 65fc06e6dd8e151d6c3a6c8db61de667b304a59709c1ac0c83b07f014f4764a2 ironrdp/patches/0045-fix-egfx-process-the-PDUs-of-a-message-as-they-are-d.patch
44
+ 2216173c2a4931253be343afc787437c4cf8e2a268bb4adad82d4a8d3e745b1f ironrdp/patches/0046-fix-egfx-bound-the-frames-one-message-carries.patch
45
+ f8450921517717d4845160bcad8279678ffbd8dac86c3fa8c9e86626b65175a9 ironrdp/patches/0047-fix-web-bound-the-H.264-the-decoders-hold.patch
46
+ d84a7753a9ef6604534395e2e5169625b4d4f8105c1e506034e90b22c2ade061 ironrdp/patches/0048-fix-web-close-the-H.264-decoders-of-surfaces-that-ar.patch
47
+ c1cbc903a6f4e5b2261fbfc6d5ef6b5381d441e9360d0358d3151415788432c3 ironrdp/patches/0049-fix-web-bound-the-pictures-the-H.264-decoders-read-b.patch
48
+ 7cea73065dd42673be02fbea71d86765bd50c5683929b360a6e5b74c1b9f3a91 ironrdp/patches/0050-fix-web-find-the-bounding-box-of-H.264-regions-witho.patch
49
+ 2be2e12e2846e15ecb6d319a70346c601fed1e2739122d4a5fd95f438fe9cf1f ironrdp/patches/0051-fix-web-bound-how-fast-the-H.264-decoders-open.patch
50
+ 26c833bd77c828f6068be971d217ed79a1a8ffa51093fd4677a51f12f1a5c0e6 ironrdp/patches/0052-fix-graphics-tighten-history-and-fallible-grid-pointer.patch
51
+ b51d75e037581e272cdeb81d16dd02c87b696b9598ec003acb0810878871ec10 ironrdp/patches/0053-fix-egfx-bound-callback-pixels-readback-count-and-retirement.patch
52
+ f32621b910292284f25a1ac7ca38a01d1561f0c1f0c6e29f71b936140a6e31ed ironrdp/patches/0054-fix-web-configure-decoder-cap-and-defer-until-keyframe.patch
23
53
  08ccf512db2cfe21b16f958eda6fa4b23e052a0c0e91829a4fc2657f8bd8dd4d vendor/IRONRDP-LICENSE
24
- 538641d863e52972074b032c111a67cfa02d06290bff0601423f3dfd25ad563b vendor/iron-remote-desktop-rdp.js
54
+ ff419e89243b14021c1871bdb4a8c4ee6cbd2c46a469870cd6b37da348f2e5e9 vendor/iron-remote-desktop-rdp.js
25
55
  5a6363b9140a5a2abf0218aa39edb38f10445e8d7e9c5a798c321772e1f07c11 vendor/iron-remote-desktop.js
26
- 31f961cc5fc60f6a3dc580333f871bf9b380950dc849395465844dcc90f871f3 vendor/ironrdp_web_bg.wasm
27
- 82470ad2980db3fe48787cb821e231fc44811b046f7820555f6e25f2b4ccce28 vendor/ironrdp-factory.js
56
+ 173ff598bb50290ec7027fbd3eeb1d4f58c03e9372bbb9f1066b8997f587fbc8 vendor/ironrdp_web_bg.wasm
57
+ b297c0a5d8f4cf0b07b59a0e6630d6c4228622404a9b00157b89021d20c4cd4e vendor/ironrdp-factory.js