Skip to content

Add authProxy support to chat completions#6949

Open
FinleyGe wants to merge 4 commits into
labring:mainfrom
FinleyGe:codex/chatcompletions-username
Open

Add authProxy support to chat completions#6949
FinleyGe wants to merge 4 commits into
labring:mainfrom
FinleyGe:codex/chatcompletions-username

Conversation

@FinleyGe
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 13.96% 1140 / 8161
🔵 Statements 13.95% 1195 / 8564
🔵 Functions 12.47% 245 / 1964
🔵 Branches 11.93% 536 / 4490
File CoverageNo changed files found.
Generated in workflow #489 for commit 9a3d604 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Docs Preview Deployed!

🔗 👀 Click here to visit preview

ghcr.io/labring/fastgpt-docs-pr:9a3d60417d20111a27369bd57d6ac61fa0a9d37c

🕒 Time: 2026-05-28 17:34:42 (UTC+8)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Build Successful - Preview mcp_server Image for this PR:

ghcr.io/labring/fastgpt-pr:mcp_server_8099b8ddde73a0b82694f4a69746fc64824e929b

🕒 Time: 2026-05-25 10:41:01 (UTC+8)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_9a3d60417d20111a27369bd57d6ac61fa0a9d37c

🕒 Time: 2026-05-28 17:41:55 (UTC+8)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Build Successful - Preview code-sandbox Image for this PR:

ghcr.io/labring/fastgpt-pr:code-sandbox_8099b8ddde73a0b82694f4a69746fc64824e929b

🕒 Time: 2026-05-25 10:40:08 (UTC+8)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_9a3d60417d20111a27369bd57d6ac61fa0a9d37c

🕒 Time: 2026-05-28 17:29:43 (UTC+8)

@FinleyGe FinleyGe force-pushed the codex/chatcompletions-username branch from 6e1f187 to 8099b8d Compare May 25, 2026 02:29
@c121914yu c121914yu force-pushed the codex/chatcompletions-username branch from 8099b8d to 0fe34f0 Compare May 27, 2026 05:33
Copy link
Copy Markdown
Collaborator

@c121914yu c121914yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码审查结论:核心 authProxy 鉴权链路和 Agent 知识库 authTmbId 贯通整体合理。下面有一个建议级问题,主要影响继承权限资源的私有/公开展示判定,建议合并前修正。

return {
Per: getPer(String(app.parentId)).addRole(getPer(String(app._id)).role),
privateApp: getClbCount(String(app.parentId)) <= 1
privateApp:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里建议调整 privateApp 的计算方式。当前把父资源和子资源的 permission 记录直接相加;在继承权限场景下,父文件夹有 owner 记录,子 app 自身也有同一个 owner 记录,即使只有 owner 一个人也会被数成 2,导致私有资源被误判为公开。建议按 collaborator 身份去重后判断,或显式判断是否存在 owner 以外的协作者。

return {
Per: getPer(String(dataset.parentId)).addRole(getPer(String(dataset._id)).role),
privateDataset: getClbCount(String(dataset.parentId)) <= 1
privateDataset:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里和 app/list.ts 有同类问题:父资源 + 子资源的 permission 记录直接计数,会让继承权限且只有同一个 owner 的 dataset 被误判为非私有。建议按 collaborator 身份去重,或只要不存在 owner 以外的协作者就保持 privateDataset=true。

@c121914yu c121914yu force-pushed the codex/chatcompletions-username branch from 84bf3e7 to 4c3b2f9 Compare May 28, 2026 07:05
@c121914yu c121914yu force-pushed the codex/chatcompletions-username branch from 4c3b2f9 to 9a3d604 Compare May 28, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants