fengling-console/.planning/codebase/INTEGRATIONS.md
movingsam b8d2a93c9f docs: 添加代码库分析文档(中文)
- STACK.md - 技术栈和依赖
- INTEGRATIONS.md - 外部集成
- ARCHITECTURE.md - 架构设计
- STRUCTURE.md - 代码库结构
- CONVENTIONS.md - 编码规范
- TESTING.md - 测试模式
- CONCERNS.md - 技术债务和问题
2026-02-28 18:38:17 +08:00

87 lines
1.9 KiB
Markdown
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.

# 外部集成
**分析日期:** 2026-02-28
## APIs & 外部服务
**身份认证:**
- **OpenIddict** - OAuth 2.0 / OpenID Connect 身份提供商
- 实现:内置 OpenIddict 认证服务器
- 客户端fengling-api
- 密钥fengling-api-secret硬编码`src/Program.cs:62`
- 发行者http://localhost:5132/
**反向代理:**
- **YARP (YarpGateway)** - 反向代理网关
- 项目引用:`../../fengling-gateway/src/YarpGateway.csproj`
- 用于 API 网关和请求转发
## 数据存储
**数据库:**
- **PostgreSQL** - 主数据库
- 连接:`DefaultConnection` (PlatformDbContext)
- 连接:`GatewayConnection` (GatewayDbContext)
- ORMEntity Framework Core + Npgsql
**表结构:**
- 用户表 (ApplicationUser)
- 角色表 (ApplicationRole)
- 租户表 (Tenant)
- OAuth 客户端表
- 审计日志表 (AuditLog)
- 网关配置表
## 身份认证
**认证方案:**
- OpenIddict Validation (Bearer Token)
- JWT Bearer 认证
- ASP.NET Core Identity
**用户管理:**
- ASP.NET Core Identity
- 支持租户隔离 (TenantInfo)
## 监控与可观测性
**日志:**
- 使用 Microsoft.Extensions.Logging
- 通过 ILogger<T> 注入
- 开发环境启用敏感数据日志
**API 文档:**
- Swagger / OpenAPI
- 端点:`/swagger/v1/swagger.json`
## CI/CD & 部署
**主机:**
- Docker 容器化
- Dockerfile 位于 `src/Dockerfile`
**CI/CD 流水线:**
- Gitea Actions (`.gitea/workflows/`)
- `deploy.yml` - 部署流水线
- `docker.yml` - Docker 构建
- `build.yml` - 构建流水线
## 环境配置
**必需环境变量:**
- `ConnectionStrings:DefaultConnection` - 平台数据库连接
- `ConnectionStrings:GatewayConnection` - 网关数据库连接
**配置文件:**
- `appsettings.json` - 应用配置
- `appsettings.Development.json` - 开发配置
## Webhooks & 回调
**无外部 Webhooks**
- 当前无外部系统回调集成
---
*集成审计2026-02-28*