mirror of https://github.com/openclaw/openclaw.git
perf(test): fold tls fingerprint normalization into ssrf suite
This commit is contained in:
parent
7c27c2d659
commit
58ab60c0fc
|
|
@ -1,4 +1,5 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeFingerprint } from "../tls/fingerprint.js";
|
||||
import { isPrivateIpAddress } from "./ssrf.js";
|
||||
|
||||
describe("ssrf ip classification", () => {
|
||||
|
|
@ -30,3 +31,11 @@ describe("ssrf ip classification", () => {
|
|||
expect(isPrivateIpAddress("2001:db8::1")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeFingerprint", () => {
|
||||
it("strips sha256 prefixes and separators", () => {
|
||||
expect(normalizeFingerprint("sha256:AA:BB:cc")).toBe("aabbcc");
|
||||
expect(normalizeFingerprint("SHA-256 11-22-33")).toBe("112233");
|
||||
expect(normalizeFingerprint("aa:bb:cc")).toBe("aabbcc");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeFingerprint } from "./fingerprint.js";
|
||||
|
||||
describe("normalizeFingerprint", () => {
|
||||
it("strips sha256 prefixes and separators", () => {
|
||||
expect(normalizeFingerprint("sha256:AA:BB:cc")).toBe("aabbcc");
|
||||
expect(normalizeFingerprint("SHA-256 11-22-33")).toBe("112233");
|
||||
expect(normalizeFingerprint("aa:bb:cc")).toBe("aabbcc");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue