@Override
    public UserInfo getById(Integer userId, String currentUser) {
        Preconditions.expectNotNull(userId, "User id cannot be null");
        UserEntity entity = userMapper.selectById(userId);
        Preconditions.expectNotNull(entity, "User not exists with id " + userId);
        UserEntity curUser = userMapper.selectByName(currentUser);
        Preconditions.expectTrue(Objects.equals(TenantUserTypeEnum.TENANT_ADMIN.getCode(), curUser.getAccountType())
                || Objects.equals(entity.getName(), currentUser),
                "Current user does not have permission to get other users' info");

        UserInfo result = new UserInfo();
        result.setId(entity.getId());
        result.setName(entity.getName());
        result.setValidDays(DateUtils.getValidDays(entity.getCreateTime(), entity.getDueDate()));
        result.setAccountType(entity.getAccountType());
        result.setVersion(entity.getVersion());

        if (StringUtils.isNotBlank(entity.getSecretKey()) && StringUtils.isNotBlank(entity.getPublicKey())) {
            try {
                // decipher according to stored key version
                // note that if the version is null then the string is treated as unencrypted plain text
                Integer version = entity.getEncryptVersion();
                byte[] secretKeyBytes = AESUtils.decryptAsString(entity.getSecretKey(), version);
                byte[] publicKeyBytes = AESUtils.decryptAsString(entity.getPublicKey(), version);
                result.setSecretKey(new String(secretKeyBytes, StandardCharsets.UTF_8));
                result.setPublicKey(new String(publicKeyBytes, StandardCharsets.UTF_8));
            } catch (Exception e) {
                String errMsg = String.format("decryption error: %s", e.getMessage());
                LOGGER.error(errMsg, e);
                throw new BusinessException(errMsg);
            }
        }

        LOGGER.debug("success to get user info by id={}", userId);
        return result;
    }
locked time, the unit is minute
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/user/UserServiceImpl.java