Files
hermes-agent/plugins/platforms/email/gateway_env.py
Teknium 47d9efe490 feat(gateway): plugin platforms declare group-chat allowlist and pairing suppression
Two authz behaviours were hard-coded on Platform.QQBOT/TELEGRAM/... in
gateway/authz_mixin.py (_GROUP_CHAT_ENV, _ALLOWLIST_SUPPRESSES_PAIRING), so a
plugin-registered platform could not get them and removing the bundled QQ
adapter would silently drop QQ_GROUP_ALLOWED_USERS gating and change pairing.

PlatformEntry gains group_allowed_chats_env and allowlist_suppresses_pairing;
authz_mixin reads them through authz_field (live entry, else the bundled
gateway_env.AUTHZ). Every bundled platform that was in the old tables declares
them in its AUTHZ, so behaviour is unchanged.
2026-10-17 14:51:46 -07:00

22 lines
911 B
Python

"""Email env -> gateway config bridge (``PlatformEntry.env_overrides``)."""
from gateway.config import Platform
from gateway.platform_env import EnvCred, home_step
ENV_ENABLE_CREDENTIALS = ("EMAIL_ADDRESS", "EMAIL_PASSWORD", "EMAIL_IMAP_HOST", "EMAIL_SMTP_HOST")
ENV_OVERRIDES = (
EnvCred(
Platform.EMAIL, ("EMAIL_ADDRESS", "EMAIL_PASSWORD", "EMAIL_IMAP_HOST", "EMAIL_SMTP_HOST"),
fixed=(("address", "EMAIL_ADDRESS"), ("imap_host", "EMAIL_IMAP_HOST"), ("smtp_host", "EMAIL_SMTP_HOST")),
),
home_step(Platform.EMAIL, "EMAIL_HOME_ADDRESS"),
)
# Authorization env names (``PlatformEntry`` fields). Core reads them from this file when the
# live entry lacks them: a user plugin overriding this platform, safe mode, the plugin disabled.
AUTHZ = {
"allowed_users_env": "EMAIL_ALLOWED_USERS",
"allow_all_env": "EMAIL_ALLOW_ALL_USERS",
"allowlist_suppresses_pairing": True,
}