![]()
![]()
更新内容
特性 / 增强
-
授权服务升级为Spring Authorization Server
-
升级到jdk17
-
升级Swagger为OpenAPI3
-
升级spring-boot到3.1.6
-
升级spring-cloud到2022.0.4
-
升级spring-cloud-alibaba到2022.0.0.0
-
升级spring-boot-admin到3.1.8
-
升级mybatis-plus到3.5.4.1
-
删除txlcn-demo工程(由于txlcn不推荐使用了)
-
删除无用模块(job和transaction)
特性 / 增强
| 分支名 |
JDK |
Spring Boot |
Spring Cloud |
| master |
17 |
3.x |
2022.x |
| 5.x |
1.8 |
2.5.x |
2020.x |
| 4.x |
1.8 |
2.3.x |
2.2.x |
特旧版本升级
由旧版本升级到 v6.0.0 需要执行以下语句:
Use `oauth-center`;
alter table oauth_client_details add token_format varchar(20) not null DEFAULT 'reference' COMMENT 'token格式: reference 引用令牌(不透明), self-contained 自包含令牌(jwt))';
alter table oauth_client_details drop column support_id_token;
alter table oauth_client_details drop column id_token_validity;
UPDATE oauth_client_details set scope = 'app,openid,profile' where client_id = 'webApp';
UPDATE oauth_client_details set scope = 'all,openid,profile' where client_id = 'zlt';
内容说明
一、Spring Authorization Server
由于 Spring Security OAuth 停止维护,目前最新版本的 Spring 生态中的 OAuth2 授权服务器已替换为 Spring Authorization Server 并已可以正式生产使用;
zlt-uaa 工程已替换为 Spring Authorization Server 并基本保留原有的功能和接口。
1.1. 主要接口
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
1.2. 令牌类型配置
应用管理功能中增加了 令牌类型 的配置,默认为 引用令牌 也就是生成的 access_token 值为一串随机字符串(不透明),需要通过外部的依赖来进行鉴权,如 Redis、MySQL 之类的。
![]()
![]()
当改为 自包含令牌 后,则 access_token 的格式变更为 JWT
![]()
![]()
二、Swagger升级为OpenAPI3
已在 gateway 中做了文档聚合,输入地址 http://localhost:9900/doc.html 即可访问所有服务的文档:
![]()
![]()
代码的注解有以下变化:
三、升级Spring Boot为3.x
配置自动加载 Configuration 的方式由原来的 META-INF\spring.factories
需更改为 META-INF\spring\org.springframework.boot.autoconfigure.AutoConfiguration.imports
![]()
项目地址
Gitee 地址: https://gitee.com/zlt2000/microservices-platform
Github 地址: https://github.com/zlt2000/microservices-platform
项目文档
https://www.kancloud.cn/zlt2000/microservices-platform/919417
项目更新日志
https://www.kancloud.cn/zlt2000/microservices-platform/93623