mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
test: tighten gateway helper assertions
This commit is contained in:
@@ -288,11 +288,9 @@ describe("gateway config methods", () => {
|
||||
expect(res.payload?.path).toBe("gateway.auth");
|
||||
expect(res.payload?.hintPath).toBe("gateway.auth");
|
||||
const tokenChild = res.payload?.children?.find((child) => child.key === "token");
|
||||
expect(tokenChild).toMatchObject({
|
||||
key: "token",
|
||||
path: "gateway.auth.token",
|
||||
hintPath: "gateway.auth.token",
|
||||
});
|
||||
expect(tokenChild?.key).toBe("token");
|
||||
expect(tokenChild?.path).toBe("gateway.auth.token");
|
||||
expect(tokenChild?.hintPath).toBe("gateway.auth.token");
|
||||
expect(res.payload?.schema?.properties).toBeUndefined();
|
||||
});
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ describe("handshake auth helpers", () => {
|
||||
browserRateLimiter,
|
||||
});
|
||||
|
||||
expect(resolved).toMatchObject({
|
||||
hasBrowserOriginHeader: true,
|
||||
enforceOriginCheckForAnyClient: true,
|
||||
rateLimitClientIp: `${BROWSER_ORIGIN_RATE_LIMIT_KEY_PREFIX}https://app.example`,
|
||||
authRateLimiter: browserRateLimiter,
|
||||
});
|
||||
expect(resolved.hasBrowserOriginHeader).toBe(true);
|
||||
expect(resolved.enforceOriginCheckForAnyClient).toBe(true);
|
||||
expect(resolved.rateLimitClientIp).toBe(
|
||||
`${BROWSER_ORIGIN_RATE_LIMIT_KEY_PREFIX}https://app.example`,
|
||||
);
|
||||
expect(resolved.authRateLimiter).toBe(browserRateLimiter);
|
||||
});
|
||||
|
||||
it("falls back to the legacy synthetic ip when the browser origin is invalid", () => {
|
||||
|
||||
Reference in New Issue
Block a user