incubator-seata icon indicating copy to clipboard operation
incubator-seata copied to clipboard

feature: add double token support for console and raft registry api

Open Muluo-cyan opened this issue 4 months ago • 0 comments

  • [ ] I have registered the PR changes.

Ⅰ. Describe what this PR did

  1. Console后端的鉴权方案现在改为双token方案(前端还暂不支持,现在实际效果与之前相同。
  2. Client请求raft集群信息的鉴权方案现在采用双token方案。
  3. 分离Console和Client请求raft集群信息使用的鉴权配置

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

  1. 配置raft集群信息,启动seata server的raft集群
  2. 下载seata-samples/at-samples,配置对应的raft集群,修改maven仓库的依赖为该pr版本(删除seata-samples在本地maven仓库中对seata的相关依赖,拉取代码到本地并执行 mvn clean install -DskipTests=true -P release-seata),配置便于测试的token有效时间
  3. 启动客户端
  • Client启动后,会定期与TC进行交互,观察交互时Client向TC发起的http请求的鉴权流程是否符合预期即可(首次请求会使用用户名密码请求登录接口,登录成功获取access token和refresh token,后续请求都会使用access token进行。如果Server响应Client access token即将过期时,Client下次发起请求会使用refresh token 刷新access token。如果Server响应Client access token已经过期,Client会使用refresh token重发请求。使用refresh token进行请求,鉴权成功后服务端的响应里会携带access token,refresh token过期或token鉴权失败后会重新请求登录接口获取新的access token和refresh token)
  • 打开console控制台,登录后,浏览器查看登录请求,从响应中获取access token和refresh token。使用postman模拟上述流程进行测试,观察服务端响应是否符合预期。

Muluo-cyan avatar Oct 14 '24 18:10 Muluo-cyan