Files
2026-08-10 12:40:47 +08:00

21 lines
1.3 KiB
Markdown
Raw Permalink 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.
# Gateway 模块指引
## 职责与边界
- 负责路由、CORS、JWT/Redis 会话校验、平台/客户访问域隔离、请求标识和 Swagger 聚合。
- 只做入口认证,不做业务编排;下游服务仍必须校验客户归属、数据范围和权限。
## 模块入口与验证
- 应用:`BaiyueGatewayApplication.java`
- Security/访问域:`config/GatewaySecurityConfig.java`、`AppScopeAuthorizationManager.java`
- 会话/CORS/请求头:`config/RedisTokenSessionWebFilter.java`、`GatewayCorsConfiguration.java`、`filter/TrustedIdentityHeaderFilter.java`、`CorrelationIdWebFilter.java`
- 路由配置:`src/main/resources/application*.yml`、`../config/nacos/{local,cn}/gateway.yml`
- 测试:`src/test/java/com/baiyue/gateway/`;`mvn -pl gateway -am test`
## 修改约束与分期
- 新增路由同步检查本地/Nacos、App Scope、CORS、公开路径和 Swagger;不得暴露内部令牌接口。
- 一期承载登录后 Admin/Client 入口;二期接入到仓/测量/计费公开路由但保持内部测量接口隔离;三期仅在 Controller、权限和公开访问域契约稳定后新增必要路由,内部 PDA、仓储和服务令牌接口继续不得经 Gateway 暴露。
- 三期先读 `../../docs/三期/三期开工门禁.md`;网关变更只服务已确认模块,不以路由提前暴露未完成能力。