53 lines
2.0 KiB
Python
53 lines
2.0 KiB
Python
|
|
"""Microsoft 365 厂商集成元数据。
|
|||
|
|
|
|||
|
|
定义 ``IntegrationMetadata(key="microsoft365", ...)``,由 ``__init__.py`` 自注册到
|
|||
|
|
``IntegrationRegistry``。元数据为内存态,不持久化到数据库。
|
|||
|
|
|
|||
|
|
``connection_extra_schema`` 声明 ``cloud`` 与 ``api_version`` 两个连接配置额外字段:
|
|||
|
|
- ``cloud``:影响 Graph 与 Login Endpoint(见 ``cloud_endpoints.py``)。
|
|||
|
|
- ``api_version``:Graph API 版本,默认 ``v1.0``。
|
|||
|
|
"""
|
|||
|
|
|
|||
|
|
from __future__ import annotations
|
|||
|
|
|
|||
|
|
from yuxi.external_systems.integrations.schemas import IntegrationMetadata
|
|||
|
|
|
|||
|
|
MICROSOFT365_METADATA = IntegrationMetadata(
|
|||
|
|
key="microsoft365",
|
|||
|
|
display_name="Microsoft 365",
|
|||
|
|
description="Microsoft Graph 邮件/日历/OneDrive/用户目录/Teams 集成",
|
|||
|
|
adapter_type="http",
|
|||
|
|
source_types=["microsoft365"],
|
|||
|
|
supported_auth_types=[
|
|||
|
|
"microsoft365_client_credentials",
|
|||
|
|
"microsoft365_authorization_code",
|
|||
|
|
],
|
|||
|
|
tags=["协作", "文档", "邮件", "日历", "Teams", "P0", "P2"],
|
|||
|
|
icon="microsoft365",
|
|||
|
|
docs_url="https://learn.microsoft.com/en-us/graph/overview",
|
|||
|
|
connection_extra_schema={
|
|||
|
|
"type": "object",
|
|||
|
|
"properties": {
|
|||
|
|
"cloud": {
|
|||
|
|
"type": "string",
|
|||
|
|
"enum": ["global", "china", "usgov", "dod"],
|
|||
|
|
"default": "global",
|
|||
|
|
"description": "Microsoft 365 云域,影响 Graph 与 Login Endpoint",
|
|||
|
|
},
|
|||
|
|
"api_version": {"type": "string", "default": "v1.0"},
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
example_config={
|
|||
|
|
"cloud": "global",
|
|||
|
|
"api_version": "v1.0",
|
|||
|
|
"base_url": "https://graph.microsoft.com",
|
|||
|
|
},
|
|||
|
|
dependency_note=(
|
|||
|
|
"需在 Entra ID 注册应用并完成管理员同意;"
|
|||
|
|
"client_secret 加密存储;"
|
|||
|
|
"client_credentials 模式需管理员同意 Application 权限;"
|
|||
|
|
"authorization_code 模式需前端完成 PKCE 授权码交换后回填 refresh_token;"
|
|||
|
|
"Teams 资源需额外授予 ChannelMessage.Read.All / OnlineMeetings.ReadWrite.All 等权限"
|
|||
|
|
),
|
|||
|
|
)
|