惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
雷峰网
雷峰网
博客园_首页
WordPress大学
WordPress大学
博客园 - 司徒正美
爱范儿
爱范儿
博客园 - 聂微东
IT之家
IT之家
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
博客园 - Franky
V
V2EX
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: guard Google Meet API fetches · openclaw/openclaw@05...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -4,10 +4,12 @@ import {

44

parseOAuthCallbackInput,

55

waitForLocalOAuthCallback,

66

} from "openclaw/plugin-sdk/provider-auth-runtime";

7+

import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";

7889

export const GOOGLE_MEET_REDIRECT_URI = "http://localhost:8085/oauth2callback";

910

export const GOOGLE_MEET_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";

1011

export const GOOGLE_MEET_TOKEN_URL = "https://oauth2.googleapis.com/token";

12+

const GOOGLE_MEET_TOKEN_HOST = "oauth2.googleapis.com";

1113

export const GOOGLE_MEET_SCOPES = [

1214

"https://www.googleapis.com/auth/meetings.space.readonly",

1315

"https://www.googleapis.com/auth/meetings.conference.media.readonly",

@@ -43,40 +45,49 @@ export function buildGoogleMeetAuthUrl(params: {

4345

}

44464547

async function executeGoogleTokenRequest(body: URLSearchParams): Promise<GoogleMeetOAuthTokens> {

46-

const response = await fetch(GOOGLE_MEET_TOKEN_URL, {

47-

method: "POST",

48-

headers: {

49-

"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",

50-

Accept: "application/json",

48+

const { response, release } = await fetchWithSsrFGuard({

49+

url: GOOGLE_MEET_TOKEN_URL,

50+

init: {

51+

method: "POST",

52+

headers: {

53+

"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",

54+

Accept: "application/json",

55+

},

56+

body,

5157

},

52-

body,

58+

policy: { allowedHostnames: [GOOGLE_MEET_TOKEN_HOST] },

59+

auditContext: "google-meet.oauth.token",

5360

});

54-

if (!response.ok) {

55-

const detail = await response.text();

56-

throw new Error(`Google OAuth token request failed (${response.status}): ${detail}`);

57-

}

58-

const payload = (await response.json()) as {

59-

access_token?: string;

60-

expires_in?: number;

61-

refresh_token?: string;

62-

scope?: string;

63-

token_type?: string;

64-

};

65-

const accessToken = payload.access_token?.trim();

66-

if (!accessToken) {

67-

throw new Error("Google OAuth token response was missing access_token");

61+

try {

62+

if (!response.ok) {

63+

const detail = await response.text();

64+

throw new Error(`Google OAuth token request failed (${response.status}): ${detail}`);

65+

}

66+

const payload = (await response.json()) as {

67+

access_token?: string;

68+

expires_in?: number;

69+

refresh_token?: string;

70+

scope?: string;

71+

token_type?: string;

72+

};

73+

const accessToken = payload.access_token?.trim();

74+

if (!accessToken) {

75+

throw new Error("Google OAuth token response was missing access_token");

76+

}

77+

const expiresInSeconds =

78+

typeof payload.expires_in === "number" && Number.isFinite(payload.expires_in)

79+

? payload.expires_in

80+

: 3600;

81+

return {

82+

accessToken,

83+

expiresAt: Date.now() + expiresInSeconds * 1000,

84+

refreshToken: payload.refresh_token?.trim() || undefined,

85+

scope: payload.scope?.trim() || undefined,

86+

tokenType: payload.token_type?.trim() || undefined,

87+

};

88+

} finally {

89+

await release();

6890

}

69-

const expiresInSeconds =

70-

typeof payload.expires_in === "number" && Number.isFinite(payload.expires_in)

71-

? payload.expires_in

72-

: 3600;

73-

return {

74-

accessToken,

75-

expiresAt: Date.now() + expiresInSeconds * 1000,

76-

refreshToken: payload.refresh_token?.trim() || undefined,

77-

scope: payload.scope?.trim() || undefined,

78-

tokenType: payload.token_type?.trim() || undefined,

79-

};

8091

}

81928293

function tokenRequestBody(values: Record<string, string | undefined>): URLSearchParams {