sliccy 2.42.0 → 2.43.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/dist/node-server/_shared/index.d.ts +4 -0
- package/dist/node-server/_shared/index.d.ts.map +1 -0
- package/dist/node-server/_shared/index.js +5 -0
- package/dist/node-server/_shared/index.js.map +1 -0
- package/dist/node-server/_shared/oauth-extra-domains-storage.d.ts +29 -0
- package/dist/node-server/_shared/oauth-extra-domains-storage.d.ts.map +1 -0
- package/dist/node-server/_shared/oauth-extra-domains-storage.js +85 -0
- package/dist/node-server/_shared/oauth-extra-domains-storage.js.map +1 -0
- package/dist/node-server/_shared/secret-masking.d.ts +43 -0
- package/dist/node-server/_shared/secret-masking.d.ts.map +1 -0
- package/dist/node-server/_shared/secret-masking.js +125 -0
- package/dist/node-server/_shared/secret-masking.js.map +1 -0
- package/dist/node-server/_shared/secrets-pipeline.d.ts +103 -0
- package/dist/node-server/_shared/secrets-pipeline.d.ts.map +1 -0
- package/dist/node-server/_shared/secrets-pipeline.js +249 -0
- package/dist/node-server/_shared/secrets-pipeline.js.map +1 -0
- package/dist/node-server/index.js +78 -7
- package/dist/node-server/secrets/index.d.ts +3 -3
- package/dist/node-server/secrets/index.js +1 -1
- package/dist/node-server/secrets/oauth-secret-store.d.ts +12 -0
- package/dist/node-server/secrets/oauth-secret-store.js +18 -0
- package/dist/node-server/secrets/proxy-manager.d.ts +13 -49
- package/dist/node-server/secrets/proxy-manager.js +62 -114
- package/dist/node-server/secrets/session-id-file.d.ts +5 -0
- package/dist/node-server/secrets/session-id-file.js +33 -0
- package/dist/node-server/secrets/types.d.ts +5 -0
- package/dist/ui/assets/adobe-C2UaIA41.js +2 -0
- package/dist/ui/assets/adobe-DCEW-jwu.js +1 -0
- package/dist/ui/assets/{agent-bridge-DPiRY9Cp.js → agent-bridge-DpnoOA1m.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-DPXL2yWd.js → agent-message-to-chat-BhoxpmpE.js} +1 -1
- package/dist/ui/assets/{anthropic-DNaAx4PR.js → anthropic-BBCljDKG.js} +1 -1
- package/dist/ui/assets/{anthropic-z3OB3Fnl.js → anthropic-DuP0qmVz.js} +1 -1
- package/dist/ui/assets/{azure-openai-T9qO12vJ.js → azure-openai-DJep1H6m.js} +1 -1
- package/dist/ui/assets/{azure-openai-BittXGOl.js → azure-openai-es2UEaVa.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-DBxhuZoo.js → azure-openai-responses-BasmI9oz.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-DviTxw7q.js → azure-openai-responses-DBAbXSTD.js} +1 -1
- package/dist/ui/assets/{bedrock-camp-CHTXSY1O.js → bedrock-camp-CSp2DPSu.js} +3 -3
- package/dist/ui/assets/{bedrock-camp-MgGI9Yh2.js → bedrock-camp-KyNM28gW.js} +2 -2
- package/dist/ui/assets/{cdp-BV0AqGz6.js → cdp-CP2mm6ER.js} +2 -2
- package/dist/ui/assets/cost-command-DnyD68nK.js +1 -0
- package/dist/ui/assets/{es-CMpEjX7X.js → es-BUhsge_v.js} +1 -1
- package/dist/ui/assets/{fs-CJrk6h4U.js → fs-1U1rT6mb.js} +2 -2
- package/dist/ui/assets/{fs-IOuBZ0fU.js → fs-KzDX6lDt.js} +3 -3
- package/dist/ui/assets/github-BoI7NK5Y.js +2 -0
- package/dist/ui/assets/github-DZWbceUJ.js +1 -0
- package/dist/ui/assets/{google-B_wiPl8S.js → google-CcdeRF42.js} +1 -1
- package/dist/ui/assets/{google-BSQPUbsD.js → google-w3iuVje2.js} +1 -1
- package/dist/ui/assets/{index-DOah61oi.js → index-Dbfn2pUX.js} +17 -17
- package/dist/ui/assets/{kernel-worker-Ct6nuQEv.js → kernel-worker-BuJdZy5v.js} +920 -887
- package/dist/ui/assets/{local-llm-BKrBXM1b.js → local-llm-D72tLY3Y.js} +1 -1
- package/dist/ui/assets/{local-llm-DG_WcsYf.js → local-llm-XVLqdOOf.js} +1 -1
- package/dist/ui/assets/{mistral-cWWq2371.js → mistral-DRSbEgc2.js} +1 -1
- package/dist/ui/assets/{mistral-oA9eus1c.js → mistral-b5JBKUqy.js} +1 -1
- package/dist/ui/assets/{mount-BE4HlHj3.js → mount-6-HP-fzb.js} +1 -1
- package/dist/ui/assets/{mount-d5zFj5UF.js → mount-zcpBZ465.js} +2 -2
- package/dist/ui/assets/{nuke-command-Do01VR7B.js → nuke-command-DTu62dL0.js} +1 -1
- package/dist/ui/assets/oauth-bootstrap-CsJTQqoE.js +1 -0
- package/dist/ui/assets/oauth-service-C0rdcoXi.js +1 -0
- package/dist/ui/assets/oauth-service-DTHr_ILl.js +1 -0
- package/dist/ui/assets/{offscreen-client-D96UbGR3.js → offscreen-client-BQS5SL9t.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-D1l-w9_h.js → onboarding-orchestrator-Dld2OQzb.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-ChYFmtB8.js → openai-codex-responses-BIq_NjtP.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-DYtt5_H9.js → openai-codex-responses-Bw3r2Hnu.js} +1 -1
- package/dist/ui/assets/{openai-completions-CkeC09FW.js → openai-completions-68Ek_N21.js} +1 -1
- package/dist/ui/assets/{openai-completions-pJVLdfB5.js → openai-completions-BXM-gDWt.js} +1 -1
- package/dist/ui/assets/{openai-responses-CfoWjQjX.js → openai-responses-BoV1AGA6.js} +1 -1
- package/dist/ui/assets/{openai-responses-BtUhfSCM.js → openai-responses-EH-UgPTz.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-BT4PBv9i.js → openai-responses-shared-BnEuqygR.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-BL73-u8o.js → openai-responses-shared-sCOhnzkS.js} +1 -1
- package/dist/ui/assets/page-storage-sync-DEhI1xEB.js +1 -0
- package/dist/ui/assets/{panel-rpc-BLyR6B42.js → panel-rpc-g85bMVnq.js} +1 -1
- package/dist/ui/assets/panel-rpc-handlers-Cd0NeWGr.js +1 -0
- package/dist/ui/assets/provider-settings-BJW3Z-UR.js +2 -0
- package/dist/ui/assets/provider-settings-BwyVvIHC.js +90 -0
- package/dist/ui/assets/{providers-DDa7zuci.js → providers-Bx2_S0Gs.js} +1 -1
- package/dist/ui/assets/secret-env-DES2XPkD.js +1 -0
- package/dist/ui/assets/{spawn-CIR7ZcER.js → spawn-Bs7QOa4F.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-CHed1OmR.js → upgrade-detection-DaIEsDu3.js} +1 -1
- package/dist/ui/index.html +6 -6
- package/dist/ui/packages/webapp/index.html +6 -6
- package/package.json +4 -3
- package/dist/node-server/secrets/domain-match.d.ts +0 -20
- package/dist/node-server/secrets/domain-match.js +0 -37
- package/dist/node-server/secrets/masking.d.ts +0 -21
- package/dist/node-server/secrets/masking.js +0 -82
- package/dist/ui/assets/adobe-CqL9wyDB.js +0 -1
- package/dist/ui/assets/adobe-Dz3AQqOU.js +0 -1
- package/dist/ui/assets/cost-command-CmqxOe10.js +0 -1
- package/dist/ui/assets/github-B1wRLpqB.js +0 -1
- package/dist/ui/assets/github-BtI_MJWq.js +0 -2
- package/dist/ui/assets/oauth-service-BOg00ewY.js +0 -1
- package/dist/ui/assets/oauth-service-CfTUWB9P.js +0 -1
- package/dist/ui/assets/page-storage-sync-BPAEqPof.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-ZHQOP2j9.js +0 -1
- package/dist/ui/assets/provider-settings-CvNDi0PS.js +0 -90
- package/dist/ui/assets/provider-settings-DUgrWSPY.js +0 -2
- package/dist/ui/assets/secret-masking-BMzkw8ZK.js +0 -1
- /package/dist/ui/assets/{azure-ai-foundry-CaxHzIfg.js → azure-ai-foundry-BHhe6xrk.js} +0 -0
- /package/dist/ui/assets/{azure-ai-foundry-B1O-wE_V.js → azure-ai-foundry-Bcv3AvZm.js} +0 -0
- /package/dist/ui/assets/{bsh-watchdog-BPXsh13l.js → bsh-watchdog-BBjbd-XL.js} +0 -0
- /package/dist/ui/assets/{chat-fixture-CM-jsDDl.js → chat-fixture-5h_JuUYl.js} +0 -0
- /package/dist/ui/assets/{git-config-BoQzX7Xi.js → git-config-BMEHAjvp.js} +0 -0
- /package/dist/ui/assets/{magick-wasm-BnlzD3um.js → magick-wasm-E5pMp5Fh.js} +0 -0
- /package/dist/ui/assets/{remote-terminal-view-wMCUFwpP.js → remote-terminal-view-B3w1XsI8.js} +0 -0
- /package/dist/ui/assets/{rum-DYAJNvRR.js → rum-_zaGz-D7.js} +0 -0
- /package/dist/ui/assets/{slicc-editor-ZPVWM2cU.js → slicc-editor-DAgxp34c.js} +0 -0
- /package/dist/ui/assets/{sprinkle-bridge-channel-Dd_0GEWx.js → sprinkle-bridge-channel-DJuNr3kv.js} +0 -0
- /package/dist/ui/assets/{sprinkle-bridge-channel-DhKQ_srk.js → sprinkle-bridge-channel-wZyMV5ic.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny pure-JS layer over the page-localStorage key
|
|
3
|
+
* `slicc_oauth_extra_domains`. Same shape and key the webapp's
|
|
4
|
+
* `provider-settings.ts` uses; this module exists so the options page
|
|
5
|
+
* (`secrets.html` / `secrets-entry.ts`) can share the same backend
|
|
6
|
+
* without pulling in the full provider-settings module (which would
|
|
7
|
+
* fan out into a heavy bundle).
|
|
8
|
+
*
|
|
9
|
+
* Both pages live at chrome-extension://<id>/* so they hit the same
|
|
10
|
+
* localStorage. Updates here are visible to the side panel on its next
|
|
11
|
+
* read (no chrome.runtime round-trip needed).
|
|
12
|
+
*/
|
|
13
|
+
export declare const OAUTH_EXTRA_DOMAINS_KEY = "slicc_oauth_extra_domains";
|
|
14
|
+
export type OAuthExtraDomainsStore = Record<string, string[]>;
|
|
15
|
+
export interface LocalStorageLike {
|
|
16
|
+
getItem(key: string): string | null;
|
|
17
|
+
setItem(key: string, value: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare function readOAuthExtras(storage: LocalStorageLike): OAuthExtraDomainsStore;
|
|
20
|
+
export declare function writeOAuthExtras(storage: LocalStorageLike, store: OAuthExtraDomainsStore): void;
|
|
21
|
+
export declare function addOAuthExtraDomain(storage: LocalStorageLike, providerId: string, domain: string): {
|
|
22
|
+
added: boolean;
|
|
23
|
+
reason?: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function removeOAuthExtraDomain(storage: LocalStorageLike, providerId: string, domain: string): {
|
|
26
|
+
removed: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function clearOAuthExtras(storage: LocalStorageLike, providerId: string): void;
|
|
29
|
+
//# sourceMappingURL=oauth-extra-domains-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-extra-domains-storage.d.ts","sourceRoot":"","sources":["../src/oauth-extra-domains-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,sBAAsB,CAgBjF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAY/F;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAerC;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAUtB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAIpF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny pure-JS layer over the page-localStorage key
|
|
3
|
+
* `slicc_oauth_extra_domains`. Same shape and key the webapp's
|
|
4
|
+
* `provider-settings.ts` uses; this module exists so the options page
|
|
5
|
+
* (`secrets.html` / `secrets-entry.ts`) can share the same backend
|
|
6
|
+
* without pulling in the full provider-settings module (which would
|
|
7
|
+
* fan out into a heavy bundle).
|
|
8
|
+
*
|
|
9
|
+
* Both pages live at chrome-extension://<id>/* so they hit the same
|
|
10
|
+
* localStorage. Updates here are visible to the side panel on its next
|
|
11
|
+
* read (no chrome.runtime round-trip needed).
|
|
12
|
+
*/
|
|
13
|
+
export const OAUTH_EXTRA_DOMAINS_KEY = 'slicc_oauth_extra_domains';
|
|
14
|
+
export function readOAuthExtras(storage) {
|
|
15
|
+
try {
|
|
16
|
+
const raw = storage.getItem(OAUTH_EXTRA_DOMAINS_KEY);
|
|
17
|
+
if (!raw)
|
|
18
|
+
return {};
|
|
19
|
+
const parsed = JSON.parse(raw);
|
|
20
|
+
if (parsed == null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
21
|
+
return {};
|
|
22
|
+
const out = {};
|
|
23
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
24
|
+
if (typeof k !== 'string' || !Array.isArray(v))
|
|
25
|
+
continue;
|
|
26
|
+
const cleaned = v.filter((d) => typeof d === 'string' && d.length > 0);
|
|
27
|
+
if (cleaned.length > 0)
|
|
28
|
+
out[k] = cleaned;
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function writeOAuthExtras(storage, store) {
|
|
37
|
+
// setItem throws synchronously on QuotaExceededError. The options-page
|
|
38
|
+
// click handlers call this through addOAuthExtraDomain / remove / clear
|
|
39
|
+
// and rely on the throw being caught by their toast wiring; without an
|
|
40
|
+
// explicit message the toast says nothing useful.
|
|
41
|
+
try {
|
|
42
|
+
storage.setItem(OAUTH_EXTRA_DOMAINS_KEY, JSON.stringify(store));
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
throw new Error(`Failed to persist OAuth extras (localStorage quota exceeded?): ${err instanceof Error ? err.message : String(err)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function addOAuthExtraDomain(storage, providerId, domain) {
|
|
49
|
+
if (!providerId || !domain)
|
|
50
|
+
return { added: false, reason: 'provider and domain required' };
|
|
51
|
+
const store = readOAuthExtras(storage);
|
|
52
|
+
const current = store[providerId] ?? [];
|
|
53
|
+
const lower = domain.toLowerCase();
|
|
54
|
+
if (current.some((d) => d.toLowerCase() === lower)) {
|
|
55
|
+
return { added: false, reason: 'duplicate' };
|
|
56
|
+
}
|
|
57
|
+
store[providerId] = [...current, domain];
|
|
58
|
+
try {
|
|
59
|
+
writeOAuthExtras(storage, store);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
return { added: false, reason: err instanceof Error ? err.message : String(err) };
|
|
63
|
+
}
|
|
64
|
+
return { added: true };
|
|
65
|
+
}
|
|
66
|
+
export function removeOAuthExtraDomain(storage, providerId, domain) {
|
|
67
|
+
const store = readOAuthExtras(storage);
|
|
68
|
+
const current = store[providerId] ?? [];
|
|
69
|
+
const lower = domain.toLowerCase();
|
|
70
|
+
const next = current.filter((d) => d.toLowerCase() !== lower);
|
|
71
|
+
if (next.length === current.length)
|
|
72
|
+
return { removed: false };
|
|
73
|
+
if (next.length === 0)
|
|
74
|
+
delete store[providerId];
|
|
75
|
+
else
|
|
76
|
+
store[providerId] = next;
|
|
77
|
+
writeOAuthExtras(storage, store);
|
|
78
|
+
return { removed: true };
|
|
79
|
+
}
|
|
80
|
+
export function clearOAuthExtras(storage, providerId) {
|
|
81
|
+
const store = readOAuthExtras(storage);
|
|
82
|
+
delete store[providerId];
|
|
83
|
+
writeOAuthExtras(storage, store);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=oauth-extra-domains-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-extra-domains-storage.js","sourceRoot":"","sources":["../src/oauth-extra-domains-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AASnE,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;QACrD,IAAI,CAAC,GAAG;YAAE,OAAO,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,EAAE,CAAC;QACrF,MAAM,GAAG,GAA2B,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,CAAC,EAA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K,CAAC,UAAU,CAAC,CAAC;;QAC3C,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAyB,EAAE,UAAkB;IAC5E,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret masking engine — HMAC-SHA256 based, format-preserving.
|
|
3
|
+
*
|
|
4
|
+
* Used on both agent side (env population, output scrubbing) and
|
|
5
|
+
* server side (fetch proxy response scrubbing).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Produce a deterministic, format-preserving masked value.
|
|
9
|
+
*
|
|
10
|
+
* `masked = prefix + hex(HMAC-SHA256(sessionId+secretName, realValue))`
|
|
11
|
+
* truncated/repeated to match `realValue.length - prefix.length`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mask(sessionId: string, secretName: string, realValue: string): Promise<string>;
|
|
14
|
+
export interface SecretPair {
|
|
15
|
+
realValue: string;
|
|
16
|
+
maskedValue: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build a reusable scrubber function that replaces every occurrence
|
|
20
|
+
* of any `realValue` with its `maskedValue`.
|
|
21
|
+
*
|
|
22
|
+
* For a small number of secrets a simple sequential replace is fine.
|
|
23
|
+
* Secrets are sorted longest-first to avoid partial-match issues.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildScrubber(secrets: SecretPair[]): (text: string) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Domain glob matching.
|
|
28
|
+
*
|
|
29
|
+
* - `api.github.com` matches exactly `api.github.com`
|
|
30
|
+
* - `*.github.com` matches `api.github.com`, `uploads.github.com`,
|
|
31
|
+
* but NOT `github.com` itself
|
|
32
|
+
*/
|
|
33
|
+
export declare function domainMatches(pattern: string, hostname: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Check if hostname is allowed by any of the domain patterns.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isAllowedDomain(patterns: string[], hostname: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Compatibility alias for node-server's historical name + arg order.
|
|
40
|
+
* Prefer `isAllowedDomain(patterns, hostname)` in new code.
|
|
41
|
+
*/
|
|
42
|
+
export declare function matchesDomains(hostname: string, patterns: string[]): boolean;
|
|
43
|
+
//# sourceMappingURL=secret-masking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-masking.d.ts","sourceRoot":"","sources":["../src/secret-masking.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6DH;;;;;GAKG;AACH,wBAAsB,IAAI,CACxB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAe7E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAcxE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE7E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret masking engine — HMAC-SHA256 based, format-preserving.
|
|
3
|
+
*
|
|
4
|
+
* Used on both agent side (env population, output scrubbing) and
|
|
5
|
+
* server side (fetch proxy response scrubbing).
|
|
6
|
+
*/
|
|
7
|
+
// ---------- Known token prefixes ----------
|
|
8
|
+
const KNOWN_PREFIXES = [
|
|
9
|
+
'ghp_', // GitHub PAT
|
|
10
|
+
'gho_', // GitHub OAuth
|
|
11
|
+
'ghu_', // GitHub user-to-server
|
|
12
|
+
'ghs_', // GitHub server-to-server
|
|
13
|
+
'ghr_', // GitHub refresh
|
|
14
|
+
'github_pat_', // GitHub fine-grained PAT
|
|
15
|
+
'sk-', // OpenAI / Stripe secret key
|
|
16
|
+
'pk-', // Stripe publishable key
|
|
17
|
+
'xoxb-', // Slack bot token
|
|
18
|
+
'xoxp-', // Slack user token
|
|
19
|
+
'xoxa-', // Slack app token
|
|
20
|
+
'xoxs-', // Slack session token
|
|
21
|
+
'AKIA', // AWS access key ID
|
|
22
|
+
'ABIA', // AWS STS
|
|
23
|
+
'ACCA', // AWS alternate
|
|
24
|
+
'ASIA', // AWS temporary
|
|
25
|
+
'sk-ant-', // Anthropic
|
|
26
|
+
'Bearer ', // generic bearer (keep space)
|
|
27
|
+
];
|
|
28
|
+
// Sort longest-first so we match the most specific prefix
|
|
29
|
+
const SORTED_PREFIXES = [...KNOWN_PREFIXES].sort((a, b) => b.length - a.length);
|
|
30
|
+
/**
|
|
31
|
+
* Detect a known prefix from the value. Returns the prefix string or empty.
|
|
32
|
+
*/
|
|
33
|
+
function detectPrefix(value) {
|
|
34
|
+
for (const p of SORTED_PREFIXES) {
|
|
35
|
+
if (value.startsWith(p))
|
|
36
|
+
return p;
|
|
37
|
+
}
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
// ---------- HMAC-SHA256 ----------
|
|
41
|
+
async function hmacSha256(key, message) {
|
|
42
|
+
const enc = new TextEncoder();
|
|
43
|
+
const cryptoKey = await crypto.subtle.importKey('raw', enc.encode(key), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']);
|
|
44
|
+
const sig = await crypto.subtle.sign('HMAC', cryptoKey, enc.encode(message));
|
|
45
|
+
return new Uint8Array(sig);
|
|
46
|
+
}
|
|
47
|
+
function toHex(bytes) {
|
|
48
|
+
return Array.from(bytes)
|
|
49
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
50
|
+
.join('');
|
|
51
|
+
}
|
|
52
|
+
// ---------- Public API ----------
|
|
53
|
+
/**
|
|
54
|
+
* Produce a deterministic, format-preserving masked value.
|
|
55
|
+
*
|
|
56
|
+
* `masked = prefix + hex(HMAC-SHA256(sessionId+secretName, realValue))`
|
|
57
|
+
* truncated/repeated to match `realValue.length - prefix.length`.
|
|
58
|
+
*/
|
|
59
|
+
export async function mask(sessionId, secretName, realValue) {
|
|
60
|
+
const prefix = detectPrefix(realValue);
|
|
61
|
+
const remainder = realValue.slice(prefix.length);
|
|
62
|
+
const hmac = await hmacSha256(sessionId + secretName, realValue);
|
|
63
|
+
let hex = toHex(hmac);
|
|
64
|
+
// Repeat hex if remainder is longer than 64 hex chars
|
|
65
|
+
while (hex.length < remainder.length)
|
|
66
|
+
hex += hex;
|
|
67
|
+
const maskedRemainder = hex.slice(0, remainder.length);
|
|
68
|
+
return prefix + maskedRemainder;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Build a reusable scrubber function that replaces every occurrence
|
|
72
|
+
* of any `realValue` with its `maskedValue`.
|
|
73
|
+
*
|
|
74
|
+
* For a small number of secrets a simple sequential replace is fine.
|
|
75
|
+
* Secrets are sorted longest-first to avoid partial-match issues.
|
|
76
|
+
*/
|
|
77
|
+
export function buildScrubber(secrets) {
|
|
78
|
+
if (secrets.length === 0)
|
|
79
|
+
return (t) => t;
|
|
80
|
+
// Sort longest real values first to avoid sub-string clobbering
|
|
81
|
+
const sorted = [...secrets].sort((a, b) => b.realValue.length - a.realValue.length);
|
|
82
|
+
return (text) => {
|
|
83
|
+
let result = text;
|
|
84
|
+
for (const { realValue, maskedValue } of sorted) {
|
|
85
|
+
if (result.includes(realValue)) {
|
|
86
|
+
result = result.split(realValue).join(maskedValue);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Domain glob matching.
|
|
94
|
+
*
|
|
95
|
+
* - `api.github.com` matches exactly `api.github.com`
|
|
96
|
+
* - `*.github.com` matches `api.github.com`, `uploads.github.com`,
|
|
97
|
+
* but NOT `github.com` itself
|
|
98
|
+
*/
|
|
99
|
+
export function domainMatches(pattern, hostname) {
|
|
100
|
+
const p = pattern.toLowerCase();
|
|
101
|
+
const h = hostname.toLowerCase();
|
|
102
|
+
if (p === '*')
|
|
103
|
+
return true;
|
|
104
|
+
if (!p.startsWith('*.')) {
|
|
105
|
+
return p === h;
|
|
106
|
+
}
|
|
107
|
+
// Wildcard: `*.example.com`
|
|
108
|
+
const suffix = p.slice(1); // `.example.com`
|
|
109
|
+
// hostname must end with `.example.com` AND have at least one char before
|
|
110
|
+
return h.length > suffix.length && h.endsWith(suffix);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Check if hostname is allowed by any of the domain patterns.
|
|
114
|
+
*/
|
|
115
|
+
export function isAllowedDomain(patterns, hostname) {
|
|
116
|
+
return patterns.some((p) => domainMatches(p, hostname));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Compatibility alias for node-server's historical name + arg order.
|
|
120
|
+
* Prefer `isAllowedDomain(patterns, hostname)` in new code.
|
|
121
|
+
*/
|
|
122
|
+
export function matchesDomains(hostname, patterns) {
|
|
123
|
+
return isAllowedDomain(patterns, hostname);
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=secret-masking.js.map
|
|
@@ -0,0 +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,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAkB,EAAE,QAAgB;IAClE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,QAAkB;IACjE,OAAO,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface FetchProxySecretSource {
|
|
2
|
+
get(name: string): Promise<string | undefined>;
|
|
3
|
+
listAll(): Promise<{
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
domains: string[];
|
|
7
|
+
}[]>;
|
|
8
|
+
}
|
|
9
|
+
export interface MaskedSecret {
|
|
10
|
+
name: string;
|
|
11
|
+
realValue: string;
|
|
12
|
+
maskedValue: string;
|
|
13
|
+
domains: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ForbiddenInfo {
|
|
16
|
+
secretName: string;
|
|
17
|
+
hostname: string;
|
|
18
|
+
}
|
|
19
|
+
export interface UnmaskResult {
|
|
20
|
+
text: string;
|
|
21
|
+
forbidden?: ForbiddenInfo;
|
|
22
|
+
}
|
|
23
|
+
export interface UnmaskHeadersResult {
|
|
24
|
+
forbidden?: ForbiddenInfo;
|
|
25
|
+
}
|
|
26
|
+
export interface BasicResult {
|
|
27
|
+
value: string;
|
|
28
|
+
forbidden?: ForbiddenInfo;
|
|
29
|
+
}
|
|
30
|
+
export interface ExtractedUrlCreds {
|
|
31
|
+
url: string;
|
|
32
|
+
syntheticAuthorization?: string;
|
|
33
|
+
forbidden?: ForbiddenInfo;
|
|
34
|
+
}
|
|
35
|
+
export interface SecretsPipelineOpts {
|
|
36
|
+
sessionId: string;
|
|
37
|
+
source: FetchProxySecretSource;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Stateful unmask/scrub pipeline shared between node-server's /api/fetch-proxy
|
|
41
|
+
* and the chrome-extension SW's fetch-proxy.fetch Port handler.
|
|
42
|
+
*
|
|
43
|
+
* Public surface has four method families:
|
|
44
|
+
*
|
|
45
|
+
* ┌────────────┬────────────────────────────────┬─────────────────────────┐
|
|
46
|
+
* │ │ Text-safe (string in / out) │ Byte-safe (Uint8Array) │
|
|
47
|
+
* ├────────────┼────────────────────────────────┼─────────────────────────┤
|
|
48
|
+
* │ Unmask │ unmask, unmaskBody, │ unmaskBodyBytes │
|
|
49
|
+
* │ (mask→real)│ unmaskHeaders, …Basic, …Url │ │
|
|
50
|
+
* ├────────────┼────────────────────────────────┼─────────────────────────┤
|
|
51
|
+
* │ Scrub │ scrubResponse, scrubHeaders │ scrubResponseBytes │
|
|
52
|
+
* │ (real→mask)│ │ │
|
|
53
|
+
* └────────────┴────────────────────────────────┴─────────────────────────┘
|
|
54
|
+
*
|
|
55
|
+
* Use the byte-safe variants for request/response bodies that may be binary
|
|
56
|
+
* (git packfiles, ZIPs, images, application/octet-stream). The text variants
|
|
57
|
+
* UTF-8-decode their input, which corrupts non-UTF-8 byte sequences
|
|
58
|
+
* (`Buffer.toString('utf-8')` replaces invalid bytes with U+FFFD).
|
|
59
|
+
*
|
|
60
|
+
* Note: unmaskHeaders MUTATES its input in place (matching SecretProxyManager's
|
|
61
|
+
* legacy semantics). The other methods return new strings/byte arrays.
|
|
62
|
+
*/
|
|
63
|
+
export declare class SecretsPipeline {
|
|
64
|
+
readonly sessionId: string;
|
|
65
|
+
private readonly source;
|
|
66
|
+
private maskedToSecret;
|
|
67
|
+
private scrubber;
|
|
68
|
+
constructor(opts: SecretsPipelineOpts);
|
|
69
|
+
reload(): Promise<void>;
|
|
70
|
+
maskOne(name: string, value: string): Promise<string>;
|
|
71
|
+
hasSecrets(): boolean;
|
|
72
|
+
getMaskedEntries(): Array<{
|
|
73
|
+
name: string;
|
|
74
|
+
maskedValue: string;
|
|
75
|
+
domains: string[];
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Unmask a single string. Domain mismatch on a matched secret → forbidden.
|
|
79
|
+
* Returns { text } on success, { text: original, forbidden } on block.
|
|
80
|
+
*/
|
|
81
|
+
unmask(text: string, hostname: string): UnmaskResult;
|
|
82
|
+
/**
|
|
83
|
+
* Unmask body text. Domain mismatch on a matched secret leaves it untouched
|
|
84
|
+
* (NO forbidden — masked values in conversation context are harmless).
|
|
85
|
+
*/
|
|
86
|
+
unmaskBody(text: string, hostname: string): {
|
|
87
|
+
text: string;
|
|
88
|
+
};
|
|
89
|
+
unmaskAuthorizationBasic(headerValue: string, hostname: string): BasicResult;
|
|
90
|
+
extractAndUnmaskUrlCredentials(rawUrl: string): ExtractedUrlCreds;
|
|
91
|
+
/**
|
|
92
|
+
* Unmask headers IN PLACE. Mutates the headers parameter; returns only { forbidden? }.
|
|
93
|
+
* Match SecretProxyManager's existing semantics so call sites compile unchanged.
|
|
94
|
+
*/
|
|
95
|
+
unmaskHeaders(headers: Record<string, string>, hostname: string): UnmaskHeadersResult;
|
|
96
|
+
unmaskBodyBytes(body: Uint8Array, hostname: string): {
|
|
97
|
+
bytes: Uint8Array;
|
|
98
|
+
};
|
|
99
|
+
scrubResponse(text: string): string;
|
|
100
|
+
scrubResponseBytes(bytes: Uint8Array): Uint8Array;
|
|
101
|
+
scrubHeaders(headers: Headers): Record<string, string>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=secrets-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-pipeline.d.ts","sourceRoot":"","sources":["../src/secrets-pipeline.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,sBAAsB;IACrC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/C,OAAO,IAAI,OAAO,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