gateway_env.py 911 B

123456789101112131415161718192021
  1. """Email env -> gateway config bridge (``PlatformEntry.env_overrides``)."""
  2. from gateway.config import Platform
  3. from gateway.platform_env import EnvCred, home_step
  4. ENV_ENABLE_CREDENTIALS = ("EMAIL_ADDRESS", "EMAIL_PASSWORD", "EMAIL_IMAP_HOST", "EMAIL_SMTP_HOST")
  5. ENV_OVERRIDES = (
  6. EnvCred(
  7. Platform.EMAIL, ("EMAIL_ADDRESS", "EMAIL_PASSWORD", "EMAIL_IMAP_HOST", "EMAIL_SMTP_HOST"),
  8. fixed=(("address", "EMAIL_ADDRESS"), ("imap_host", "EMAIL_IMAP_HOST"), ("smtp_host", "EMAIL_SMTP_HOST")),
  9. ),
  10. home_step(Platform.EMAIL, "EMAIL_HOME_ADDRESS"),
  11. )
  12. # Authorization env names (``PlatformEntry`` fields). Core reads them from this file when the
  13. # live entry lacks them: a user plugin overriding this platform, safe mode, the plugin disabled.
  14. AUTHZ = {
  15. "allowed_users_env": "EMAIL_ALLOWED_USERS",
  16. "allow_all_env": "EMAIL_ALLOW_ALL_USERS",
  17. "allowlist_suppresses_pairing": True,
  18. }