mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
* Remove Qwen OAuth integration (qwen-portal-auth) Qwen OAuth via portal.qwen.ai is being deprecated by the Qwen team due to traffic impact on their primary Qwen Code user base. Users should migrate to the officially supported Model Studio (Alibaba Cloud Coding Plan) provider instead. Ref: https://github.com/openclaw/openclaw/issues/49557 - Delete extensions/qwen-portal-auth/ plugin entirely - Remove qwen-portal from onboarding auth choices, provider aliases, auto-enable list, bundled plugin defaults, and pricing cache - Remove Qwen CLI credential sync (external-cli-sync, cli-credentials) - Remove QWEN_OAUTH_MARKER from model auth markers - Update docs/providers/qwen.md to redirect to Model Studio - Update model-providers docs (EN + zh-CN) to remove Qwen OAuth section - Regenerate config and plugin-sdk baselines - Update all affected tests Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> * Clean up residual qwen-portal references after OAuth removal * Add migration hint for deprecated qwen-portal OAuth provider * fix: finish qwen oauth removal follow-up --------- Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> Co-authored-by: Frank Yang <frank.ekn@gmail.com>
88 lines
3.3 KiB
JavaScript
88 lines
3.3 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
import ts from "typescript";
|
|
import { runCallsiteGuard } from "./lib/callsite-guard.mjs";
|
|
import {
|
|
collectCallExpressionLines,
|
|
runAsScript,
|
|
unwrapExpression,
|
|
} from "./lib/ts-guard-utils.mjs";
|
|
|
|
const sourceRoots = ["src/channels", "src/routing", "src/line", "extensions"];
|
|
|
|
// Temporary allowlist for legacy callsites. New raw fetch callsites in channel/plugin runtime
|
|
// code should be rejected and migrated to fetchWithSsrFGuard/shared channel helpers.
|
|
const allowedRawFetchCallsites = new Set([
|
|
"extensions/bluebubbles/src/types.ts:133",
|
|
"extensions/feishu/src/streaming-card.ts:31",
|
|
"extensions/feishu/src/streaming-card.ts:101",
|
|
"extensions/feishu/src/streaming-card.ts:143",
|
|
"extensions/feishu/src/streaming-card.ts:199",
|
|
"extensions/googlechat/src/api.ts:22",
|
|
"extensions/googlechat/src/api.ts:43",
|
|
"extensions/googlechat/src/api.ts:63",
|
|
"extensions/googlechat/src/api.ts:188",
|
|
"extensions/googlechat/src/auth.ts:82",
|
|
"extensions/matrix/src/directory-live.ts:41",
|
|
"extensions/matrix/src/matrix/client/config.ts:171",
|
|
"extensions/mattermost/src/mattermost/client.ts:211",
|
|
"extensions/mattermost/src/mattermost/monitor.ts:230",
|
|
"extensions/mattermost/src/mattermost/probe.ts:27",
|
|
"extensions/minimax/oauth.ts:62",
|
|
"extensions/minimax/oauth.ts:93",
|
|
"extensions/msteams/src/graph.ts:39",
|
|
"extensions/nextcloud-talk/src/room-info.ts:92",
|
|
"extensions/nextcloud-talk/src/send.ts:107",
|
|
"extensions/nextcloud-talk/src/send.ts:198",
|
|
"extensions/talk-voice/index.ts:27",
|
|
"extensions/thread-ownership/index.ts:105",
|
|
"extensions/voice-call/src/providers/plivo.ts:95",
|
|
"extensions/voice-call/src/providers/telnyx.ts:61",
|
|
"extensions/voice-call/src/providers/tts-openai.ts:111",
|
|
"extensions/voice-call/src/providers/twilio/api.ts:23",
|
|
"extensions/telegram/src/api-fetch.ts:8",
|
|
"extensions/discord/src/send.outbound.ts:363",
|
|
"extensions/discord/src/voice-message.ts:268",
|
|
"extensions/discord/src/voice-message.ts:312",
|
|
"extensions/slack/src/monitor/media.ts:55",
|
|
"extensions/slack/src/monitor/media.ts:59",
|
|
"extensions/slack/src/monitor/media.ts:73",
|
|
"extensions/slack/src/monitor/media.ts:99",
|
|
]);
|
|
|
|
function isRawFetchCall(expression) {
|
|
const callee = unwrapExpression(expression);
|
|
if (ts.isIdentifier(callee)) {
|
|
return callee.text === "fetch";
|
|
}
|
|
if (ts.isPropertyAccessExpression(callee)) {
|
|
return (
|
|
ts.isIdentifier(callee.expression) &&
|
|
callee.expression.text === "globalThis" &&
|
|
callee.name.text === "fetch"
|
|
);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
export function findRawFetchCallLines(content, fileName = "source.ts") {
|
|
const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true);
|
|
return collectCallExpressionLines(ts, sourceFile, (node) =>
|
|
isRawFetchCall(node.expression) ? node.expression : null,
|
|
);
|
|
}
|
|
|
|
export async function main() {
|
|
await runCallsiteGuard({
|
|
importMetaUrl: import.meta.url,
|
|
sourceRoots,
|
|
extraTestSuffixes: [".browser.test.ts", ".node.test.ts"],
|
|
findCallLines: findRawFetchCallLines,
|
|
allowCallsite: (callsite) => allowedRawFetchCallsites.has(callsite),
|
|
header: "Found raw fetch() usage in channel/plugin runtime sources outside allowlist:",
|
|
footer: "Use fetchWithSsrFGuard() or existing channel/plugin SDK wrappers for network calls.",
|
|
});
|
|
}
|
|
|
|
runAsScript(import.meta.url, main);
|