gateway_env.py 1.1 KB

1234567891011121314151617181920212223242526
  1. """Feishu/Lark env -> gateway config bridge (``PlatformEntry.env_overrides``)."""
  2. from gateway.config import Platform
  3. from gateway.platform_env import EnvCred
  4. ENV_ENABLE_CREDENTIALS = ("FEISHU_APP_ID", "FEISHU_APP_SECRET")
  5. ENV_OVERRIDES = (
  6. EnvCred(
  7. Platform.FEISHU, ("FEISHU_APP_ID", "FEISHU_APP_SECRET"),
  8. fixed=(
  9. ("app_id", "FEISHU_APP_ID"), ("app_secret", "FEISHU_APP_SECRET"),
  10. ("domain", "FEISHU_DOMAIN", "feishu"), ("connection_mode", "FEISHU_CONNECTION_MODE", "websocket"),
  11. ),
  12. optional=(("encrypt_key", "FEISHU_ENCRYPT_KEY"), ("verification_token", "FEISHU_VERIFICATION_TOKEN")),
  13. home="FEISHU_HOME_CHANNEL",
  14. ),
  15. )
  16. # Authorization env names (``PlatformEntry`` fields). Core reads them from this file when the
  17. # live entry lacks them: a user plugin overriding this platform, safe mode, the plugin disabled.
  18. AUTHZ = {
  19. "allowed_users_env": "FEISHU_ALLOWED_USERS",
  20. "allow_all_env": "FEISHU_ALLOW_ALL_USERS",
  21. "allow_bots_env": "FEISHU_ALLOW_BOTS",
  22. "allowlist_suppresses_pairing": True,
  23. }