You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/06/29 06:46:51 UTC

[GitHub] [inlong] kipshi commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config

kipshi commented on code in PR #4775:
URL: https://github.com/apache/inlong/pull/4775#discussion_r909255990


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/UserServiceImpl.java:
##########
@@ -90,6 +97,19 @@ public boolean create(UserInfo userInfo) {
         entity.setDueDate(getOverDueDate(userInfo.getValidDays()));
         entity.setCreateBy(LoginUserUtils.getLoginUserDetail().getUserName());
         entity.setName(username);
+        entity.setSecretKey(RandomStringUtils.randomAlphanumeric(8));
+        try {
+            Map<String, String> keyPairs = RSAUtils.generateRSAKeyPairs();
+            String publicKey = keyPairs.get(RSAUtils.PUBLIC_KEY);
+            String privateKey = keyPairs.get(RSAUtils.PRIVATE_KEY);
+            entity.setPublicKey(publicKey);
+            entity.setPrivateKey(privateKey);

Review Comment:
   In my opinion, SecretKey should be encrypted  once again after persisted in db if possible



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org