fix(dashboard): accept Slack allow-all wildcard in allowed-users validation

The new SLACK_ALLOWED_USERS validation rejected '*', but the Slack gateway
honors '*' as an allow-all wildcard (gateway/platforms/slack.py DM auth,
slash-confirm, and approval-button paths). Accept '*' as a valid list entry
in both the API validator and the dashboard form so a value the runtime
honors is no longer blocked at setup.
This commit is contained in:
kshitijk4poor 2026-06-19 12:18:15 +05:30
parent d9190491a6
commit 83c034bd5b
3 changed files with 17 additions and 2 deletions

View file

@ -2342,10 +2342,12 @@ def _validate_messaging_env_value(platform_id: str, key: str, value: str) -> Non
)
if key == "SLACK_ALLOWED_USERS":
user_ids = [part.strip() for part in value.split(",")]
# "*" is the gateway's allow-all wildcard (see gateway/platforms/slack.py),
# so accept it as a valid entry alongside Slack member IDs (U.../W...).
invalid = [
user_id
for user_id in user_ids
if not user_id or not re.fullmatch(r"[UW][A-Z0-9]{2,}", user_id)
if user_id != "*" and (not user_id or not re.fullmatch(r"[UW][A-Z0-9]{2,}", user_id))
]
if invalid:
raise HTTPException(