gateway_env.py 935 B

1234567891011121314151617181920212223
  1. """Mattermost 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 = ("MATTERMOST_TOKEN",)
  5. ENV_OVERRIDES = (
  6. EnvCred(
  7. Platform.MATTERMOST, ("MATTERMOST_TOKEN",), token="MATTERMOST_TOKEN",
  8. warn_missing=("MATTERMOST_URL", "MATTERMOST_TOKEN set but MATTERMOST_URL is missing"),
  9. fixed=(("url", "MATTERMOST_URL"),),
  10. ),
  11. home_step(Platform.MATTERMOST, "MATTERMOST_HOME_CHANNEL"),
  12. )
  13. # Authorization env names (``PlatformEntry`` fields). Core reads them from this file when the
  14. # live entry lacks them: a user plugin overriding this platform, safe mode, the plugin disabled.
  15. AUTHZ = {
  16. "allowed_users_env": "MATTERMOST_ALLOWED_USERS",
  17. "allow_all_env": "MATTERMOST_ALLOW_ALL_USERS",
  18. "allow_bots_env": "MATTERMOST_ALLOW_BOTS",
  19. "allowlist_suppresses_pairing": True,
  20. }