woofyzhao commented on code in PR #4955:
URL: https://github.com/apache/inlong/pull/4955#discussion_r917686303


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/UserServiceImpl.java:
##########
@@ -78,18 +78,20 @@ public UserInfo getById(Integer userId) {
         result.setValidDays(DateUtils.getValidDays(entity.getCreateTime(), 
entity.getDueDate()));
         result.setType(entity.getAccountType());
 
-        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());
-            log.error(errMsg, e);
-            throw new BusinessException(errMsg);
+        if (entity.getSecretKey() != null && entity.getPublicKey() != null) {

Review Comment:
   Moved to a new pr.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to