From 01ce87ed7a8ed47260462a228b477f4a1e1d46b0 Mon Sep 17 00:00:00 2001 From: chenxing Date: Wed, 16 Sep 2026 18:56:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(app-auth):=20Notice=20=E5=85=A5=E7=AB=99?= =?UTF-8?q?=E9=AA=8C=E7=AD=BE=E7=94=B1=E7=99=BD=E5=90=8D=E5=8D=95=E6=94=B9?= =?UTF-8?q?=E8=B5=B0=E4=B8=AD=E5=A4=AE=E5=AF=86=E9=92=A5=E9=93=BE=EF=BC=88?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E8=A1=A8=E6=A8=A1=E5=BC=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 注册,故回调验签可从注册表解析。 --- pom.xml | 9 +++++++-- src/main/resources/application.yml | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 096ee35..d945928 100644 --- a/pom.xml +++ b/pom.xml @@ -135,8 +135,13 @@ 3.3.2 - + + + org.springframework.boot + spring-boot-starter-data-redis + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e485ce8..fd2417c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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