新增六边形架构核心代码包,包含: 1. 协议适配器层:HTTP/SMTP/IMAP/SSH/GRPC等多协议适配器实现 2. 认证插件体系:基础认证、API密钥、HMAC等多类型认证插件 3. 执行编排框架:工具执行器、上下文构建、运行时治理组件 4. 用例端口与DTO:定义领域服务端口与数据传输对象 5. 厂商集成包框架:支持第三方系统集成扩展 6. 基础设施装配层:实现依赖注入与服务装配 所有代码遵循六边形架构设计原则,实现端口与适配器解耦,支持动态扩展与自动发现。
51 lines
1.9 KiB
Python
51 lines
1.9 KiB
Python
"""Dynamics365 厂商集成元数据。
|
||
|
||
定义 ``IntegrationMetadata(key="dynamics365", ...)``,由 ``__init__.py`` 自注册到
|
||
``IntegrationRegistry``。元数据为内存态,不持久化到数据库。
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from yuxi.external_systems.integrations.schemas import IntegrationMetadata
|
||
|
||
DYNAMICS365_METADATA = IntegrationMetadata(
|
||
key="dynamics365",
|
||
display_name="Microsoft Dynamics 365",
|
||
description="基于 OData v4 的企业级 CRM/ERP,覆盖 Dataverse 与 Finance & Operations",
|
||
adapter_type="http",
|
||
source_types=["dynamics365"],
|
||
supported_auth_types=[
|
||
"oauth2_authorization_code", # 首期
|
||
"oauth2_client_credentials", # 首期
|
||
"oauth2_certificate", # P2 延后
|
||
"managed_identity", # P2 延后
|
||
],
|
||
tags=["crm", "erp", "microsoft", "odata"],
|
||
icon="dynamics365",
|
||
docs_url="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/overview",
|
||
connection_extra_schema={
|
||
"type": "object",
|
||
"properties": {
|
||
"product_line": {
|
||
"type": "string",
|
||
"enum": ["dataverse", "finance_operations"],
|
||
"default": "dataverse",
|
||
},
|
||
"api_version": {"type": "string", "default": "v9.2"},
|
||
"organization": {"type": "string"},
|
||
},
|
||
"required": ["product_line"],
|
||
},
|
||
example_config={
|
||
"product_line": "dataverse",
|
||
"base_url": "https://contoso.api.crm.dynamics.com/api/data/v9.2",
|
||
"api_version": "v9.2",
|
||
"organization": "contoso",
|
||
},
|
||
dependency_note=(
|
||
"需在 Microsoft Entra ID 注册应用并申请 Dynamics CRM user_impersonation 权限;"
|
||
"client_credentials 模式需在 Dataverse 中创建 Application User 并分配安全角色;"
|
||
"证书认证需上传 X.509 证书到应用注册;managed_identity 仅在 Azure 资源内可用"
|
||
),
|
||
)
|