-
Notifications
You must be signed in to change notification settings - Fork 585
feat(approval): add tenant-aware guidance when approval scope is missing #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,27 @@ metadata: | |
|
|
||
| **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md),其中包含认证、权限处理** | ||
|
|
||
| ## 审批权限不足时的租户兼容性分流 | ||
|
|
||
| 当以 **user 身份**调用审批 API 失败,且错误响应的 `permission_violations` 中包含 `approval:` 开头的 scope(如 `approval:task:read`、`approval:instance:write` 等)时,**必须先检查当前用户的 `tenant_key`** 再决定如何引导: | ||
|
|
||
| ```bash | ||
| lark-cli contact +get-user | ||
| ``` | ||
|
|
||
| 根据返回结果中 `data.user.tenant_key` 的值进行分流: | ||
|
|
||
| - **`tenant_key` 为 `736588c9260f175d`** → 直接告知用户: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The tenant key Beyond the sensitivity risk, this design is also fragile:
Consider an alternative approach: have the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the review. A few points:
|
||
| > ⚠️ 当前租户暂不支持使用审批 skill,敬请期待。 | ||
|
|
||
| 不要引导用户去开发者后台添加权限,不要建议绕过方案。 | ||
|
|
||
| - **其他 `tenant_key`** → 按 `lark-shared/SKILL.md` 中的标准权限不足处理流程引导用户添加对应 scope。 | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
|
|
||
| - **若 `lark-cli contact +get-user` 调用失败**(网络错误、缺少 `contact` 权限、返回中无 `tenant_key` 字段等)→ 按 `lark-shared/SKILL.md` 中的标准权限不足处理流程继续,不做租户分流。 | ||
|
|
||
| --- | ||
|
|
||
| ## API Resources | ||
|
|
||
| ```bash | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.