auth login --scope 单独补授权会覆盖已有用户授权,与 lark-shared 文档「scope 会累积」不符
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- cli, documentation
Research direction
The behaviour is in the auth login --scope path of the CLI, so start from the login command and how it merges the requested scopes with the token already stored. The documented expectation is in skills/lark-shared/references/lark-shared-identity-and-permissions.md around line 65. Reproducing needs a Lark account with a broad grant, so the first useful step is to check whether the stored scope set is replaced rather than merged. Done means either login keeps existing scopes or the doc's 'accumulates' wording is corrected.
Written by the indexing model from the issue text.
Description
环境
- lark-cli 1.0.84(macOS)
- Lark 国际版,企业自建应用,用户身份已用
--domain all授权过(约 200 个 scope)
复现
lark-cli auth status --json --verify:用户身份正常,im:chat.members:read等 scope 都在,+chat-members-list --as user可用。- 某命令报缺
contact:user.employee_id:readonly,按 lark-shared 速查表「指定单个 scope 授权」执行:
lark-cli auth login --scope "contact:user.employee_id:readonly" --no-wait --json,浏览器同意后lark-cli auth login --device-code <code> --json。 - 返回
"granted": ["contact:user.employee_id:readonly", "auth:user.id:read", "offline_access"],"already_granted": []。 - 再看
auth status:scope 只剩这 3 个;+chat-members-list --as user改报missing required scope(s): im:chat.members:read。
期望
skills/lark-shared/references/lark-shared-identity-and-permissions.md 第 65 行写的是:
多次 login 的 scope 会累积(增量授权)。
期望第 2 步之后原有 scope 保留、新增 1 个。实际是整套被替换。
规避
同一次 login 里带上原范围:lark-cli auth login --domain all --scope "<缺的 scope>",授权后恢复为全部 scope(实测 201 个)。
建议
- 若「累积」是预期行为:修 CLI,login 时与已有 token 的 scope 合并;
- 若「替换」是预期行为:改文档,删掉「会累积」,并把速查表和「权限不足处理」里推荐的单独
--scope写法改成带上原范围,提醒用auth status核对。
1.0.85~1.0.98 的发布说明里没看到相关修复;升级到 1.0.98 后,lark-cli skills read lark-shared/references/lark-shared-identity-and-permissions.md 第 65 行仍是「会累积」。覆盖行为本身只在 1.0.84 上观察到,没在 1.0.98 上重复。
- Dominant language
- Go
- Stars
- 18.2k
- Forks
- 1.4k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from larksuite/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
domain/im
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug domain/doc
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
mail: all-ASCII draft bodies are hard-wrapped every 998 bytes, inserting newlines inside words and tagsPossibly taken @linye157 claimed this 26 days ago. Opendomain/mail
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
auth: a 429 from the Token Endpoint during refresh deletes a still-valid loginPossibly taken @linye157 claimed this 26 days ago. Openbug domain/auth domain/im
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
larksuite/cli#2869 · 5 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
github/github-mcp-server#3960 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
JuliusBrussee/caveman#1594 ·
Maintainers usually reply within 1 day
-
C-bug O-community X-blathers-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
cockroachdb/cockroach#176264 · 1 comment ·
-
security trivy
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
kubefleet-dev/kubefleet#1068 ·
Maintainers usually reply within 3 days