Add debug logging for user loading, permissions processing, and token generation in LoginController.
This commit is contained in:
parent
343964eda8
commit
4267c782a7
|
|
@ -144,6 +144,7 @@ public class LoginController implements LoginApi {
|
||||||
Connection.getConnection(Databases.DEFAULT)
|
Connection.getConnection(Databases.DEFAULT)
|
||||||
.runQuery(sqlSession -> {
|
.runQuery(sqlSession -> {
|
||||||
try {
|
try {
|
||||||
|
log.debug("Loading user by uuid {}", uuid.toString());
|
||||||
Optional<PrivilegedUser> privilegedUser = sqlSession.getMapper(PrivilegedUserMapper.class)
|
Optional<PrivilegedUser> privilegedUser = sqlSession.getMapper(PrivilegedUserMapper.class)
|
||||||
.getUserByUuid(uuid.toString());
|
.getUserByUuid(uuid.toString());
|
||||||
|
|
||||||
|
|
@ -158,10 +159,13 @@ public class LoginController implements LoginApi {
|
||||||
privilegedUser.ifPresent(user -> user.getPermissions().forEach(permission -> {
|
privilegedUser.ifPresent(user -> user.getPermissions().forEach(permission -> {
|
||||||
try {
|
try {
|
||||||
claimList.add(PermissionClaimDto.valueOf(permission));
|
claimList.add(PermissionClaimDto.valueOf(permission));
|
||||||
|
log.debug("Added permission claim {}", permission);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
log.warn("Received invalid permission claim: {}", permission);
|
log.warn("Received invalid permission claim: {}", permission);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
log.debug("Generated token for user {} with claims {}", uuid.toString(),
|
||||||
|
claimList.stream().map(PermissionClaimDto::getValue).toList());
|
||||||
JwtClaimsSet claims = JwtClaimsSet.builder()
|
JwtClaimsSet claims = JwtClaimsSet.builder()
|
||||||
.issuer(serverAddress)
|
.issuer(serverAddress)
|
||||||
.claim("authorities", claimList.stream().map(PermissionClaimDto::getValue).toList())
|
.claim("authorities", claimList.stream().map(PermissionClaimDto::getValue).toList())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user