File tree 6 files changed +25
-16
lines changed
cloud/oauth-server/src/main/kotlin/pers/acp/admin/oauth
6 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ import javax.validation.constraints.NotNull
30
30
@Validated
31
31
@RestController
32
32
@RequestMapping(OauthApi .basePath)
33
- @Api(tags = [" 登录信息 " ])
34
- class LoginController @Autowired
33
+ @Api(tags = [" 认证信息 " ])
34
+ class TokenController @Autowired
35
35
constructor (
36
36
private val logAdapter: LogAdapter ,
37
37
private val applicationDomain: ApplicationDomain ,
@@ -62,7 +62,10 @@ constructor(
62
62
OnlineInfoVo (
63
63
appId = it.id,
64
64
appName = it.appName,
65
- count = securityTokenService.getTokensByAppId(it.id).size.toLong()
65
+ count = securityTokenService.getTokensByAppId(it.id)
66
+ .filter { token ->
67
+ ! token.isExpired
68
+ }.size.toLong()
66
69
)
67
70
)
68
71
}
@@ -95,7 +98,9 @@ constructor(
95
98
count = securityTokenService.getTokensByAppIdAndLoginNo(
96
99
item.id,
97
100
userInfo.loginNo
98
- ).size.toLong()
101
+ ).filter { token ->
102
+ ! token.isExpired
103
+ }.size.toLong()
99
104
)
100
105
)
101
106
}
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ import springfox.documentation.annotations.ApiIgnore
30
30
@Validated
31
31
@RestController
32
32
@RequestMapping(CommonPath .innerBasePath)
33
- @Api(tags = [" 权限信息 (内部接口)" ])
34
- class InnerAuthController @Autowired
33
+ @Api(tags = [" 认证信息 (内部接口)" ])
34
+ class InnerTokenController @Autowired
35
35
constructor (
36
36
logAdapter: LogAdapter ,
37
37
private val securityTokenService: SecurityTokenService ,
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ import pers.acp.admin.oauth.domain.ModuleFuncDomain
23
23
@Validated
24
24
@RestController
25
25
@RequestMapping(CommonPath .openInnerBasePath)
26
- @Api(tags = [" 权限信息 (内部开放接口)" ])
27
- class OpenInnerAuthController @Autowired
26
+ @Api(tags = [" 认证信息 (内部开放接口)" ])
27
+ class OpenInnerTokenController @Autowired
28
28
constructor (
29
29
logAdapter: LogAdapter ,
30
30
private val checkTokenEndpoint: CheckTokenEndpoint ,
Original file line number Diff line number Diff line change @@ -2,16 +2,12 @@ package pers.acp.admin.oauth.token
2
2
3
3
import org.springframework.security.authentication.AbstractAuthenticationToken
4
4
import org.springframework.security.core.GrantedAuthority
5
- import org.springframework.security.core.SpringSecurityCoreVersion
5
+ import java.io.Serializable
6
6
7
- class UserPasswordAuthenticationToken : AbstractAuthenticationToken {
7
+ class UserPasswordAuthenticationToken : Serializable , AbstractAuthenticationToken {
8
8
private var principal: Any? = null
9
9
private var credentials: Any? = null
10
10
11
- companion object {
12
- private const val serialVersionUID = SpringSecurityCoreVersion .SERIAL_VERSION_UID
13
- }
14
-
15
11
constructor (principal: Any? , credentials: Any? ) : super (null ) {
16
12
this .principal = principal
17
13
this .credentials = credentials
@@ -30,4 +26,8 @@ class UserPasswordAuthenticationToken : AbstractAuthenticationToken {
30
26
super .eraseCredentials()
31
27
credentials = null
32
28
}
29
+
30
+ companion object {
31
+ private const val serialVersionUID: Long = - 8266012108197485218L
32
+ }
33
33
}
Original file line number Diff line number Diff line change 3
3
##### release
4
4
5
5
- Global
6
- [ Upgrade] 优化中间件脚本[ docker-compose-base.yaml] ( ../dockerfiles/docker-compose-base.yaml )
6
+ - [ Upgrade] 优化中间件脚本[ docker-compose-base.yaml] ( ../dockerfiles/docker-compose-base.yaml )
7
+ - oauth-server
8
+ - [ Upgrade] 优化 UserPasswordAuthenticationToken 序列化
9
+ - [ Upgrade] token查询过滤过期的token
10
+ - [ Upgrade] 调整token相关controller名称
7
11
8
12
##### v5.1.3
9
13
Original file line number Diff line number Diff line change 1
- gradleVersion =7.2
1
+ gradleVersion =7.4
2
2
group =pers.acp
3
3
version =5.1.3
4
4
encoding =UTF-8
You can’t perform that action at this time.
0 commit comments