feat(feishu): add global groupSenderAllowFrom for sender-level group access control#29174
Conversation
Greptile SummaryAdded global sender-level access control for Feishu group chats through new Key Changes:
Implementation Notes:
Confidence Score: 5/5
Last reviewed commit: 72ad3da |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72ad3daaae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const effectiveSenderAllowFrom = | ||
| perGroupSenderAllowFrom.length > 0 ? perGroupSenderAllowFrom : globalSenderAllowFrom; |
There was a problem hiding this comment.
Treat empty group allowFrom as explicit override
When channels.feishu.groupSenderAllowFrom is set, this fallback picks the global list whenever a group-level allowFrom is an empty array, so groups.<chat>.allowFrom: [] cannot disable sender filtering for that one group. That makes per-group precedence inconsistent and can silently block users in groups that operators intended to leave unrestricted; checking whether the group key is explicitly set (instead of length > 0) avoids this regression.
Useful? React with 👍 / 👎.
…access control Add `groupSenderAllowFrom` at the channel config level so bot owners can restrict group chat interaction to specific senders globally, without duplicating `allowFrom` in every `groups.<chat_id>` entry. Per-group `allowFrom` still takes precedence when configured. Closes openclaw#29166 Co-Authored-By: Claude Opus 4.6 <[email protected]>
72ad3da to
5616b4c
Compare
|
PR #29174 - feat(feishu): add global groupSenderAllowFrom for sender-level group access control (#29174) Merged via squash.
Thanks @1MoreBuild! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5616b4c35a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Sender-level allowlist: per-group allowFrom takes precedence, then global groupSenderAllowFrom | ||
| const perGroupSenderAllowFrom = groupConfig?.allowFrom ?? []; | ||
| const globalSenderAllowFrom = feishuCfg?.groupSenderAllowFrom ?? []; | ||
| const effectiveSenderAllowFrom = | ||
| perGroupSenderAllowFrom.length > 0 ? perGroupSenderAllowFrom : globalSenderAllowFrom; |
There was a problem hiding this comment.
Reuse global sender allowlist for command authorization
This new effectiveSenderAllowFrom gate only controls whether the message is dropped, but command authorization later in handleFeishuMessage is still computed from groupConfig?.allowFrom ?? configAllowFrom; if operators set only channels.feishu.groupSenderAllowFrom (the feature added here), allowed group senders can chat but still get CommandAuthorized=false on slash/control commands, which resolveCommandAuthorization treats as unauthorized. This creates a regression for users migrating from per-group allowFrom entries to the new global setting.
Useful? React with 👍 / 👎.
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 2a036db)
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 2a036db)
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 2a036db)
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 107be4e)
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 107be4e)
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…access control (openclaw#29174) thanks @1MoreBuild Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 107be4e)
…access control (openclaw#29174) thanks @1MoreBuild (#1464) Verified: - pnpm build - pnpm check - pnpm test:macmini (cherry picked from commit 107be4e) Co-authored-by: Haitian <[email protected]> Co-authored-by: 1MoreBuild <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
Summary
groups.<chat_id>.allowFrom, requiring duplication for every group.groupSenderAllowFromoption at the channel level. When set, it acts as a global sender allowlist for all groups. Per-groupallowFromstill takes precedence when configured.groupPolicy,groupAllowFrom, and per-groupallowFrombehavior is unchanged. No breaking changes.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
New optional config field
channels.feishu.groupSenderAllowFrom(array of open_id strings).When set, only listed senders can interact with the bot in group chats.
Per-group
groups.<chat_id>.allowFromoverrides the global setting when present.Example:
Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
groupSenderAllowFromto a list containing your open_idallowFromto a specific group — should override global setting for that groupExpected
groupSenderAllowFromfilters senders across all groupsallowFromtakes precedence when configuredActual
groupSenderAllowFromis rejected with log message; allowed sender triggers normal responseEvidence
Before (per-group only):
After (global fallback):
Human Verification (required)
groupSenderAllowFrom(no-op), wildcard"*"ingroupSenderAllowFromCompatibility / Migration
YesYes— new optional fieldgroupSenderAllowFromNoFailure Recovery (if this breaks)
groupSenderAllowFromfrom config; behavior reverts to per-group only~/.openclaw/openclaw.jsonRisks and Mitigations
allowFromsilently overrides globalgroupSenderAllowFrom, which may confuse users.