[Bug] lark-drive 关闭 Wiki 链接分享时,v1 PATCH 返回成功但权限未生效

Open
#2,923 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
api

Research direction

Start with the skill guide skills/lark-drive/references/lark-drive-workflow-permission-governance.md around lines 100-110, which holds the v1 PATCH steps the issue says are wrong. Reproduce by running drive permission.public patch with --dry-run, then compare the v1 and v2 GET readbacks against a test Wiki node. Done means the guide and any CLI write path confirm closed through the v2 PATCH, with the same node read back as closed.

Written by the indexing model from the issue text.

Description

bug domain/core domain/doc domain/wiki

问题

在 lark-cli 1.0.100 中,官方 lark-drive 权限治理指引使用 drive permission.public patch 修改公开权限,并用 drive +permission-get-setting 验证。--dry-run 显示写入是 PATCH /open-apis/drive/v1/permissions/:token/public,回读是 GET /open-apis/drive/v2/permissions/:token/public。工作流指引

复现步骤

选一个有权限管理且链接分享为 tenant_readable 的测试 Wiki 节点。把示例中的 WIKI_NODE_TOKEN 替换为该节点的 token,并全程使用同一身份。

  1. 按指引执行 v1 写入。

    lark-cli drive permission.public patch \
      --params '{"token":"WIKI_NODE_TOKEN","type":"wiki"}' \
      --data '{"link_share_entity":"closed"}' --as user --yes
    
  2. 用相同节点 token 回读。

    lark-cli drive +permission-get-setting --token WIKI_NODE_TOKEN --type wiki --as user
    

    实际结果是 v1 PATCH 返回成功,v1 和 v2 GET 回读的 link_share_entity 仍是 tenant_readable。预期回读为 closed。

  3. 对同一个节点用相同字段调用 v2 PATCH,再重复第 2 步。

    lark-cli api PATCH /open-apis/drive/v2/permissions/WIKI_NODE_TOKEN/public \
      --params '{"type":"wiki"}' \
      --data '{"link_share_entity":"closed"}' --as user
    

    实际回读为 closed,前后对比仅 link_share_entity 变化。飞书 v2 PATCH 文档

建议

将官方 skill 中的 Wiki 链接分享写入指引切到 v2 PATCH,保留写前确认,并以同一 Wiki 节点回读 closed 作为成功判据。CLI 可补充带写前确认的 v2 写入命令。

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from larksuite/cli

All issues in larksuite/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.