dsh-ris-ide 1.7.3 → 1.8.0
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/README.md +19 -7
- package/bin/proxy-janitor.mjs +106 -11
- package/bin/risd.mjs +287 -0
- package/bin/run-with-log.ps1 +43 -5
- package/lib/client.js +515 -1152
- package/lib/index.js +1124 -55
- package/lib/janitor.js +106 -15
- package/lib/proxy.js +86 -7
- package/lib/proxybridge-bundle.js +798 -0
- package/lib/redirector.js +484 -35
- package/lib/risd/build.js +91 -0
- package/lib/risd/debug.js +374 -0
- package/lib/risd/git.js +207 -0
- package/lib/risd/leases.js +124 -0
- package/lib/risd/lifecycle.js +148 -0
- package/lib/risd/log.js +59 -0
- package/lib/risd/ping.js +94 -0
- package/lib/risd/programs.js +348 -0
- package/lib/risd/server.js +1478 -0
- package/lib/risd/state.js +137 -0
- package/lib/risd/ui.js +1705 -0
- package/lib/risd/view.js +79 -0
- package/lib/risd-client.js +282 -0
- package/lib/standalone/window.html +14 -16
- package/lib/startup.js +114 -0
- package/package.json +4 -1
- package/test/client-build.test.mjs +113 -0
- package/test/client-viewer.test.mjs +166 -200
- package/test/dsh-origin.test.mjs +140 -0
- package/test/dsh-window-refresh.test.mjs +100 -0
- package/test/harness.test.mjs +9 -0
- package/test/host-noloop.test.mjs +74 -0
- package/test/host-tail.test.mjs +21 -4
- package/test/host-window.test.mjs +4 -4
- package/test/janitor.test.mjs +29 -1
- package/test/lifecycle.test.mjs +26 -5
- package/test/merge-owners.test.mjs +155 -0
- package/test/proxy-restart.test.mjs +37 -0
- package/test/proxy-window.test.mjs +45 -0
- package/test/proxy.test.mjs +41 -0
- package/test/proxybridge-bundle.test.mjs +687 -0
- package/test/redirector-bundle.test.mjs +391 -0
- package/test/redirector.test.mjs +59 -9
- package/test/risd-api.test.mjs +470 -0
- package/test/risd-bridge-degrade.test.mjs +101 -0
- package/test/risd-build.test.mjs +20 -0
- package/test/risd-cli-home.test.mjs +50 -0
- package/test/risd-client.test.mjs +130 -0
- package/test/risd-debug.test.mjs +261 -0
- package/test/risd-election.test.mjs +104 -0
- package/test/risd-engine.test.mjs +132 -0
- package/test/risd-entry.test.mjs +118 -0
- package/test/risd-git.test.mjs +109 -0
- package/test/risd-handoff.test.mjs +116 -0
- package/test/risd-heal.test.mjs +50 -0
- package/test/risd-helpers.mjs +108 -0
- package/test/risd-host-p2.test.mjs +147 -0
- package/test/risd-janitor-guard.test.mjs +46 -0
- package/test/risd-lease.test.mjs +83 -0
- package/test/risd-lifecycle.test.mjs +210 -0
- package/test/risd-log-follow.test.mjs +227 -0
- package/test/risd-mode.test.mjs +161 -0
- package/test/risd-ping.test.mjs +99 -0
- package/test/risd-programs.test.mjs +169 -0
- package/test/risd-review-p2.test.mjs +217 -0
- package/test/risd-shutdown.test.mjs +97 -0
- package/test/risd-teardown.test.mjs +87 -0
- package/test/risd-tools.test.mjs +211 -0
- package/test/risd-ui.test.mjs +445 -0
- package/test/risd-write.test.mjs +170 -0
- package/test/startup-reconcile.test.mjs +100 -0
- package/test/windows.test.mjs +37 -2
package/test/proxy.test.mjs
CHANGED
|
@@ -342,6 +342,21 @@ test('JSONC config files round-trip through the ONE shared file', () => {
|
|
|
342
342
|
}
|
|
343
343
|
})
|
|
344
344
|
|
|
345
|
+
test('merge: replaceAllRules makes the payload the whole table (m10585)', () => {
|
|
346
|
+
const stored = normalizeConfig({
|
|
347
|
+
socks: { host: 'h', port: 1080 },
|
|
348
|
+
rules: [
|
|
349
|
+
{ id: 'user-1', program: 'java', hosts: '1.1.1.*', ports: '443', enabled: true },
|
|
350
|
+
{ id: 'yds-old', program: 'git', hosts: '1.1.1.1', ports: '1521', enabled: true, source: 'yds' },
|
|
351
|
+
],
|
|
352
|
+
})
|
|
353
|
+
const merged = mergeConfigs(stored, {
|
|
354
|
+
replaceAllRules: true,
|
|
355
|
+
rules: [{ id: 'yds-new', program: 'java', hosts: '2.2.2.*', ports: '*', enabled: true, source: 'yds' }],
|
|
356
|
+
})
|
|
357
|
+
assert.deepEqual(merged.rules.map((rule) => rule.id), ['yds-new'])
|
|
358
|
+
})
|
|
359
|
+
|
|
345
360
|
test('merge: yds-owned rows are replaced wholesale, user rows survive', () => {
|
|
346
361
|
const stored = normalizeConfig({
|
|
347
362
|
socks: { host: 'h', port: 1080 },
|
|
@@ -871,3 +886,29 @@ test('a rule keeps its provider label for the dialog and the profile', () => {
|
|
|
871
886
|
assert.equal(config.rules[0].label, 'YonCode java')
|
|
872
887
|
assert.equal(config.rules[1].label, '', 'an unlabelled row stays empty, not undefined')
|
|
873
888
|
})
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
test('a driven rule keeps its per-workspace owners across a config round trip', () => {
|
|
892
|
+
// yds writes one merged row per program with an `owners` map. Rebuilding rules
|
|
893
|
+
// from a fixed field list dropped it, after which `yds stop` could no longer
|
|
894
|
+
// withdraw only its own endpoints (review D-P0-1).
|
|
895
|
+
const owners = {
|
|
896
|
+
'/ws/a': { program: 'java', hosts: '10.0.0.1', ports: '*', enabled: true, shadow: false, direct: false },
|
|
897
|
+
'/ws/b': { program: 'java.exe', hosts: '10.0.0.2,10.0.0.3', ports: '*', enabled: true, shadow: true, direct: false },
|
|
898
|
+
}
|
|
899
|
+
const config = normalizeConfig({
|
|
900
|
+
socks: { host: '127.0.0.1', port: 1080 },
|
|
901
|
+
rules: [{
|
|
902
|
+
id: 'yds-java', label: 'yds java', program: 'java', hosts: '10.0.0.1,10.0.0.2,10.0.0.3', ports: '*',
|
|
903
|
+
enabled: true, shadow: false, direct: false, source: 'yds', workspace: '/ws/b', owners,
|
|
904
|
+
}],
|
|
905
|
+
})
|
|
906
|
+
const rule = config.rules.find((row) => row.id === 'yds-java')
|
|
907
|
+
assert.ok(rule, 'the driven row survives')
|
|
908
|
+
assert.deepEqual(Object.keys(rule.owners), ['/ws/a', '/ws/b'])
|
|
909
|
+
assert.equal(rule.owners['/ws/b'].hosts, '10.0.0.2,10.0.0.3')
|
|
910
|
+
assert.equal(rule.owners['/ws/b'].shadow, true)
|
|
911
|
+
// A row without owners must not gain an empty one.
|
|
912
|
+
const plain = normalizeConfig({ rules: [{ id: 'p', program: 'git', hosts: '*', ports: '*' }] })
|
|
913
|
+
assert.equal(plain.rules[0].owners, undefined)
|
|
914
|
+
})
|