Skip to content

Commit

Permalink
Merge pull request #347 from zhangbinhub/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
zhangbinhub authored Mar 9, 2022
2 parents 2c6e01b + 29a0118 commit edce84a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import javax.validation.constraints.NotNull
@Validated
@RestController
@RequestMapping(OauthApi.basePath)
@Api(tags = ["登录信息"])
class LoginController @Autowired
@Api(tags = ["认证信息"])
class TokenController @Autowired
constructor(
private val logAdapter: LogAdapter,
private val applicationDomain: ApplicationDomain,
Expand Down Expand Up @@ -62,7 +62,10 @@ constructor(
OnlineInfoVo(
appId = it.id,
appName = it.appName,
count = securityTokenService.getTokensByAppId(it.id).size.toLong()
count = securityTokenService.getTokensByAppId(it.id)
.filter { token ->
!token.isExpired
}.size.toLong()
)
)
}
Expand Down Expand Up @@ -95,7 +98,9 @@ constructor(
count = securityTokenService.getTokensByAppIdAndLoginNo(
item.id,
userInfo.loginNo
).size.toLong()
).filter { token ->
!token.isExpired
}.size.toLong()
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import springfox.documentation.annotations.ApiIgnore
@Validated
@RestController
@RequestMapping(CommonPath.innerBasePath)
@Api(tags = ["权限信息(内部接口)"])
class InnerAuthController @Autowired
@Api(tags = ["认证信息(内部接口)"])
class InnerTokenController @Autowired
constructor(
logAdapter: LogAdapter,
private val securityTokenService: SecurityTokenService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import pers.acp.admin.oauth.domain.ModuleFuncDomain
@Validated
@RestController
@RequestMapping(CommonPath.openInnerBasePath)
@Api(tags = ["权限信息(内部开放接口)"])
class OpenInnerAuthController @Autowired
@Api(tags = ["认证信息(内部开放接口)"])
class OpenInnerTokenController @Autowired
constructor(
logAdapter: LogAdapter,
private val checkTokenEndpoint: CheckTokenEndpoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ package pers.acp.admin.oauth.token

import org.springframework.security.authentication.AbstractAuthenticationToken
import org.springframework.security.core.GrantedAuthority
import org.springframework.security.core.SpringSecurityCoreVersion
import java.io.Serializable

class UserPasswordAuthenticationToken : AbstractAuthenticationToken {
class UserPasswordAuthenticationToken : Serializable, AbstractAuthenticationToken {
private var principal: Any? = null
private var credentials: Any? = null

companion object {
private const val serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID
}

constructor(principal: Any?, credentials: Any?) : super(null) {
this.principal = principal
this.credentials = credentials
Expand All @@ -30,4 +26,8 @@ class UserPasswordAuthenticationToken : AbstractAuthenticationToken {
super.eraseCredentials()
credentials = null
}

companion object {
private const val serialVersionUID: Long = -8266012108197485218L
}
}
9 changes: 9 additions & 0 deletions doc/version_history.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## 版本更新记录

##### release

- Global
- [Upgrade] 优化中间件脚本[docker-compose-base.yaml](../dockerfiles/docker-compose-base.yaml)
- oauth-server
- [Upgrade] 优化 UserPasswordAuthenticationToken 序列化
- [Upgrade] token查询过滤过期的token
- [Upgrade] 调整token相关controller名称

##### v5.1.3

- Global
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/docker-compose-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
container_name: redis-acp
restart: always
ports:
- 6379:6379
- "6379:6379"
networks:
- elk
# command: redis-server --requirepass ${pwd} --notify-keyspace-events Eglx
Expand Down Expand Up @@ -99,8 +99,8 @@ services:
networks:
- elk
ports:
- 9200:9200
- 9300:9300
- "9200:9200"
- "9300:9300"
environment:
- TZ='Asia/Shanghai'
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
Expand Down
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gradleVersion=7.2
gradleVersion=7.4
group=pers.acp
version=5.1.3
encoding=UTF-8
Expand Down

0 comments on commit edce84a

Please sign in to comment.