fix(simplex): accept display name in SIMPLEX_ALLOWED_USERS

SIMPLEX_ALLOWED_USERS silently denied every contact when operators
listed display names instead of numeric contactIds. The SimpleX UI
never surfaces the numeric id, so display names are what operators
naturally put in the env var. _is_user_authorized only compared
source.user_id (the contactId), so the allowlist never matched.

Expand check_ids to include source.user_name for the simplex platform,
mirroring the existing WhatsApp phone-LID aliasing pattern. Adds doc +
setup-prompt clarification and three regression tests.

Salvaged from PR #40393. Adds manishbyatroy to release.py AUTHOR_MAP.
This commit is contained in:
manishbyatroy 2026-06-07 04:29:48 -07:00 committed by Teknium
parent 9d72680ca3
commit 490c486ff6
5 changed files with 129 additions and 6 deletions

View file

@ -20,7 +20,11 @@ Required environment variables:
(default: ws://127.0.0.1:5225)
Optional environment variables:
SIMPLEX_ALLOWED_USERS Comma-separated contact IDs (allowlist)
SIMPLEX_ALLOWED_USERS Comma-separated allowlist. Each entry may be
either a numeric contactId (stable across
renames; visible via `/contacts` in the CLI)
or a contact display name (what the SimpleX
UI shows). Both forms are accepted.
SIMPLEX_ALLOW_ALL_USERS Set 'true' to allow all contacts
SIMPLEX_HOME_CHANNEL Default contact/group ID for cron delivery
SIMPLEX_HOME_CHANNEL_NAME Human label for the home channel
@ -706,7 +710,7 @@ def interactive_setup() -> None:
save_env_value(var, value)
_prompt("SIMPLEX_WS_URL", "Daemon WebSocket URL (default ws://127.0.0.1:5225)")
_prompt("SIMPLEX_ALLOWED_USERS", "Allowed contact IDs (comma-separated; blank=skip)")
_prompt("SIMPLEX_ALLOWED_USERS", "Allowed contactIds or display names (comma-separated; blank=skip)")
_prompt("SIMPLEX_HOME_CHANNEL", "Home channel contact/group ID (or empty)")
print("Done. Make sure the simplex-chat daemon is running before starting the gateway.")