test(msteams): mock oauth token network guard · openclaw/openclaw@aa95428
steipete
·
2026-04-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { createHash } from "node:crypto"; |
2 | 2 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
| 3 | + |
| 4 | +vi.mock("openclaw/plugin-sdk/ssrf-runtime", () => ({ |
| 5 | +fetchWithSsrFGuard: async (params: { |
| 6 | +url: string; |
| 7 | +init?: RequestInit; |
| 8 | +fetchImpl?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>; |
| 9 | +}) => { |
| 10 | +const fetchImpl = params.fetchImpl ?? globalThis.fetch; |
| 11 | +const response = await fetchImpl(params.url, params.init); |
| 12 | +return { |
| 13 | + response, |
| 14 | +finalUrl: params.url, |
| 15 | +release: async () => {}, |
| 16 | +}; |
| 17 | +}, |
| 18 | +})); |
| 19 | + |
3 | 20 | import { |
4 | 21 | generatePkce, |
5 | 22 | generateOAuthState, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。