feat(app-auth): Notice 入站验签由白名单改走中央密钥链(注册表模式)
- pom 显式引 spring-boot-starter-data-redis(yh-app-auth 的该依赖是 optional、不传递); 删掉原先"不引 redis"的注释 - application.yml:去掉 trusted-apps 白名单,改 trust-registry: true —— 共享 Redis sign:app:* 单一真源,凡在 UserBase 注册过的 appKey 自动可验,新增调用方不必再改配置+重启; 并关掉 management.health.redis.enabled(防 Redis 抖动把 /actuator/health 拉成 DOWN 503) - 配套(projman 配置,非本仓):notice 应用勾选 redis 中间件(注入 SPRING_REDIS_*)+ application-prod.yml 同步去白名单/开 trust-registry。缺任一环都会 fail-closed 到全 401 前置:UserBase 已部署 ①(密钥链落 db0,refreshAll synced=10),flow-center 生产身份 100009 已在 application_info 注册,故回调验签可从注册表解析。
This commit is contained in:
@@ -135,8 +135,13 @@
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 不引 spring-boot-starter-data-redis / cache:代码零使用,data-redis 会自动装配
|
||||
RedisHealthIndicator,连不上 redis 会把 /actuator/health 整体拉成 DOWN(503)。 -->
|
||||
<!-- 入站验签走中央密钥链(注册表模式)必须显式引 data-redis:yh-app-auth 的该依赖是
|
||||
optional、不传递。副作用是 RedisHealthIndicator 会被装配,故 yml 里关掉
|
||||
management.health.redis.enabled,防 Redis 抖动把 /actuator/health 拉成 DOWN(503)。 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -85,9 +85,13 @@ yh:
|
||||
# 提供方强制验签(两级模型 §4.1 试点 P2.1):/oapi/** 匿名 401、注册应用签名直调通过
|
||||
server:
|
||||
enforce-patterns: [/oapi/*]
|
||||
# 入站验签白名单:flow-center(回调注册探活外的 oapi 调用方 demo;无 Redis 不开 trust-registry)
|
||||
trusted-apps:
|
||||
"100019": "flow-center-dev-secret-100019"
|
||||
# 入站验签改走中央密钥链(注册表模式):共享 Redis sign:app:* 单一真源,凡在 UserBase
|
||||
# 注册过的 appKey 自动可验,不再维护白名单(原 trusted-apps 每条都要跟着 UserBase 注册表手改,
|
||||
# 且形成双份真源)。注意:Redis 不可用时验签一律 401(fail-closed,无本地兜底)。
|
||||
# 本地要跑 oapi 回调而没起 Redis 时,可临时打开下面白名单当兜底(勿提交到生产配置):
|
||||
# trusted-apps:
|
||||
# "100009": "dcc36c98299a4d36bb0ec39d42008e8c"
|
||||
trust-registry: true
|
||||
open:
|
||||
enabled: true
|
||||
base-host: http://base.yunhaixingtong.com
|
||||
@@ -103,3 +107,10 @@ yh:
|
||||
# env-config:
|
||||
# source:
|
||||
# front: '{"baseHost":"http://base.yunhaixingtong.com","ssoHost":"http://sso.yunhaixingtong.com","serviceHost":"http://localhost:8101","relayConf":{"ziyuankuHost":"https://base.bestsch.com/BschZyk","zhuanxiangHost":"https://base.bestsch.com/BschZncpd"}}'
|
||||
|
||||
# 密钥链验签依赖 Redis(sign:app:*)。关掉 Redis 健康指标:Redis 抖动不应把 /actuator/health
|
||||
# 拉成 DOWN(503),否则部署健康检查与探活会误判整机不可用(同 flow-center 口径)。
|
||||
management:
|
||||
health:
|
||||
redis:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user