Conversation
14 tasks
luoqiz
force-pushed
the
feat-refresh-token
branch
2 times, most recently
from
September 9, 2026 05:41
949bbb4 to
3763ec7
Compare
Charles7c
reviewed
Sep 9, 2026
luoqiz
force-pushed
the
feat-refresh-token
branch
from
September 9, 2026 23:10
8e3adc1 to
a40fe6a
Compare
Member
|
/continew-code-review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更类型
破坏性变更
变更目的
为管理端 Web、App 与小程序提供可轮换的 Refresh Token 登录态,缩短 Access Token 生命周期,并支持安全地恢复过期 Access Token 对应的登录会话。
暂无关联 Issue。
解决方案
continew-auth-refresh模块,集中管理 Refresh Token 签发、轮换、重放保护、会话查询与失效。测试情况
mvn -pl continew-auth-refresh,continew-system,continew-plugin/continew-plugin-tenant,continew-server -am test;格式、编译及认证模块测试通过。Changelog
提交前确认
./mvnw verify四道门禁全部通过(完整上下文验证依赖本机 MySQL/Redis)Assisted-by: <智能体>标记评审修复
UserServiceImpl.updatePassword(String, String, Long)的用户策略锁参数解析,解析器现在遍历全部参数,并补充了该签名的单元测试。ACCESS:*Redis 索引:Access Token 的签名sid与 Refresh Session 记录共同完成会话校验,减少每个已认证请求一次 Redis 往返。X-Forwarded-For。会话限流窗口独立配置。-1操作人。ACCESS_TOKEN_JWT_SECRET与REFRESH_TOKEN_SECRET,并拒绝开发默认密钥。破坏性变更与迁移
accessToken,客户端不得再读取旧token字段。sessionId为目标;登出/刷新统一由/auth/logout、/auth/refresh提供。sid;部署升级后,旧会话将被拒绝并要求重新登录。发布协调与部署
必须与 continew-admin-ui#89 同时合并并同步发布。生产部署需配置两个认证密钥;若经反向代理传递真实客户端地址,需显式配置可信代理地址和跳数。
反向代理与真实客户端 IP(影响限流正确性)
刷新接口的限流默认使用 TCP 连接对端地址,不信任任何
X-Forwarded-For:auth.refresh-token.trusted-proxy-hops默认0、trusted-proxy-addresses默认为空 → 后端完全不解析 XFF,天然免疫伪造。ip-rate-limit默认 60 次/分钟将变成全站共享),必然大面积误伤:白名单取值可在后端容器内查看实际来源地址(
docker network inspect <网络名>),或临时打印request.getRemoteAddr()确认。本 PR 同时把
docker/nginx/conf/nginx.conf的 XFF 由$proxy_add_x_forwarded_for(追加)改为$remote_addr(覆盖),即在入口丢弃客户端自带的 XFF 头。原因:后端按「从右往左数hops个条目」解析,若hops配置错误——hops正确hops误配(多填)$proxy_add_x_forwarded_for(追加)$remote_addr(覆盖,本 PR 后)即覆盖语义下配置错误是 fail-safe 的,追加语义则会变成可绕过的防护缺口。