You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fall back to profile-scoped WHATSAPP_GROUP_ALLOWED_USERS when no group allowlist key is present in PlatformConfig.extra
preserve explicit snake_case/camelCase config precedence, including an intentionally empty list
add coverage for environment fallback, explicit config precedence, and explicit-empty fail-closed behavior
Root cause
The Baileys bridge and Python adapter enforce separate inbound gates. Legacy/setup-created configurations may provide group JIDs through WHATSAPP_GROUP_ALLOWED_USERS; unlike the DM path, adapter construction only read group_allow_from / groupAllowFrom from config.extra. After a gateway restart, group_policy: allowlist could therefore start with an empty Python-side group allowlist even though the documented profile environment contained valid groups.
This mirrors the existing DM resolution contract and uses _wenv so multiplexed profiles remain isolated.
This PR and open PR #61924 change the same _group_allow_from resolution in plugins/platforms/whatsapp/adapter.py, with the same precedence — explicit config key first, then a WHATSAPP_GROUP_ALLOWED_USERS fallback.
#61924 also rewrote the DM allow_from line; that DM env fallback has since landed on main, so the overlap left between the two PRs is the group half this PR carries.
Checked against 78393b7 — the tip of fix/whatsapp-adapter-env-allowlist when this was written — and 1be70d6, main at the same moment.
Fixed on main via #115360 (merge 8925c70a1c): the adapter's group list now falls back to the profile-scoped WHATSAPP_GROUP_ALLOWED_USERS (_wenv) exactly as this PR proposed. Earlier submissions of the same fix: #37452@AhmetArif0, #61924@iborazzi. Closing as fixed on main; thanks.
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
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
WHATSAPP_GROUP_ALLOWED_USERSwhen no group allowlist key is present inPlatformConfig.extraRoot cause
The Baileys bridge and Python adapter enforce separate inbound gates. Legacy/setup-created configurations may provide group JIDs through
WHATSAPP_GROUP_ALLOWED_USERS; unlike the DM path, adapter construction only readgroup_allow_from/groupAllowFromfromconfig.extra. After a gateway restart,group_policy: allowlistcould therefore start with an empty Python-side group allowlist even though the documented profile environment contained valid groups.This mirrors the existing DM resolution contract and uses
_wenvso multiplexed profiles remain isolated.Verification
tests/gateway/test_whatsapp_group_gating.py: 13 passedtests/gateway/test_pairing_allowlist_bypass.pyDM precedence cases: 4 passedgit diff --check