fix(core): validate file sharing requests

Keep QQ share-code lookups on a bounded and predictable request path while preserving existing successful usage through plain codes and official links.

Reject unsupported inputs early, align operator-facing action documentation, and add regression coverage for valid links, malformed responses, and resource limits.
This commit is contained in:
DrSmoothl committed 2026-08-01 18:27:42 +08:00
1 parent 3c97e71650
commit 6372e1479c
5 files changed
+229 -12

No files matched your search

+5 -2
View File
@@ -2605,7 +2605,7 @@ export const actions = [
defineAction({
name: 'get_fileset_id',
summary: '从分享码/链接获取 fileset_id',
summary: '从 QQ 闪传分享码或官方分享链接获取 fileset_id',
readOnly: true,
returns: '{ fileset_id }:解析出的文件集 ID。',
returnsSchema: {
@@ -2615,7 +2615,10 @@ export const actions = [
},
required: ['fileset_id'],
},
params: { share_code: f.string({ allowEmpty: false }) },
params: {
share_code: f.string({ allowEmpty: false })
.describe('QQ 闪传分享码,或 https://qfile.qq.com/q/... 官方分享链接'),
},
run: async (p, ctx) => {
const filesetId = await ctx.bridge.apis.flashTransfer.getFilesetIdByCode(p.share_code);
return okResponse({ fileset_id: filesetId });