ForcePilot/backend/test/integration/channel/conftest.py
Kris 9e503becd3
Some checks failed
Deploy VitePress site to Pages / build (push) Has been cancelled
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
feat(plugin): 实现完整的插件注册管理系统
新增了插件相关的完整领域模型、应用服务、基础设施实现,包括:
1. 插件状态、注册模式、来源等基础枚举和数据结构
2. 插件清单解析、发现、加载工具类
3. 插件注册表领域服务和内存存储实现
4. 插件相关的命令、查询、事件定义
5. 插件REST API接口和DTO映射
6. 集成了原有通道适配器到插件系统
7. 新增内置插件注册和自动发现能力
2026-05-31 16:44:13 +08:00

30 lines
887 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
Shared pytest fixtures for channel integration tests.
Channel endpoints use their own auth service (token / password) which is
separate from the main app JWT auth. When ``auth.token`` and
``auth.password`` in ``channel_config.yaml`` are both empty the channel
auth service accepts every request this is the default dev setup.
"""
from __future__ import annotations
import os
import pytest
CHANNEL_AUTH_TOKEN = os.getenv("CHANNEL_AUTH_TOKEN", "")
CHANNEL_AUTH_PASSWORD = os.getenv("CHANNEL_AUTH_PASSWORD", "")
@pytest.fixture()
def channel_auth_headers() -> dict[str, str]:
if CHANNEL_AUTH_TOKEN:
return {"Authorization": f"Bearer {CHANNEL_AUTH_TOKEN}"}
if CHANNEL_AUTH_PASSWORD:
import base64
encoded = base64.b64encode(f"mgmt:{CHANNEL_AUTH_PASSWORD}".encode()).decode()
return {"Authorization": f"Basic {encoded}"}
return {}