Repository navigation
fix(login): 非同团队用户 /login 不再指向中心化平台授权页 - #2844
Merged
Merged
Conversation
授权来源为 auto/platform 时,裸 /login 不判断发起人与本机所有者是否同平台团队, 非同团队用户去平台授权后签发仍是 403 not_teammate。现在先用本机已有的 team-sync 花名册(与平台签发判定同源)和 machine token 里的所有者判定;确定不同团队时给出 原因和可走的路(auto:本机授权 /login lark|bytedcli;platform:说明只接受平台凭据), 判断不了时保持原卡片。平台卡标题改为「与本机所有者同团队的已绑定机器都能复用」。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 5, 2026 09:21
Owner
Author
deepcoldy
pushed a commit
that referenced
this pull request
Nov 5, 2026
…k-doc 用例 - 同步 master(含 #2844):#2844 的非同团队说明里带平台凭据页链接,同样走私聊投递。 - deliverAuthLink:私聊已送达、群里提示发送失败时仍算已送达,不再改报「没能私聊你」。 - on_auth_link 提示词与平台凭据页保持一致:设备码 / OAuth 授权链接不进群,平台凭据页可照常转发。 - 补群聊 /subscribe-lark-doc 私聊投递及失败提示用例。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 5, 2026
|
🚀 Released in v3.57.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
机器已绑定中心化平台、Bot 开了按触发人鉴权、凭据来源是
auto或platform时,裸/login(以及 platform 模式下的/login lark|bytedcli)以前一律回「在中心化平台授权(一次授权,所有绑定平台的机器通用)」卡片,不看发起人能不能用。平台签发时只放行机器所有者本人或与其同团队的成员,其他人去平台授权页授权完,这台机器取凭据仍然是 403not_teammate。卡片标题「所有绑定平台的机器通用」也不准确。这次改成:
platform-team-sync.json。平台按listTeamsForUser(owner)生成,和 credential-grant 判同团队用的是同一份成员表。platform.json里 machine token payload 中的所有者 union_id。auto:提示改用本机授权/login lark//login bytedcli,只列出受管的工具;platform:说明本 Bot 只接受平台凭据,可以请管理员改成 auto;这个判断只决定
/login显示哪段说明,不参与授权决策。签发时平台照常校验,本地判断过时最多让人多看一条说明,不会多拿或少拿凭据。machine token 不在本地验签,只读 payload,也是这个原因。影响面
/login的平台分支(src/core/command-handler.ts)和对应文案。新增src/core/platform-teammate.ts(纯函数),以及binding.ts的platformMachineOwner、platform-team-store.ts的readPlatformTeamSync(区分「没同步」和「没团队」)。/login status、/logout、绑定会话的 Bot 应用 OAuth 分支都没动。所有 CLI 和后端走同一条命令路径,不区分 CLI。验证
bun run build通过,tsc --noEmit通过。npx vitest run test/platform-teammate.test.ts test/command-handler.test.ts -t "login|platform|Teammate|Owner":54 passed。新增用例覆盖以下场景:teammate === 'not_teammate'分支改成永不命中,2 个/login用例变红;not_teammate改成unknown,3 个用例变红。dashboard-i18n*.test.ts:439 passed(中英文 key 对齐)。🤖 Generated with Claude Code