rechrome 1.40.0 → 1.42.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 -0
- package/fill-secret.js +108 -0
- package/fill-secret.ts +97 -1
- package/listeners.js +6 -2
- package/listeners.ts +6 -3
- package/package.json +5 -2
- package/rechrome.js +52 -14
- package/rechrome.ts +52 -14
- package/redact.js +236 -0
- package/redact.ts +242 -0
- package/scoped-upload.js +4 -3
- package/scoped-upload.ts +6 -3
- package/secret-rules/gitleaks.LICENSE +21 -0
- package/secret-rules/gitleaks.toml +3209 -0
- package/serve.js +18 -1
- package/serve.ts +18 -1
package/serve.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
checkTailscaleServe,
|
|
25
25
|
chromeDataAccessHint,
|
|
26
26
|
} from "./rechrome.js";
|
|
27
|
-
import { SecretMasker, parseFillSecretWire, fillSecretOnSession, passwordValuesOnSession, hasSnapshot, maskPasswordLines, withholdSnapshots } from "./fill-secret.js";
|
|
27
|
+
import { SecretMasker, parseReadSecretWire, readSecretOnSession, parseFillSecretWire, fillSecretOnSession, passwordValuesOnSession, hasSnapshot, maskPasswordLines, withholdSnapshots } from "./fill-secret.js";
|
|
28
28
|
|
|
29
29
|
const TAILSCALE_BIN = process.env.TAILSCALE_BIN || "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
|
30
30
|
const CERT_RENEW_THRESHOLD_DAYS = 7;
|
|
@@ -944,6 +944,23 @@ export async function serve() {
|
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
946
|
|
|
947
|
+
// read-secret: the value goes back only in `secretOut`, never into stdout, a log line or a
|
|
948
|
+
// file, and is masked in every later output. See fill-secret.js.
|
|
949
|
+
if (filteredArgs[0] === "read-secret") {
|
|
950
|
+
try {
|
|
951
|
+
const { ref, allowDomains } = parseReadSecretWire(filteredArgs);
|
|
952
|
+
const { host, value } = await readSecretOnSession({ socketRoot: tmpSocketRoot(), session: namespacedSession, cwd: runWorkDir, ref, allowDomains });
|
|
953
|
+
if (!value) throw new Error(`read-secret: ${ref} on ${host} is empty`);
|
|
954
|
+
secretMasker.add(value, Infinity);
|
|
955
|
+
log(`exit: 0 | read-secret ${ref} on ${host} (${value.length} chars, value not logged)`);
|
|
956
|
+
return Response.json({ status: 0, stdout: "", stderr: "", files: [], secretOut: value });
|
|
957
|
+
} catch (error) {
|
|
958
|
+
const message = secretMasker.mask(error instanceof Error ? error.message : String(error));
|
|
959
|
+
log(`exit: 1 | read-secret: ${message.split("\n")[0]}`);
|
|
960
|
+
return Response.json({ status: 1, stdout: "", stderr: `[rech] ${message}\n`, files: [] });
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
947
964
|
// For open commands, default to about:blank to avoid leaving connect.html visible
|
|
948
965
|
const isOpenCmd = filteredArgs[0] === "open";
|
|
949
966
|
const isOpenNoUrl = isOpenCmd && filteredArgs.length === 1;
|
package/serve.ts
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
checkTailscaleServe,
|
|
25
25
|
chromeDataAccessHint,
|
|
26
26
|
} from "./rechrome.ts";
|
|
27
|
-
import { SecretMasker, parseFillSecretWire, fillSecretOnSession, passwordValuesOnSession, hasSnapshot, maskPasswordLines, withholdSnapshots } from "./fill-secret.ts";
|
|
27
|
+
import { SecretMasker, parseReadSecretWire, readSecretOnSession, parseFillSecretWire, fillSecretOnSession, passwordValuesOnSession, hasSnapshot, maskPasswordLines, withholdSnapshots } from "./fill-secret.ts";
|
|
28
28
|
|
|
29
29
|
const TAILSCALE_BIN = process.env.TAILSCALE_BIN || "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
|
30
30
|
const CERT_RENEW_THRESHOLD_DAYS = 7;
|
|
@@ -944,6 +944,23 @@ export async function serve() {
|
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
946
|
|
|
947
|
+
// read-secret: the value goes back only in `secretOut`, never into stdout, a log line or a
|
|
948
|
+
// file, and is masked in every later output. See fill-secret.ts.
|
|
949
|
+
if (filteredArgs[0] === "read-secret") {
|
|
950
|
+
try {
|
|
951
|
+
const { ref, allowDomains } = parseReadSecretWire(filteredArgs);
|
|
952
|
+
const { host, value } = await readSecretOnSession({ socketRoot: tmpSocketRoot(), session: namespacedSession, cwd: runWorkDir, ref, allowDomains });
|
|
953
|
+
if (!value) throw new Error(`read-secret: ${ref} on ${host} is empty`);
|
|
954
|
+
secretMasker.add(value, Infinity);
|
|
955
|
+
log(`exit: 0 | read-secret ${ref} on ${host} (${value.length} chars, value not logged)`);
|
|
956
|
+
return Response.json({ status: 0, stdout: "", stderr: "", files: [], secretOut: value });
|
|
957
|
+
} catch (error) {
|
|
958
|
+
const message = secretMasker.mask(error instanceof Error ? error.message : String(error));
|
|
959
|
+
log(`exit: 1 | read-secret: ${message.split("\n")[0]}`);
|
|
960
|
+
return Response.json({ status: 1, stdout: "", stderr: `[rech] ${message}\n`, files: [] });
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
947
964
|
// For open commands, default to about:blank to avoid leaving connect.html visible
|
|
948
965
|
const isOpenCmd = filteredArgs[0] === "open";
|
|
949
966
|
const isOpenNoUrl = isOpenCmd && filteredArgs.length === 1;
|