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/25 07:24:27 UTC
[GitHub] [inlong] woofyzhao opened a new pull request, #4775: [INLONG-4774][Manager] Support auth and encryption key user config
woofyzhao opened a new pull request, #4775:
URL: https://github.com/apache/inlong/pull/4775
- See #4774
--
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
[GitHub] [inlong] woofyzhao commented on pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
woofyzhao commented on PR #4775:
URL: https://github.com/apache/inlong/pull/4775#issuecomment-1168185513
> Why use RSA encrypt data? RSA mainly is used for key exchange.
It's used to encrypt the generated aes key on public net data transfer scenario.
--
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
[GitHub] [inlong] gong commented on pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
gong commented on PR #4775:
URL: https://github.com/apache/inlong/pull/4775#issuecomment-1168167131
Why use RSA encrypt data. RSA mainly is used for key exchange.
--
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
[GitHub] [inlong] gong commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
gong commented on code in PR #4775:
URL: https://github.com/apache/inlong/pull/4775#discussion_r907985601
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/UserServiceImpl.java:
##########
@@ -92,9 +96,19 @@ public boolean create(UserInfo userInfo) {
entity.setDueDate(getOverDueDate(userInfo.getValidDays()));
entity.setCreateBy(LoginUserUtils.getLoginUserDetail().getUserName());
entity.setName(username);
- entity.setSecretKey(userInfo.getSecretKey());
- entity.setPublicKey(userInfo.getPublicKey());
- entity.setPrivateKey(userInfo.getPrivateKey());
+ 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);
+ } catch (Exception e) {
+ String errMsg = String.format("generate rsa key error: {}", e);
+ log.error(errMsg);
+ throw new BusinessException(errMsg);
Review Comment:
I suggest print full exception stack.
--
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
[GitHub] [inlong] healchow merged pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
healchow merged PR #4775:
URL: https://github.com/apache/inlong/pull/4775
--
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
[GitHub] [inlong] woofyzhao commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #4775:
URL: https://github.com/apache/inlong/pull/4775#discussion_r910577969
##########
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:
Agreed. working on it
--
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
[GitHub] [inlong] healchow commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4775:
URL: https://github.com/apache/inlong/pull/4775#discussion_r906650618
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/UserServiceImpl.java:
##########
@@ -90,6 +92,9 @@ public boolean create(UserInfo userInfo) {
entity.setDueDate(getOverDueDate(userInfo.getValidDays()));
entity.setCreateBy(LoginUserUtils.getLoginUserDetail().getUserName());
entity.setName(username);
+ entity.setSecretKey(userInfo.getSecretKey());
Review Comment:
Maybe we should generate the secret key, public key, and private key during saving user info.
--
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
[GitHub] [inlong] woofyzhao commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #4775:
URL: https://github.com/apache/inlong/pull/4775#discussion_r906673496
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/UserServiceImpl.java:
##########
@@ -90,6 +92,9 @@ public boolean create(UserInfo userInfo) {
entity.setDueDate(getOverDueDate(userInfo.getValidDays()));
entity.setCreateBy(LoginUserUtils.getLoginUserDetail().getUserName());
entity.setName(username);
+ entity.setSecretKey(userInfo.getSecretKey());
Review Comment:
only those who transfer data through public network needs it.
--
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
[GitHub] [inlong] kipshi commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [inlong] gong commented on a diff in pull request #4775: [INLONG-4774][Manager] Support auth and encryption key user config
Posted by GitBox <gi...@apache.org>.
gong commented on code in PR #4775:
URL: https://github.com/apache/inlong/pull/4775#discussion_r908003821
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/UserServiceImpl.java:
##########
@@ -105,7 +105,7 @@ public boolean create(UserInfo userInfo) {
entity.setPublicKey(publicKey);
entity.setPrivateKey(privateKey);
} catch (Exception e) {
- String errMsg = String.format("generate rsa key error: {}", e);
+ String errMsg = String.format("generate rsa key error: %s", e.getMessage());
log.error(errMsg);
Review Comment:
Maybe should be `log.error("generate rsa key error ", e)`.
--
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