mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-03 19:12:04 +08:00
fix(grokbuild): complete proxy and deep-link integrations (#5677)
* fix(grokbuild): complete proxy integration * fix(deeplink): preview GrokBuild configs safely * test(app): stabilize provider integration suite * fix(grokbuild): address review feedback * fix(grokbuild): resolve remaining review findings * fix(grokbuild): use native sessions and harden previews
This commit is contained in:
@@ -194,12 +194,19 @@ describe("decodeDeeplinkPayload", () => {
|
||||
describe("maskValue", () => {
|
||||
it("masks credential-shaped keys but keeps ordinary values readable", () => {
|
||||
expect(maskValue("ANTHROPIC_AUTH_TOKEN", "sk-ant-1234567890abcdef")).toBe(
|
||||
"sk-ant-1************",
|
||||
"sk-a************",
|
||||
);
|
||||
expect(maskValue("ANTHROPIC_BASE_URL", "https://example.com")).toBe(
|
||||
"https://example.com",
|
||||
);
|
||||
// 短值不脱敏,否则连"是不是空的"都看不出来
|
||||
expect(maskValue("API_KEY", "short")).toBe("short");
|
||||
expect(maskValue("API_KEY", "short")).toBe("****");
|
||||
expect(maskValue("Authorization", "Basic abcd")).not.toContain("abcd");
|
||||
expect(maskValue("Cookie", "sid=1234")).toBe("****");
|
||||
expect(maskValue("Credential", "credential-value")).not.toContain(
|
||||
"credential-value",
|
||||
);
|
||||
expect(maskValue("auth", "short")).toBe("****");
|
||||
expect(maskValue("bearer", "short")).toBe("****");
|
||||
expect(maskValue("API_KEY", "")).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user