Repository navigation
fix(setup): 补齐 Base 用户权限 base:app:create / bitable:app - #1506
Merged
Merged
Conversation
`botmux auth request --scope 'base:app:create'`(以及 bitable:app)在拼出授权 链接前就被本地权限清单拦成 unknown_scopes:这两项在 src/setup/lark-scopes.json 里 user、tenant 两侧都缺失,dashboard-ipc-server 与 command-handler 的 scope 门 禁于是先行拒绝。飞书对用户身份 POST /open-apis/bitable/v1/apps 返回 99991679, 候选权限正是 bitable:app / base:app:create,两项均为开放权限(不在自动驳回清单)。 按 docs/sheets/wiki 等数据类权限的既有约定,把两项同时加入 user 与 tenant 数组, 保持字母序。新增回归测试覆盖:合法 Base scope 可发起授权并绑定校验通过的调用者、 拼错的 scope 仍被 unknown_scopes 拒绝、非当前回合的合法 scope 仍返回 403 且不发起授权。 Co-Authored-By: Claude Code <[email protected]>
|
🚀 Released in v3.27.0 |
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.
问题
botmux auth request --scope 'base:app:create'(以及bitable:app)在拼出授权链接前就被本地权限清单拦成unknown_scopes:这两项在src/setup/lark-scopes.json的user、tenant两侧都缺失。lark-scope-catalog.ts静态加载该清单,dashboard-ipc-server.ts的auth-requesthandler 与command-handler.ts的/login --scope两处 scope 门禁于是先行拒绝——所以授权根本发不起来。用户身份
POST /open-apis/bitable/v1/apps返回99991679,候选权限正是bitable:app/base:app:create;两项均为开放权限,不在飞书「自动驳回」清单(test/setup-verify-permissions.test.ts的autoRejected)。飞书99991679回的候选名即权威 scope 名。改动
按
docs/sheets/wiki等数据类权限的既有约定,把两项同时加入user与tenant数组,保持字母序。纯清单数据改动,未注册为 required/critical,不会 nag 任何 bot。新增
test/lark-base-scope-authorization.test.ts(5 测):isKnownLarkUserScope,拼错(base:app:crate/bitable:apps)仍被拒;auth-requesthandler:合法 Base scope 可发起授权,并把请求 scope 与校验通过的callerOpenId绑进requestUserAuthorization;unknown_scopes且不发起授权;影响面
build会cp src/setup/lark-scopes.json dist/setup/,botmux setup批量导入该 JSON 到开放平台「权限管理」)。新增两项开放权限会一并进入 setup 导入集。当前回合 / 用户 / worker·generation 校验逻辑未改动。
验证
在最新
master(737c76b4)实际代码上实测:setup-verify-permissions+scope-optional-autofix+command-handler+ 新测:4 文件 408 测全绿;master上干净应用(ahead_by=1, behind_by=0,仅两文件)。上线后仍需真人闭环:授权链接 → wait ready → 实际 Base 创建。v3 的
99991672应用(tenant)权限未生效是另一条链路,单独跟踪。🤖 Generated with Claude Code