feat: add owner_open_id config and auto-grant permission after doc creation#76
Open
ilittle7 wants to merge 1 commit intoriba2534:mainfrom
Open
feat: add owner_open_id config and auto-grant permission after doc creation#76ilittle7 wants to merge 1 commit intoriba2534:mainfrom
ilittle7 wants to merge 1 commit intoriba2534:mainfrom
Conversation
…eation Add `owner_open_id` config field as an alternative to `owner_email` for granting document permissions. This solves the issue where personal Feishu accounts without enterprise email cannot use email-based permission APIs. Changes: - Add `owner_open_id` config field (priority over `owner_email`) - Add `Config.GetOwner()` method returning (memberType, memberID) - Auto-grant full_access permission after doc/bitable/folder/file creation - Auto-transfer ownership when `transfer_ownership: true` - Add env var support: `FEISHU_OWNER_OPEN_ID` - Add tests for new config field and GetOwner priority logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
owner_open_idconfig field as an alternative toowner_emailfor granting document permissions after creationowner_open_idtakes priority overowner_emailwhen both are configuredfull_accesspermission afterdoc create,bitable create,file mkdir,file copy, anddoc import-filetransfer_ownership: trueis setMotivation
Personal Feishu accounts that registered with a phone number (without enterprise email) cannot use email-based permission APIs — the API returns
Invalid parameter(code 1063001). Usingopenidas the member type works for all accounts.Config
Changes
internal/config/config.goOwnerOpenIDfield,GetOwner()method, env binding, default templateinternal/config/config_test.goGetOwner()priority logiccmd/owner_grant.gograntOwnerPermission()helper functioncmd/create_document.gograntOwnerPermissionafter doc createcmd/bitable_create.gograntOwnerPermissionafter bitable createcmd/import_file.gograntOwnerPermissionafter file importcmd/copy_file.gograntOwnerPermissionafter file copycmd/create_folder.gograntOwnerPermissionafter folder createcmd/config_get.goowner_open_idto help textTest plan
go test ./...)OwnerOpenIDfrom env varOwnerOpenIDfrom config fileGetOwner()priority (open_id > email > none)owner_open_idconfigured🤖 Generated with Claude Code