feat(admission): add group VPN exceptions
This commit is contained in:
@@ -50,6 +50,14 @@ describe("ProxyCheck.io intelligence", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("treats missing or malformed proxy signals as unknown", async () => {
|
||||
for (const proxy of [undefined, null, "maybe"] as const) {
|
||||
const request = vi.fn<typeof fetch>().mockResolvedValue(response({ proxy, type: "Residential" }));
|
||||
await expect(new ProxyCheckProvider({ apiKey: "secret", request }).classify(ipAddress))
|
||||
.resolves.toMatchObject({ classification: "unknown", network: { proxy: null } });
|
||||
}
|
||||
});
|
||||
|
||||
it("maps VPN and Tor responses to explicit classifications", async () => {
|
||||
const vpnRequest = vi.fn<typeof fetch>().mockResolvedValue(response({ proxy: "yes", type: "VPN" }));
|
||||
const torRequest = vi.fn<typeof fetch>().mockResolvedValue(response({ proxy: "yes", type: "TOR" }));
|
||||
|
||||
Reference in New Issue
Block a user