gui: masked words and Never mask are a list, a row per word (noahhrreion on Discord)
noahhrreion: "希望脱敏词选项可以做成真正的列表,在一个小输入框里面不方便管理多个脱敏词". Settings → Privacy's Masked words was one comma-separated box. It is now a list (wordList in plugins/redact/settings.js): each word is its own row, edited in place (Enter or leaving the row saves, Escape puts it back, emptied is removed), × removes it, and the last row adds. Its sibling, Never mask under the mask actions, had the same box and gets the same list. Stored values are unchanged: redactWords and the allow list are still string arrays, saved through the same savePrefs / settings/redact-allow calls, and nothing is rewritten on open (the new test checks that opening the page saves nothing). Typed or pasted text splits as the old box did (, , and newlines, trimmed, empties dropped), so a pasted "a, b" is two rows. The Hide eye still shows every row as dots. New strings are in the redact plugin's i18n for zh, zh-TW, ja and de; the two old "separated by commas" hints are gone from the core i18n. The site's masking docs (en, zh, ja) say a row each. Run (on mote via mote-run, Chromium and WebKit): - new redact-words-list.test.cjs: 5 languages × 1100/400px × both engines, draw, add with Enter, paste-split, edit, Escape, ×, empty-and-Tab, reload; with i18n-keys 24/24 ok - redact-words-hidden, any-case, whole, mask-actions, redact-route, redact-kinds, redact-shape, settings-search, settings-sections, settings-lines-wrap, settings-hints, settings-groups, readable-focus, masking-records, mask-alert: 378/378 ok - go test ./internal/gui/ -run 'TestCoreScriptBudget|TestSettings': ok (app.js shrank; no budget raised) - screenshots light/dark, 1100/400px, both engines, looked at Broken by hand: without wordFocusBack (focus kept across a redraw) the new test goes red (waitForFunction timeout after the first add). Dropping the blur guard during a redraw (wordsRedrawing / isConnected) stays green in both Playwright engines, which fire no blur on removal; it is kept as a guard for engines that do, with no test that fails without it. Not tried: the real app on WebKitGTK / Windows WebView2; no Go files changed.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -21788,18 +21788,7 @@ function renderRedact(s, keep) {
|
||||
r.append(who, val);
|
||||
box.append(r);
|
||||
}
|
||||
const words = (s.redactWords || []).join(", ");
|
||||
const i = input(words, t("names, codenames, hosts"));
|
||||
i.className = "words";
|
||||
const save = () => {
|
||||
const v = i.value.split(/[,,\n]/).map((w) => w.trim()).filter(Boolean);
|
||||
if (v.join(", ") === words) return;
|
||||
savePrefs({ ...keep, redactWords: v });
|
||||
};
|
||||
i.onkeydown = (e) => { e.stopPropagation(); if (e.key === "Enter") save(); else if (e.key === "Escape") { i.value = words; i.blur(); } };
|
||||
i.onblur = save;
|
||||
row(t("Masked words"), t("Your own words to keep from vendors, separated by commas"), i);
|
||||
// plain words, matched as written unless the user asks for any case
|
||||
// Masked words go above this, a list of the redact plugin's (wordList)
|
||||
row(t("Masked words in any case"), t("A word also matches in other capitals: Nightjar masks NIGHTJAR and nightjar too"),
|
||||
onOff(s.redactWordsAnyCase, (redactWordsAnyCase) => savePrefs({ ...keep, redactWordsAnyCase }))).id = "redactWordsAnyCaseRow";
|
||||
row(t("Whole words only"), t("A word is not masked inside a longer one: ABC masks ABC and 'ABC' but not XABCD, and 123456 not 0.123456"),
|
||||
@@ -22202,21 +22191,7 @@ function renderMaskActions(s) {
|
||||
more.onclick = () => { maskActAll = !maskActAll; renderSettings(); };
|
||||
row(t("Personal data"), t("Emails, phone numbers, names and the rest, masked unless set here"), more).classList.add("mask-act-more");
|
||||
}
|
||||
// the allow list: values sent as written whichever finder finds them
|
||||
const allow = (s.redactAllow || []).join(", ");
|
||||
const i = input(allow, t("ops@company.com, build-01"));
|
||||
i.className = "words mask-allow";
|
||||
i.setAttribute("aria-label", t("Never mask"));
|
||||
const save = () => {
|
||||
const v = i.value.split(/[,,\n]/).map((w) => w.trim()).filter(Boolean);
|
||||
if (v.join(", ") === allow) return;
|
||||
writingPrefs(api("settings/redact-allow", { allow: v }))
|
||||
.then((ns) => { prefs = ns; renderSettings(); status(t("Saved"), "ok", 1500); })
|
||||
.catch(settingsErr);
|
||||
};
|
||||
i.onkeydown = (e) => { e.stopPropagation(); if (e.key === "Enter") save(); else if (e.key === "Escape") { i.value = allow; i.blur(); } };
|
||||
i.onblur = save;
|
||||
row(t("Never mask"), t("Values that always go as written, each whole and in any case, separated by commas: a team address, a test key"), i);
|
||||
// Never mask's list goes under these, the redact plugin's (wordList)
|
||||
}
|
||||
|
||||
// renderMaskTry: text typed here is masked as a request would be now, and
|
||||
|
||||
@@ -1426,7 +1426,6 @@ const I18N = {
|
||||
"On, on the CPU: CoreML failed ({error})": "已开启,运行在 CPU:CoreML 出错({error})",
|
||||
"On: the model starts with the next request": "已开启:模型会在下一个请求时启动",
|
||||
"Off. The model is downloaded ({size})": "已关闭。模型已下载({size})",
|
||||
"Your own words to keep from vendors, separated by commas": "不想让模型厂商看到的词,用逗号分隔",
|
||||
"names, codenames, hosts": "人名、代号、主机名",
|
||||
"Masking rules": "自定义脱敏规则",
|
||||
"Secrets magpie doesn't know, such as a gateway's own keys: what they start with, or a regular expression. Masked while Mask secrets is on": "内置规则不认识的密钥,比如自建网关的 Key:按前缀或正则匹配。「脱敏密钥」开启时生效",
|
||||
@@ -4463,7 +4462,6 @@ const I18N = {
|
||||
"Show all kinds ({n} more)": "显示全部类别(还有 {n} 个)",
|
||||
"Never mask": "从不脱敏",
|
||||
"ops@company.com, build-01": "ops@company.com, build-01",
|
||||
"Values that always go as written, each whole and in any case, separated by commas: a team address, a test key": "总是按原样发送的值,整段匹配、不分大小写,用逗号分隔:比如团队邮箱、测试密钥",
|
||||
"Try it": "试一试",
|
||||
"Paste text an agent might send: it is masked here as a request would be, and kept nowhere": "粘贴一段智能体可能发送的文本:会像真实请求一样在本机脱敏,且不保存",
|
||||
"Deploy with key sk-proj-… and mail ops@company.com": "用密钥 sk-proj-… 部署,发邮件给 ops@company.com",
|
||||
@@ -5994,7 +5992,6 @@ const I18N = {
|
||||
"On, on the CPU: CoreML failed ({error})": "已開啟,執行於 CPU:CoreML 出錯({error})",
|
||||
"On: the model starts with the next request": "已開啟:模型會在下一個請求時啟動",
|
||||
"Off. The model is downloaded ({size})": "已關閉。模型已下載({size})",
|
||||
"Your own words to keep from vendors, separated by commas": "不想讓模型廠商看到的詞,用逗號分隔",
|
||||
"names, codenames, hosts": "人名、代號、主機名",
|
||||
"Masking rules": "自定義脫敏規則",
|
||||
"Secrets magpie doesn't know, such as a gateway's own keys: what they start with, or a regular expression. Masked while Mask secrets is on": "內建規則不認識的金鑰,比如自建閘道的 Key:按字首或正則匹配。「脫敏金鑰」開啟時生效",
|
||||
@@ -9019,7 +9016,6 @@ const I18N = {
|
||||
"Show all kinds ({n} more)": "顯示全部類別(還有 {n} 個)",
|
||||
"Never mask": "從不脫敏",
|
||||
"ops@company.com, build-01": "ops@company.com, build-01",
|
||||
"Values that always go as written, each whole and in any case, separated by commas: a team address, a test key": "一律照原樣送出的值,整段比對、不分大小寫,用逗號分隔:例如團隊信箱、測試金鑰",
|
||||
"Try it": "試試看",
|
||||
"Paste text an agent might send: it is masked here as a request would be, and kept nowhere": "貼上一段智慧體可能送出的文字:會像真實請求一樣在本機脫敏,且不保存",
|
||||
"Deploy with key sk-proj-… and mail ops@company.com": "用金鑰 sk-proj-… 部署,寄信給 ops@company.com",
|
||||
@@ -10531,7 +10527,6 @@ const I18N = {
|
||||
"On, on the CPU: CoreML failed ({error})": "オン、CPU で実行中:CoreML が失敗しました({error})",
|
||||
"On: the model starts with the next request": "オン:次のリクエストでモデルが起動します",
|
||||
"Off. The model is downloaded ({size})": "オフ。モデルはダウンロード済み({size})",
|
||||
"Your own words to keep from vendors, separated by commas": "ベンダーに見せたくない語(カンマ区切り)",
|
||||
"names, codenames, hosts": "人名、コードネーム、ホスト名",
|
||||
"Masking rules": "マスクルール",
|
||||
"Secrets magpie doesn't know, such as a gateway's own keys: what they start with, or a regular expression. Masked while Mask secrets is on": "magpie が認識しないシークレット(独自ゲートウェイのキーなど)を、先頭の文字列または正規表現で指定します。「シークレットをマスク」がオンのときにマスクされます",
|
||||
@@ -13577,7 +13572,6 @@ const I18N = {
|
||||
"Show all kinds ({n} more)": "すべての種類を表示(ほか {n} 件)",
|
||||
"Never mask": "マスクしない",
|
||||
"ops@company.com, build-01": "ops@company.com, build-01",
|
||||
"Values that always go as written, each whole and in any case, separated by commas: a team address, a test key": "常にそのまま送る値。全体一致、大文字小文字を区別せず、カンマ区切り:チームのアドレス、テスト用キーなど",
|
||||
"Try it": "試す",
|
||||
"Paste text an agent might send: it is masked here as a request would be, and kept nowhere": "エージェントが送りそうなテキストを貼り付けてください。実際のリクエストと同じくこのコンピューターでマスクし、どこにも保存しません",
|
||||
"Deploy with key sk-proj-… and mail ops@company.com": "キー sk-proj-… でデプロイし、ops@company.com にメール",
|
||||
@@ -15099,7 +15093,6 @@ const I18N = {
|
||||
"On, on the CPU: CoreML failed ({error})": "An, auf der CPU: CoreML ist ausgefallen ({error})",
|
||||
"On: the model starts with the next request": "An: das Modell startet mit der nächsten Anfrage",
|
||||
"Off. The model is downloaded ({size})": "Aus. Das Modell ist geladen ({size})",
|
||||
"Your own words to keep from vendors, separated by commas": "Eigene Wörter, die Anbieter nicht sehen sollen, durch Kommas getrennt",
|
||||
"names, codenames, hosts": "Namen, Codenamen, Hosts",
|
||||
"Masking rules": "Maskierungsregeln",
|
||||
"Secrets magpie doesn't know, such as a gateway's own keys: what they start with, or a regular expression. Masked while Mask secrets is on": "Geheimnisse, die magpie nicht kennt, etwa eigene Schlüssel eines AI-Gateways: ihr Anfang oder ein regulärer Ausdruck. Maskiert, solange „Geheimnisse maskieren“ an ist",
|
||||
@@ -18135,7 +18128,6 @@ const I18N = {
|
||||
"Show all kinds ({n} more)": "Alle Arten zeigen ({n} weitere)",
|
||||
"Never mask": "Nie maskieren",
|
||||
"ops@company.com, build-01": "ops@company.com, build-01",
|
||||
"Values that always go as written, each whole and in any case, separated by commas: a team address, a test key": "Werte, die immer unverändert gehen, jeweils ganz und ohne Groß-/Kleinschreibung, durch Kommas getrennt: eine Team-Adresse, ein Testschlüssel",
|
||||
"Try it": "Ausprobieren",
|
||||
"Paste text an agent might send: it is masked here as a request would be, and kept nowhere": "Text einfügen, den ein Agent senden könnte: er wird hier wie eine Anfrage maskiert und nirgends gespeichert",
|
||||
"Deploy with key sk-proj-… and mail ops@company.com": "Mit Schlüssel sk-proj-… deployen und an ops@company.com mailen",
|
||||
|
||||
@@ -95,6 +95,9 @@ magpie.strings({
|
||||
"Play the demo": "播放",
|
||||
"Where the demo is": "进度",
|
||||
"Sign in to github.com for me with the password {pw}, the account is {email}.": "用密码 {pw} 帮我登录 github.com,账号是 {email}。",
|
||||
"Your own words to keep from vendors, one on each row": "不想让模型厂商看到的词,每行一个",
|
||||
"Values that always go as written, each whole and in any case, one on each row: a team address, a test key": "总是按原样发送的值,整段匹配、不分大小写,每行一个:比如团队邮箱、测试密钥",
|
||||
"Remove {word}": "移除 {word}",
|
||||
},
|
||||
"zh-TW": {
|
||||
"Turn on masking": "開啟脫敏",
|
||||
@@ -190,6 +193,9 @@ magpie.strings({
|
||||
"Play the demo": "播放",
|
||||
"Where the demo is": "進度",
|
||||
"Sign in to github.com for me with the password {pw}, the account is {email}.": "用密碼 {pw} 幫我登入 github.com,帳號是 {email}。",
|
||||
"Your own words to keep from vendors, one on each row": "不想讓模型廠商看到的詞,每行一個",
|
||||
"Values that always go as written, each whole and in any case, one on each row: a team address, a test key": "一律照原樣送出的值,整段比對、不分大小寫,每行一個:例如團隊信箱、測試金鑰",
|
||||
"Remove {word}": "移除 {word}",
|
||||
},
|
||||
ja: {
|
||||
"Turn on masking": "マスクをオンにする",
|
||||
@@ -285,6 +291,9 @@ magpie.strings({
|
||||
"Play the demo": "再生",
|
||||
"Where the demo is": "再生位置",
|
||||
"Sign in to github.com for me with the password {pw}, the account is {email}.": "パスワード {pw} で github.com にサインインして。アカウントは {email}。",
|
||||
"Your own words to keep from vendors, one on each row": "ベンダーに見せたくない語(1 行に 1 つ)",
|
||||
"Values that always go as written, each whole and in any case, one on each row: a team address, a test key": "常にそのまま送る値。全体一致、大文字小文字を区別せず、1 行に 1 つ:チームのアドレス、テスト用キーなど",
|
||||
"Remove {word}": "{word} を削除",
|
||||
},
|
||||
de: {
|
||||
"Turn on masking": "Maskierung einschalten",
|
||||
@@ -380,5 +389,8 @@ magpie.strings({
|
||||
"Play the demo": "Abspielen",
|
||||
"Where the demo is": "Fortschritt",
|
||||
"Sign in to github.com for me with the password {pw}, the account is {email}.": "Melden Sie mich mit dem Passwort {pw} bei github.com an, das Konto ist {email}.",
|
||||
"Your own words to keep from vendors, one on each row": "Eigene Wörter, die Anbieter nicht sehen sollen, eines pro Zeile",
|
||||
"Values that always go as written, each whole and in any case, one on each row: a team address, a test key": "Werte, die immer unverändert gehen, jeweils ganz und ohne Groß-/Kleinschreibung, einer pro Zeile: eine Team-Adresse, ein Testschlüssel",
|
||||
"Remove {word}": "{word} entfernen",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -365,3 +365,13 @@ body.window .msk-onebar::before { inset: -6px calc(var(--bar, 0px) - 16px) -6px
|
||||
/* Masked words as dots until Show (plugins/redact/settings.js) */
|
||||
#redactList input.words.words-hidden { -webkit-text-security: disc; }
|
||||
#redactList .redact-eye { flex: none; }
|
||||
/* Masked words and Never mask, one row a value (wordList in settings.js):
|
||||
the row's words, then the list across its width */
|
||||
.row.pref.word-rows { flex-wrap: wrap; row-gap: 8px; }
|
||||
.row.pref.word-rows .who { flex: 1 1 0; }
|
||||
.row.pref.word-rows .sub { white-space: normal; }
|
||||
.word-list { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
||||
.word-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
||||
.word-line input.words { flex: 1 1 auto; width: auto; min-width: 0; }
|
||||
.word-line .word-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border-radius: 6px; font-size: 15px; color: var(--muted); }
|
||||
.word-line.word-new .text { flex: none; }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Settings › Privacy's Instead of masking, send to, and Masked words kept
|
||||
// as dots until Show (the redact plugin's part of Settings). Run after
|
||||
// app.js, whose helpers it shares (el, icon, openPicker, modelOpt,
|
||||
// prefWrite, api), and before start.js draws
|
||||
// Settings. It wraps renderRedact, so app.js carries none of it: the row
|
||||
// Settings › Privacy's Instead of masking, send to, and Masked words and
|
||||
// Never mask as lists, Masked words as dots until Show (the redact
|
||||
// plugin's part of Settings). Run after app.js, whose helpers it shares
|
||||
// (el, icon, openPicker, modelOpt, prefWrite, api), and before start.js
|
||||
// draws Settings. It wraps renderRedact, so app.js carries none of it: the row
|
||||
// shows while anything is masked, after the masked-words rows.
|
||||
|
||||
// redactRouteRow: where a request masking would change goes instead
|
||||
@@ -39,34 +39,136 @@ function redactRouteRow(s) {
|
||||
const after = $("#redactWordsWholeRow");
|
||||
if (after) after.after(r); else $("#redactList").append(r);
|
||||
}
|
||||
// wordList: Masked words and Never mask as a list, one row a value
|
||||
// (noahhrreion on Discord: many words were hard to keep in one small
|
||||
// box). A row is edited in place and saved on Enter or on leaving it;
|
||||
// emptied, or its ×, takes it out. The box under them adds one, or
|
||||
// several split at commas as the one box was, so what is saved is the
|
||||
// same list of strings. A redraw keeps the box being typed in, and what
|
||||
// it holds.
|
||||
let wordsRedrawing = false;
|
||||
const splitWords = (v) => v.split(/[,,\n]/).map((w) => w.trim()).filter(Boolean);
|
||||
function wordList(key, list, ph, label, save) {
|
||||
const box = el("div", "word-list");
|
||||
box.dataset.list = key;
|
||||
let cur = list.map((w) => ({ w }));
|
||||
const put = (next) => {
|
||||
if (next.map((o) => o.w).join("\n") === cur.map((o) => o.w).join("\n")) return;
|
||||
cur = next;
|
||||
save(next.map((o) => o.w));
|
||||
};
|
||||
const keys = (i, done, back) => {
|
||||
i.onkeydown = (e) => {
|
||||
e.stopPropagation();
|
||||
if (e.isComposing || e.keyCode === 229) return;
|
||||
if (e.key === "Enter") done(true);
|
||||
else if (e.key === "Escape") { i.value = back; i.blur(); }
|
||||
};
|
||||
// a box a redraw takes away saves nothing: wordFocusBack puts it back
|
||||
i.onblur = () => { if (!wordsRedrawing && i.isConnected) done(false); };
|
||||
};
|
||||
for (const o of cur) {
|
||||
const line = el("div", "word-line"), i = input(o.w, "");
|
||||
i.className = "words";
|
||||
i.dataset.word = o.w;
|
||||
i.setAttribute("aria-label", label);
|
||||
keys(i, (enter) => {
|
||||
if (enter) return i.blur();
|
||||
if (i.value.trim() === o.w) return;
|
||||
const n = cur.indexOf(o);
|
||||
if (n >= 0) put([...cur.slice(0, n), ...splitWords(i.value).map((w) => ({ w })), ...cur.slice(n + 1)]);
|
||||
}, o.w);
|
||||
const x = el("button", "text danger word-x", "×");
|
||||
x.type = "button";
|
||||
x.title = t("Remove {word}", { word: o.w });
|
||||
x.setAttribute("aria-label", x.title);
|
||||
// pressed, the box being edited keeps its focus and its words
|
||||
x.onmousedown = (e) => e.preventDefault();
|
||||
x.onclick = () => put(cur.filter((c) => c !== o));
|
||||
line.append(i, x);
|
||||
box.append(line);
|
||||
}
|
||||
const line = el("div", "word-line word-new"), add = input("", ph);
|
||||
add.className = "words word-add";
|
||||
add.setAttribute("aria-label", label);
|
||||
const go = el("button", "text", t("Add"));
|
||||
go.type = "button";
|
||||
const take = () => {
|
||||
const v = splitWords(add.value);
|
||||
add.value = "";
|
||||
if (v.length) put([...cur, ...v.map((w) => ({ w }))]);
|
||||
};
|
||||
keys(add, (enter) => { if (enter || add.value.trim()) take(); }, "");
|
||||
go.onmousedown = (e) => e.preventDefault();
|
||||
go.onclick = () => { take(); add.focus(NO_SCROLL); };
|
||||
line.append(add, go);
|
||||
box.append(line);
|
||||
return box;
|
||||
}
|
||||
// wordRow: the row a wordList sits under, its words above and the list
|
||||
// across the row's width
|
||||
function wordRow(name, sub, list, ...tools) {
|
||||
const r = el("div", "row pref word-rows"), who = el("div", "who"), val = el("div", "val");
|
||||
who.append(el("div", "name", name), el("div", "sub", sub));
|
||||
val.append(...tools);
|
||||
r.append(who, val, list);
|
||||
return r;
|
||||
}
|
||||
// the box typed in before a redraw, found again after it
|
||||
function wordFocusOf() {
|
||||
const i = document.activeElement;
|
||||
const box = i?.closest?.(".word-list");
|
||||
if (!box || i.tagName !== "INPUT") return null;
|
||||
return { key: box.dataset.list, word: i.dataset.word, value: i.value, a: i.selectionStart, b: i.selectionEnd };
|
||||
}
|
||||
function wordFocusBack(f) {
|
||||
if (!f) return;
|
||||
const box = document.querySelector(`.word-list[data-list="${f.key}"]`);
|
||||
const i = [...(box?.querySelectorAll("input.words") || [])].find((i) => i.dataset.word === f.word);
|
||||
if (!i) return;
|
||||
i.value = f.value;
|
||||
i.focus(NO_SCROLL);
|
||||
try { i.setSelectionRange(f.a, f.b); } catch {}
|
||||
}
|
||||
// redactWordsHidden: Masked words drawn as dots until Show, as a key is
|
||||
// (noahhrreion on Discord: a screen share showed the words kept from
|
||||
// vendors). Still a text box, so an IME writes 百度; a password box only
|
||||
// vendors). Still text boxes, so an IME writes 百度; password boxes only
|
||||
// where the engine has no text security. Show holds until the window
|
||||
// reloads.
|
||||
let redactWordsShown = false;
|
||||
function redactWordsHidden() {
|
||||
const r = [...$("#redactList").children].find((r) => r.querySelector(".who .name")?.textContent === t("Masked words"));
|
||||
const i = r?.querySelector("input.words");
|
||||
if (!i) return;
|
||||
function redactWordsHidden(r) {
|
||||
const dots = CSS.supports("-webkit-text-security", "disc");
|
||||
const eye = el("button", "text redact-eye");
|
||||
eye.type = "button";
|
||||
const set = () => {
|
||||
if (dots) i.classList.toggle("words-hidden", !redactWordsShown);
|
||||
else i.type = redactWordsShown ? "text" : "password";
|
||||
for (const i of r.querySelectorAll("input.words")) {
|
||||
if (dots) i.classList.toggle("words-hidden", !redactWordsShown);
|
||||
else i.type = redactWordsShown ? "text" : "password";
|
||||
}
|
||||
eye.textContent = t(redactWordsShown ? "Hide" : "Show");
|
||||
eye.setAttribute("aria-pressed", String(redactWordsShown));
|
||||
};
|
||||
eye.onclick = () => { redactWordsShown = !redactWordsShown; set(); };
|
||||
set();
|
||||
i.after(eye);
|
||||
r.querySelector(".val").append(eye);
|
||||
}
|
||||
{
|
||||
const draw = renderRedact;
|
||||
renderRedact = function (s, keep) {
|
||||
draw(s, keep);
|
||||
redactWordsHidden();
|
||||
const f = wordFocusOf();
|
||||
wordsRedrawing = true;
|
||||
try { draw(s, keep); } finally { wordsRedrawing = false; }
|
||||
const words = wordRow(t("Masked words"), t("Your own words to keep from vendors, one on each row"),
|
||||
wordList("words", s.redactWords || [], t("names, codenames, hosts"), t("Masked words"), (redactWords) => savePrefs({ ...keep, redactWords })));
|
||||
const at = $("#redactWordsAnyCaseRow");
|
||||
if (at) at.before(words); else $("#redactList").append(words);
|
||||
redactWordsHidden(words);
|
||||
const acts = $("#maskActList");
|
||||
if (acts) acts.append(wordRow(t("Never mask"), t("Values that always go as written, each whole and in any case, one on each row: a team address, a test key"),
|
||||
wordList("allow", s.redactAllow || [], t("ops@company.com, build-01"), t("Never mask"), (allow) => writingPrefs(api("settings/redact-allow", { allow }))
|
||||
.then((ns) => { prefs = ns; renderSettings(); status(t("Saved"), "ok", 1500); })
|
||||
.catch(settingsErr))));
|
||||
wordFocusBack(f);
|
||||
if (s.redact || s.redactPersonal || (s.redactWords || []).length) redactRouteRow(s);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Settings › Privacy says what is done with each kind of value found
|
||||
// (#1977): Mask, Warn or Block, saved as the kind's choice, Mask saved as
|
||||
// no choice at all; personal kinds behind Show all kinds; a Never mask
|
||||
// list saved whole; and Try it, which shows text as the vendor would get
|
||||
// list saved whole, a value a row; and Try it, which shows text as the vendor would get
|
||||
// it, what was found and what would be done, says a block holds the
|
||||
// request back, keeps the text nowhere in the browser and shows no value
|
||||
// the preview didn't hand back. Every language, Chromium and WebKit,
|
||||
@@ -105,14 +105,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await page.waitForFunction(() => !document.querySelector('#maskActList .mask-act[data-kind="EMAIL"] .sub.act-warn'));
|
||||
assert.deepEqual(posted.at(-1), ["actions", { actions: { API_KEY: "block" } }]);
|
||||
|
||||
// the allow list, split on commas and saved whole
|
||||
const allow = acts.locator("input.mask-allow");
|
||||
// the allow list, its add box split on commas, saved whole and
|
||||
// drawn a value a row (wordList)
|
||||
const allow = acts.locator('.word-list[data-list="allow"] input.word-add');
|
||||
await reach(page, allow);
|
||||
await allow.fill(" team@kelvarn.io,build-01 ,, ");
|
||||
await allow.press("Enter");
|
||||
for (let i = 0; i < 100 && !posted.some(([k]) => k === "allow"); i++) await page.waitForTimeout(40);
|
||||
assert.deepEqual(posted.filter(([k]) => k === "allow").at(-1), ["allow", { allow: ["team@kelvarn.io", "build-01"] }]);
|
||||
await page.waitForFunction(() => document.querySelector("#maskActList input.mask-allow")?.value === "team@kelvarn.io, build-01");
|
||||
await page.waitForFunction(() => [...document.querySelectorAll('#maskActList .word-list[data-list="allow"] input[data-word]')].map((i) => i.value).join("|") === "team@kelvarn.io|build-01");
|
||||
|
||||
// Try it: the vendor's text, what was found, and that it is held back
|
||||
const box = page.locator("#maskTryList textarea.mask-try-in");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Run with Node's test runner and Playwright on the module path; see README.md.
|
||||
// Settings › Privacy's Masked words are drawn as dots until Show
|
||||
// (noahhrreion on Discord: a screen share showed the words kept from
|
||||
// vendors), as a provider's key is. The box stays a text box, so an IME
|
||||
// still writes into it; Show reveals them and holds through a redraw;
|
||||
// a word typed while hidden saves as before. In every language, Chromium
|
||||
// vendors), as a provider's key is. Each word's row and the add box stay
|
||||
// text boxes, so an IME still writes into them; Show reveals them and
|
||||
// holds through a redraw; a word added while hidden saves as before. In every language, Chromium
|
||||
// and WebKit, wide and narrow.
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs/promises");
|
||||
@@ -46,17 +46,19 @@ function serve(lang, saved) {
|
||||
};
|
||||
}
|
||||
|
||||
// what the box shows, read from the page as it is in one go (a save
|
||||
// what the boxes show, read from the page as it is in one go (a save
|
||||
// redraws the list, so a row found a moment before can be gone): dots by
|
||||
// text security, or a password box where the engine has none
|
||||
const shown = (page, name) => page.evaluate((name) => {
|
||||
const r = [...document.querySelector("#redactList").children].find((r) => r.querySelector(".who .name")?.textContent === name);
|
||||
const i = r.querySelector("input.words"), s = getComputedStyle(i), eye = r.querySelector(".redact-eye");
|
||||
const list = document.querySelector("#redactList").getBoundingClientRect(), b = i.getBoundingClientRect(), e = eye.getBoundingClientRect();
|
||||
const boxes = [...r.querySelectorAll("input.words")], eye = r.querySelector(".redact-eye");
|
||||
const hid = (i) => getComputedStyle(i).getPropertyValue("-webkit-text-security") === "disc" || i.type === "password";
|
||||
const list = document.querySelector("#redactList").getBoundingClientRect(), e = eye.getBoundingClientRect();
|
||||
return {
|
||||
type: i.type, dots: s.getPropertyValue("-webkit-text-security") === "disc" || i.type === "password", value: i.value,
|
||||
types: [...new Set(boxes.map((i) => i.type))], dots: boxes.every(hid), shown: boxes.every((i) => !hid(i)),
|
||||
value: boxes.filter((i) => i.dataset.word).map((i) => i.value).join(", "),
|
||||
eye: eye.textContent, pressed: eye.getAttribute("aria-pressed"),
|
||||
inside: b.left >= list.left - 1 && e.right <= list.right + 1 && b.width >= 80,
|
||||
inside: boxes.every((i) => { const b = i.getBoundingClientRect(); return b.left >= list.left - 1 && b.right <= list.right + 1 && b.width >= 80; }) && e.right <= list.right + 1,
|
||||
wide: document.documentElement.scrollWidth > document.documentElement.clientWidth,
|
||||
};
|
||||
}, name);
|
||||
@@ -83,14 +85,14 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
let m = await shown(page, w.name);
|
||||
assert.equal(m.value, "Nightjar, 百度");
|
||||
assert(m.dots, "hidden at first");
|
||||
assert.equal(m.type, "text", "a text box, so an IME writes into it");
|
||||
assert.deepEqual(m.types, ["text"], "text boxes, so an IME writes into them");
|
||||
assert.equal(m.eye, w.show);
|
||||
assert.equal(m.pressed, "false");
|
||||
assert(m.inside && !m.wide, "the box and Show fit the page");
|
||||
|
||||
await row.locator(".redact-eye").click();
|
||||
m = await shown(page, w.name);
|
||||
assert(!m.dots, "shown");
|
||||
assert(m.shown, "shown");
|
||||
assert.equal(m.eye, w.hide);
|
||||
assert.equal(m.pressed, "true");
|
||||
|
||||
@@ -100,21 +102,21 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await page.waitForFunction(() => document.querySelector("#redactWordsWholeRow .segs .opt.on")?.textContent === t("On"));
|
||||
await row.locator(".redact-eye").waitFor();
|
||||
m = await shown(page, w.name);
|
||||
assert(!m.dots && m.eye === w.hide, "Show holds through a redraw");
|
||||
assert(m.shown && m.eye === w.hide, "Show holds through a redraw");
|
||||
|
||||
// hidden again, a word typed saves as before
|
||||
await row.locator(".redact-eye").click();
|
||||
assert((await shown(page, w.name)).dots);
|
||||
const box = row.locator("input.words");
|
||||
await box.fill("Nightjar, 百度, Kestrel");
|
||||
const box = row.locator("input.word-add");
|
||||
await box.fill("Kestrel");
|
||||
await box.press("Enter");
|
||||
for (let n = 0; n < 50 && !saved.at(-1)?.redactWords?.includes("Kestrel"); n++) await new Promise((r) => setTimeout(r, 100));
|
||||
assert.deepEqual(saved.at(-1).redactWords, ["Nightjar", "百度", "Kestrel"]);
|
||||
// the save redraws the page (Enter, then the old box's blur): wait
|
||||
// for the box on the page now, never one a redraw took away
|
||||
await page.waitForFunction(() => {
|
||||
const i = document.querySelector("#redactList input.words");
|
||||
return i?.isConnected && i.value.includes("Kestrel") && i.nextElementSibling?.classList.contains("redact-eye") && getComputedStyle(i).getPropertyValue("-webkit-text-security") === "disc";
|
||||
const i = document.querySelector('#redactList input.words[data-word="Kestrel"]');
|
||||
return i?.isConnected && i.closest(".row")?.querySelector(".redact-eye") && getComputedStyle(i).getPropertyValue("-webkit-text-security") === "disc";
|
||||
}, null, { timeout: 3000 }).catch(() => {});
|
||||
const last = await shown(page, w.name);
|
||||
assert(last.dots && last.eye === w.show, "still hidden after the save's redraw " + JSON.stringify(last));
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
// Run with Node's test runner and Playwright on the module path; see README.md.
|
||||
// Settings › Privacy's Masked words as a list, a word a row (noahhrreion on
|
||||
// Discord: many words were hard to keep in one small box). Words saved by
|
||||
// the one box before are drawn a row each, untouched until edited; the add
|
||||
// box takes a word, or several split at commas as the box did, and keeps
|
||||
// its focus for the next; a row is edited in place, × takes it out, an
|
||||
// emptied row goes, Escape puts a row back; what is saved is the same list
|
||||
// of strings, and a reload draws it again. Every language, Chromium and
|
||||
// WebKit, wide and narrow.
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs/promises");
|
||||
const path = require("node:path");
|
||||
const { test } = require("node:test");
|
||||
const { chromium, webkit } = require("playwright");
|
||||
const { reach, watchSettingsReads, settingsDrawn } = require("./reader.cjs");
|
||||
|
||||
const assets = path.resolve(__dirname, "../assets");
|
||||
const remove = { en: "Remove Kestrel", zh: "移除 Kestrel", "zh-TW": "移除 Kestrel", ja: "Kestrel を削除", de: "Kestrel entfernen" };
|
||||
|
||||
function serve(lang, saved, box) {
|
||||
return async (r) => {
|
||||
const url = new URL(r.request().url());
|
||||
const json = (data) => r.fulfill({ json: data });
|
||||
if (url.pathname === "/boot.js") return r.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return r.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings: box.settings });
|
||||
if (url.pathname === "/api/settings") {
|
||||
if (r.request().method() === "POST") {
|
||||
box.settings = JSON.parse(r.request().postData());
|
||||
saved.push(box.settings.redactWords);
|
||||
}
|
||||
return json(box.settings);
|
||||
}
|
||||
if (url.pathname === "/api/groups") return json({ models: [], groups: [], pools: [] });
|
||||
if (url.pathname === "/api/providers") return json({ providers: [], presets: [], excluded: [], gateway: { running: true, window: true, url: "http://127.0.0.1:3999" } });
|
||||
if (url.pathname.startsWith("/api/")) return json({});
|
||||
const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
|
||||
const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
|
||||
await r.fulfill({ body: await fs.readFile(file), contentType });
|
||||
};
|
||||
}
|
||||
|
||||
const LIST = '#redactList .word-list[data-list="words"]';
|
||||
// the words on the page now, read in one go (a save redraws the list)
|
||||
const rows = (page) => page.evaluate((sel) => [...document.querySelectorAll(`${sel} input[data-word]`)].map((i) => i.value), LIST);
|
||||
// the page drawn again with these words, the list's own save landed
|
||||
const drawn = (page, want) => page.waitForFunction(([sel, want]) =>
|
||||
JSON.stringify([...document.querySelectorAll(`${sel} input[data-word]`)].map((i) => i.dataset.word)) === want, [LIST, JSON.stringify(want)], { timeout: 5000 });
|
||||
const savedAs = async (saved, want) => {
|
||||
for (let n = 0; n < 100 && JSON.stringify(saved.at(-1)) !== JSON.stringify(want); n++) await new Promise((r) => setTimeout(r, 50));
|
||||
assert.deepEqual(saved.at(-1), want);
|
||||
};
|
||||
|
||||
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
|
||||
for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) {
|
||||
for (const width of [1100, 400]) {
|
||||
test(`${engine} ${lang} ${width}px: masked words are a list, added, edited and removed a row at a time`, async (t) => {
|
||||
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
|
||||
t.after(() => browser.close());
|
||||
const page = await (await browser.newContext({ viewport: { width, height: 1400 }, reducedMotion: "reduce" })).newPage();
|
||||
page.setDefaultTimeout(5000);
|
||||
page.setDefaultNavigationTimeout(60000);
|
||||
const errors = [], saved = [];
|
||||
// as the one box saved them: " , " split, trimmed, in order
|
||||
const box = { settings: { lang, theme: "light", redact: true, redactPersonal: false, redactWords: ["Nightjar", "百度", "build-01.internal"] } };
|
||||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
await page.route("**/*", serve(lang, saved, box));
|
||||
await watchSettingsReads(page);
|
||||
await page.goto("http://magpie.test/?view=settings&tab=privacy");
|
||||
await page.locator(LIST).waitFor();
|
||||
await settingsDrawn(page);
|
||||
|
||||
// what was saved before, a row each, nothing written on open
|
||||
assert.deepEqual(await rows(page), ["Nightjar", "百度", "build-01.internal"]);
|
||||
assert.deepEqual(saved, [], "opening the page saves nothing");
|
||||
const fit = await page.evaluate((sel) => {
|
||||
const l = document.querySelector("#redactList").getBoundingClientRect();
|
||||
return [...document.querySelectorAll(`${sel} input, ${sel} button`)].every((n) => { const b = n.getBoundingClientRect(); return b.left >= l.left - 1 && b.right <= l.right + 1; })
|
||||
&& document.documentElement.scrollWidth <= document.documentElement.clientWidth;
|
||||
}, LIST);
|
||||
assert(fit, "every row fits the page");
|
||||
// no native select, and the words stay dots until Show
|
||||
assert.equal(await page.locator(`${LIST} select`).count(), 0);
|
||||
await page.locator('#redactList .row:has(.word-list[data-list="words"]) .redact-eye').click();
|
||||
|
||||
// added: one, then two pasted with commas, the box keeping its focus
|
||||
const add = page.locator(`${LIST} input.word-add`);
|
||||
await reach(page, add);
|
||||
await add.fill("Kestrel");
|
||||
await add.press("Enter");
|
||||
await savedAs(saved, ["Nightjar", "百度", "build-01.internal", "Kestrel"]);
|
||||
await drawn(page, ["Nightjar", "百度", "build-01.internal", "Kestrel"]);
|
||||
await page.waitForFunction((sel) => document.activeElement?.matches(`${sel} input.word-add`) && document.activeElement.value === "", LIST);
|
||||
await page.keyboard.type(" Osprey,ops.example.com ,, ");
|
||||
await page.keyboard.press("Enter");
|
||||
const five = ["Nightjar", "百度", "build-01.internal", "Kestrel", "Osprey", "ops.example.com"];
|
||||
await savedAs(saved, five);
|
||||
await drawn(page, five);
|
||||
|
||||
// edited in place: the row keeps its place
|
||||
const n = saved.length;
|
||||
const baidu = page.locator(`${LIST} input[data-word="百度"]`);
|
||||
await baidu.fill("百度在线");
|
||||
await baidu.press("Enter");
|
||||
const edited = ["Nightjar", "百度在线", "build-01.internal", "Kestrel", "Osprey", "ops.example.com"];
|
||||
await savedAs(saved, edited);
|
||||
await drawn(page, edited);
|
||||
// Escape puts a row back, and saves nothing
|
||||
const night = page.locator(`${LIST} input[data-word="Nightjar"]`);
|
||||
await night.fill("Nope");
|
||||
await night.press("Escape");
|
||||
assert.equal(await night.inputValue(), "Nightjar");
|
||||
assert.equal(saved.length, n + 1, "Escape saved nothing");
|
||||
|
||||
// × takes a row out, its name said in the window's language
|
||||
const x = page.locator(`${LIST} .word-line:has(input[data-word="Kestrel"]) .word-x`);
|
||||
assert.equal(await x.getAttribute("aria-label"), remove[lang]);
|
||||
await x.click();
|
||||
const less = ["Nightjar", "百度在线", "build-01.internal", "Osprey", "ops.example.com"];
|
||||
await savedAs(saved, less);
|
||||
await drawn(page, less);
|
||||
// and a row emptied goes when it is left
|
||||
const ops = page.locator(`${LIST} input[data-word="ops.example.com"]`);
|
||||
await ops.fill("");
|
||||
await ops.press("Tab");
|
||||
const left = ["Nightjar", "百度在线", "build-01.internal", "Osprey"];
|
||||
await savedAs(saved, left);
|
||||
await drawn(page, left);
|
||||
|
||||
// what was saved is drawn again on the next load
|
||||
await page.reload();
|
||||
await page.locator(LIST).waitFor();
|
||||
await settingsDrawn(page);
|
||||
assert.deepEqual(await rows(page), left);
|
||||
assert.deepEqual(box.settings.redactWords, left);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@
|
||||
<li><b>ページを開く</b><span class="ui">設定</span> → <span class="ui">プライバシー</span> を開きます。</li>
|
||||
<li><b>シークレットをマスク</b><span class="ui">マスクするもの</span> の <span class="ui">シークレットをマスク</span> を <span class="ui">オン</span> にします。API キー、秘密鍵、トークン、パスワードが対象です。</li>
|
||||
<li><b>必要なら個人情報も</b><span class="ui">個人情報をマスク</span> を <span class="ui">オン</span> にすると、メールアドレス、電話番号、ID 番号、銀行カード番号もマスクされます。オンにすると、その下に個人情報の種類ごとのスイッチが並びます。</li>
|
||||
<li><b>自分の語</b><span class="ui">マスクする語</span> に、ベンダーに見せたくない名前、コードネーム、ホスト名をカンマ区切りで入れます。<span class="ui">マスクする語の大文字・小文字を区別しない</span> をオンにすると、<em>Nightjar</em> で <em>NIGHTJAR</em> もマスクされます。magpie が知らないシークレット(自分のゲートウェイのキーなど)は <span class="ui">マスクルール</span> に、先頭の文字列か正規表現で追加します。</li>
|
||||
<li><b>自分の語</b><span class="ui">マスクする語</span> に、ベンダーに見せたくない名前、コードネーム、ホスト名を 1 行に 1 つずつ入れます(カンマ区切りで貼り付けると 1 つずつの行になります)。<span class="ui">マスクする語の大文字・小文字を区別しない</span> をオンにすると、<em>Nightjar</em> で <em>NIGHTJAR</em> もマスクされます。magpie が知らないシークレット(自分のゲートウェイのキーなど)は <span class="ui">マスクルール</span> に、先頭の文字列か正規表現で追加します。</li>
|
||||
<li><b>試す</b><span class="ui">試す</span> にテキストを貼ると、ベンダーが実際に受け取る内容が表示されます。貼った内容は保存されません。</li>
|
||||
</ol>
|
||||
<p>変更は次のリクエストから効き、再起動もエージェント側の変更もいりません。実際にマスクするのは組み込みプラグイン <span class="ui">プライバシーマスキング</span>(<code>redact</code>、<span class="ui">設定</span> → <span class="ui">プラグイン</span>)で、何かのマスクが求められている間は常にオンです。</p>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<li><b>Open the page</b>Go to <span class="ui">Settings</span> → <span class="ui">Privacy</span>.</li>
|
||||
<li><b>Mask secrets</b>Under <span class="ui">What to mask</span>, set <span class="ui">Mask secrets</span> to <span class="ui">On</span>: API keys, private keys, tokens and passwords.</li>
|
||||
<li><b>Personal data, if you want it</b>Set <span class="ui">Mask personal data</span> to <span class="ui">On</span> for emails, phone numbers, ID and bank card numbers. Each further kind of personal data then gets its own switch below it.</li>
|
||||
<li><b>Your own words</b>In <span class="ui">Masked words</span>, list names, codenames or hosts to keep from vendors, separated by commas. <span class="ui">Masked words in any case</span> makes <em>Nightjar</em> mask <em>NIGHTJAR</em> too. A secret magpie doesn’t know, such as your gateway’s own keys, goes under <span class="ui">Masking rules</span>: what it starts with, or a regular expression.</li>
|
||||
<li><b>Your own words</b>In <span class="ui">Masked words</span>, list names, codenames or hosts to keep from vendors, one on each row (several pasted with commas between become a row each). <span class="ui">Masked words in any case</span> makes <em>Nightjar</em> mask <em>NIGHTJAR</em> too. A secret magpie doesn’t know, such as your gateway’s own keys, goes under <span class="ui">Masking rules</span>: what it starts with, or a regular expression.</li>
|
||||
<li><b>Try it</b>Paste a text into <span class="ui">Try it</span> to see exactly what the vendor would get. What you paste there isn’t kept.</li>
|
||||
</ol>
|
||||
<p>It applies from the next request, with no restart and nothing to change in your agent. The work is done by the built-in plugin <span class="ui">Privacy masking</span> (<code>redact</code>, in <span class="ui">Settings</span> → <span class="ui">Plugins</span>), which is on whenever any masking is asked for.</p>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<li><b>打开页面</b>进入 <span class="ui">设置</span> → <span class="ui">隐私</span>。</li>
|
||||
<li><b>脱敏密钥</b>在 <span class="ui">要遮什么</span> 下把 <span class="ui">脱敏密钥</span> 设为 <span class="ui">开启</span>:API Key、私钥、Token 和密码。</li>
|
||||
<li><b>个人信息(按需)</b>把 <span class="ui">脱敏个人信息</span> 设为 <span class="ui">开启</span>,邮箱、手机号、身份证号和银行卡号也一并脱敏。打开后,下面会列出其他各类个人信息,每类有自己的开关。</li>
|
||||
<li><b>自定义词</b>在 <span class="ui">脱敏词</span> 里填不想让厂商看到的人名、项目代号或主机名,用逗号分隔。<span class="ui">脱敏词不区分大小写</span> 打开后,<em>Nightjar</em> 也会遮掉 <em>NIGHTJAR</em>。magpie 不认识的密钥(比如你自己网关的 key)加到 <span class="ui">自定义脱敏规则</span>:填它的开头,或一个正则表达式。</li>
|
||||
<li><b>自定义词</b>在 <span class="ui">脱敏词</span> 里填不想让厂商看到的人名、项目代号或主机名,每行一个(粘贴用逗号隔开的几个词,会各占一行)。<span class="ui">脱敏词不区分大小写</span> 打开后,<em>Nightjar</em> 也会遮掉 <em>NIGHTJAR</em>。magpie 不认识的密钥(比如你自己网关的 key)加到 <span class="ui">自定义脱敏规则</span>:填它的开头,或一个正则表达式。</li>
|
||||
<li><b>试一试</b>把一段文字粘到 <span class="ui">试一试</span>,就能看到厂商实际会收到什么。粘进去的内容不会保存。</li>
|
||||
</ol>
|
||||
<p>改动从下一个请求开始生效,不用重启,Agent 那边也不用改。实际做脱敏的是内置插件 <span class="ui">隐私遮盖</span>(<code>redact</code>,在 <span class="ui">设置</span> → <span class="ui">插件</span>),只要设置里要求了任何脱敏,它就是开着的。</p>
|
||||
|
||||
Reference in New Issue
Block a user