fix(base): clarify 91403 permission guidance - #1825
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR registers error code 91403 in the internal error classification registry as an Authorization/PermissionDenied category, and updates Base API error handling to attach a default "Base permission denied" hint when no hint is extracted for that code. Unit tests cover both the registry lookup and the error handling path. ChangesBase permission-denied error 91403
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
背景
Base/Bitable 返回
91403 Forbidden时,CLI 之前会落到api/unknown,缺少可执行恢复步骤。用户遇到扫码登录后仍然 91403 时,很难区分是身份仍在 bot/app 模式、用户授权 scope 不完整,还是 Base 文档协作者 / 应用权限未授予。Fixes #1778
核心改动
91403增加authorization/permission_denied分类。91403增加具体 hint:lark-cli auth login --domain all授权;lark-cli config default-as user;lark-cli auth status --json --verify核对授权;base:app应用权限发布状态。验证
GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go test ./shortcuts/base ./internal/errclass -count=1:通过GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go build -o ./lark-cli .:通过git diff --check:通过gofmt -l shortcuts/base/base_errors.go shortcuts/base/base_errors_test.go internal/errclass/codemeta_base.go internal/errclass/codemeta_test.go:通过,无输出rg -n '^(<<<<<<< .+|=======$|>>>>>>> .+)$' --glob '!vendor/**' --glob '!node_modules/**' .:通过,无冲突标记风险与回滚
风险较低。改动只影响 Base
91403错误分类和提示,不改变请求参数、认证流程或 API 调用。回滚本提交即可恢复原行为。Summary by CodeRabbit
New Features
Bug Fixes
91403when no API hint is provided.Tests