Skip to content

feat(feishu): migrate Feishu trust config to first-class [feishu] section (Phase 1) #1357

Description

@chaodu-agent

Summary

Migrate Feishu adapter trust configuration from gateway env vars to a first-class [feishu] section in config.toml.

Current State

  • FEISHU_ALLOWED_USERS / FEISHU_ALLOWED_GROUPS env vars in gateway crate
  • Double-gating: gateway crate checks AND core checks (can diverge, core side fails open when list empty)
  • trusted_bot_ids needed by Receiver for is_bot (Feishu marks bots as sender_type="user")

Target State

[feishu]
allowed_users = ["ou_xxxxxxxxxxxxxxxxxxxx"]
trusted_bot_ids = ["ou_bot1", "ou_bot2"]
# allow_all_users = true  # explicit opt-in only

Tasks

  • Add [feishu] section to config schema
  • Wire Feishu trust through PlatformTrustConfigs registry
  • Migrate FEISHU_ALLOWED_USERS / FEISHU_ALLOWED_GROUPS to core config
  • trusted_bot_ids in core config (shared: Receiver reads for is_bot, Handler for admission)
  • Eliminate double-gating (gateway = L1 only, trust = core Trust Gate)
  • Deprecate gateway env vars (Phase 1 warn → Phase 2 error → Phase 3 remove)
  • Update docs and config.toml.example

Notes

  • open_id is per-app — same user has different ID in different Feishu apps (document in gotcha)
  • Feishu marks other bots as sender_type="user" — unreliable; must match against trusted_bot_ids

Refs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions