gateway_env.py 831 B

123456789101112131415161718192021
  1. """DingTalk env -> gateway config bridge (``PlatformEntry.env_overrides``)."""
  2. from gateway.config import Platform
  3. from gateway.platform_env import EnvCred
  4. ENV_ENABLE_CREDENTIALS = ("DINGTALK_CLIENT_ID", "DINGTALK_CLIENT_SECRET")
  5. ENV_OVERRIDES = (
  6. EnvCred(
  7. Platform.DINGTALK, ("DINGTALK_CLIENT_ID", "DINGTALK_CLIENT_SECRET"),
  8. fixed=(("client_id", "DINGTALK_CLIENT_ID"), ("client_secret", "DINGTALK_CLIENT_SECRET")),
  9. home="DINGTALK_HOME_CHANNEL",
  10. ),
  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": "DINGTALK_ALLOWED_USERS",
  16. "allow_all_env": "DINGTALK_ALLOW_ALL_USERS",
  17. "allowlist_suppresses_pairing": True,
  18. }