truememory-mirror 1.0.9 → 1.0.11
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/bin/mirror.js +2 -2
- package/package.json +1 -1
- package/src/sanitizer.js +6 -0
package/bin/mirror.js
CHANGED
|
@@ -258,11 +258,11 @@ async function main() {
|
|
|
258
258
|
if (displayPct < serverPct) {
|
|
259
259
|
displayPct += Math.max(1, (serverPct - displayPct) * 0.3);
|
|
260
260
|
} else if (displayPct < 95) {
|
|
261
|
-
displayPct += 0.
|
|
261
|
+
displayPct += 0.7;
|
|
262
262
|
}
|
|
263
263
|
displayPct = Math.min(displayPct, 99);
|
|
264
264
|
renderProgress();
|
|
265
|
-
},
|
|
265
|
+
}, 500);
|
|
266
266
|
|
|
267
267
|
try {
|
|
268
268
|
await pollStatus(result.profile_id, args.apiUrl, (status) => {
|
package/package.json
CHANGED
package/src/sanitizer.js
CHANGED
|
@@ -33,6 +33,12 @@ export function sanitize(text) {
|
|
|
33
33
|
text = text.replace(/\b(sk-ant-api03-|sk-ant-|sk-proj-|sk-or-v1-|ghp_|gho_|github_pat_|ghu_|ghs_|pk_live_|sk_live_|pk_test_|sk_test_|xoxb-|xoxp-|xapp-|AKIA[A-Z0-9]|AGE-SECRET-KEY-|glpat-|pypi-|npm_)[a-zA-Z0-9_/+=.-]{10,}/g, '[API_KEY]');
|
|
34
34
|
text = text.replace(/\bAIza[a-zA-Z0-9_-]{30,}\b/g, '[API_KEY]');
|
|
35
35
|
text = text.replace(/\b(sk-|pk-)[a-zA-Z0-9_-]{20,}\b/g, '[API_KEY]');
|
|
36
|
+
// AWS secret access keys (40-char base64 with slashes and plus)
|
|
37
|
+
text = text.replace(/\b[A-Za-z0-9/+=]{40}\b/g, (match) => {
|
|
38
|
+
// Only redact if it looks like a secret (has mixed case + special chars)
|
|
39
|
+
if (/[a-z]/.test(match) && /[A-Z]/.test(match) && /[/+=]/.test(match)) return '[API_KEY]';
|
|
40
|
+
return match;
|
|
41
|
+
});
|
|
36
42
|
|
|
37
43
|
// --- JWTs (any alg, not just HS256) ---
|
|
38
44
|
text = text.replace(/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, '[JWT]');
|