mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 13:22:11 +03:00
Release v3.8.41 — 52 commits since v3.8.40 (19 CHANGELOG bullets, 11 contributors). All gating CI green: Unit×8, Coverage×8, Vitest, Package Artifact, Quality Ratchet, CodeQL, Lint, Docs Sync (Strict), Node 24/26 compat, E2E×9, Integration, Electron smoke. Advisory checks overridden (main unprotected): PR Test Policy = test-masking heuristic on the cumulative 52-commit assert delta (legitimate dead-code-sweep removals + consolidations, reviewed per-PR); SonarCloud/SonarQube = new-code maintainability/coverage quality gate (CodeQL/Semgrep/Security/npm-audit/Dependabot all clean — not a security finding).
50 lines
2.4 KiB
TypeScript
50 lines
2.4 KiB
TypeScript
/**
|
|
* Regression: when OMNIROUTE_BUILD_PROFILE=minimal is the resolved build
|
|
* profile, the four stub modules throw FeatureDisabledError instead of
|
|
* performing their privileged operations.
|
|
* See docs/security/SOCKET_DEV_FINDINGS.md.
|
|
*/
|
|
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
test("featureDisabledError carries the featureName", async () => {
|
|
const mod = await import("../../../src/lib/build-profile/featureDisabled.ts");
|
|
const err = mod.featureDisabledError("my-feature");
|
|
assert.equal(err.featureName, "my-feature");
|
|
assert.match(err.message, /my-feature/);
|
|
assert.match(err.message, /minimal/);
|
|
assert.equal("OMNIROUTE_BUILD_PROFILE" in mod, false);
|
|
assert.equal("IS_MINIMAL_BUILD" in mod, false);
|
|
});
|
|
|
|
test("install.stub.ts: installCert / uninstallCert throw FeatureDisabledError", async () => {
|
|
const stub = await import("../../../src/mitm/cert/install.stub.ts");
|
|
await assert.rejects(() => stub.installCert("pw", "/tmp/x"), /mitm-cert-install/);
|
|
await assert.rejects(() => stub.uninstallCert("pw", "/tmp/x"), /mitm-cert-install/);
|
|
// checkCertInstalled returns false (does not throw — used by render paths)
|
|
assert.equal(await stub.checkCertInstalled("/tmp/x"), false);
|
|
});
|
|
|
|
test("keychain-reader.stub.ts: discoverZedCredentials / getZedCredential throw", async () => {
|
|
const stub = await import("../../../src/lib/zed-oauth/keychain-reader.stub.ts");
|
|
await assert.rejects(() => stub.discoverZedCredentials(), /zed-keychain-import/);
|
|
await assert.rejects(() => stub.getZedCredential("openai"), /zed-keychain-import/);
|
|
assert.equal(await stub.isZedInstalled(), false);
|
|
});
|
|
|
|
test("cloudSync.stub.ts: syncToCloud soft-fails with feature-disabled message", async () => {
|
|
const stub = await import("../../../src/lib/cloudSync.stub.ts");
|
|
const result = await stub.syncToCloud("machine-id");
|
|
assert.deepEqual(result, {
|
|
error: "Cloud Sync is disabled in this build (minimal profile)",
|
|
});
|
|
assert.equal(stub.CLOUD_SYNC_SECRETS_ENABLED, false);
|
|
await assert.rejects(() => stub.fetchWithTimeout(), /cloud-sync/);
|
|
});
|
|
|
|
test("ninerouter.stub.ts: install / resolveSpawnArgs throw FeatureDisabledError", async () => {
|
|
const stub = await import("../../../src/lib/services/installers/ninerouter.stub.ts");
|
|
await assert.rejects(() => stub.installNinerouter(), /9router-installer/);
|
|
assert.throws(() => stub.resolveSpawnArgs("api-key", 20130), /9router-installer/);
|
|
});
|