You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/10/26 08:08:13 UTC

[GitHub] [submarine] charlie0220 opened a new pull request #440: SUBMARINE-657. The problem of creating a new user

charlie0220 opened a new pull request #440:
URL: https://github.com/apache/submarine/pull/440


   ### What is this PR for?
   1. Correct the bug while creating an user without entering birthday.
   Now if users don't enter the birthday, the default birthday will be January 1, 2000.
   
   2. Add md5 encryption for the password while creating new user.
   
   
   ### What type of PR is it?
   [Bug Fix]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   [SUBMARINE-657](https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-657?filter=allopenissues)
   
   
   ### How should this be tested?
   [Travis-CI](https://travis-ci.com/github/charlie0220/submarine/builds/191841139)
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


----------------------------------------------------------------
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.

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



[GitHub] [submarine] charlie0220 commented on a change in pull request #440: SUBMARINE-657. The problem of creating a new user

Posted by GitBox <gi...@apache.org>.
charlie0220 commented on a change in pull request #440:
URL: https://github.com/apache/submarine/pull/440#discussion_r512651823



##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
##########
@@ -153,6 +153,8 @@ export class UserDrawerComponent implements OnInit, OnChanges {
 
           if (formData.birthday) {
             formData.birthday = format(formData.birthday, 'yyyy-MM-dd HH:mm:ss');
+          } else {
+            formData.birthday = format(new Date(2000,0O0,0O1),'yyyy-MM-dd HH:mm:ss');

Review comment:
       I have updated this file. Now if user do not enter the birthday, the value stored into database will be null.
   




----------------------------------------------------------------
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.

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



[GitHub] [submarine] pingsutw commented on a change in pull request #440: SUBMARINE-657. The problem of creating a new user

Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #440:
URL: https://github.com/apache/submarine/pull/440#discussion_r511781277



##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
##########
@@ -153,6 +153,8 @@ export class UserDrawerComponent implements OnInit, OnChanges {
 
           if (formData.birthday) {
             formData.birthday = format(formData.birthday, 'yyyy-MM-dd HH:mm:ss');
+          }else{

Review comment:
       ```suggestion
             } else {
   ```




----------------------------------------------------------------
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.

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



[GitHub] [submarine] xunliu commented on a change in pull request #440: SUBMARINE-657. The problem of creating a new user

Posted by GitBox <gi...@apache.org>.
xunliu commented on a change in pull request #440:
URL: https://github.com/apache/submarine/pull/440#discussion_r513120408



##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
##########
@@ -153,6 +153,8 @@ export class UserDrawerComponent implements OnInit, OnChanges {
 
           if (formData.birthday) {
             formData.birthday = format(formData.birthday, 'yyyy-MM-dd HH:mm:ss');
+          } else {
+            formData.birthday = format(new Date(2000,0O0,0O1),'yyyy-MM-dd HH:mm:ss');

Review comment:
       Okay, What we should do is to encrypt the password in the database.




----------------------------------------------------------------
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.

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



[GitHub] [submarine] xunliu commented on a change in pull request #440: SUBMARINE-657. The problem of creating a new user

Posted by GitBox <gi...@apache.org>.
xunliu commented on a change in pull request #440:
URL: https://github.com/apache/submarine/pull/440#discussion_r514212826



##########
File path: submarine-workbench/workbench-web/src/app/services/user.service.ts
##########
@@ -96,6 +96,7 @@ export class UserService {
 
   createUser(sysUser: Partial<SysUser>): Observable<SysUser> {
     const apiUrl = this.baseApi.getRestApi('/sys/user/add');
+    sysUser['password'] = md5(sysUser.password);

Review comment:
       @charlie0220 When creating a user, you need to encrypt the user's password.
   When the user logs in, the user’s password needs to be encrypted, and then corrected with the encrypted password in the database.




----------------------------------------------------------------
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.

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



[GitHub] [submarine] charlie0220 commented on a change in pull request #440: SUBMARINE-657. The problem of creating a new user

Posted by GitBox <gi...@apache.org>.
charlie0220 commented on a change in pull request #440:
URL: https://github.com/apache/submarine/pull/440#discussion_r512409687



##########
File path: submarine-workbench/workbench-web/src/app/services/user.service.ts
##########
@@ -96,6 +96,7 @@ export class UserService {
 
   createUser(sysUser: Partial<SysUser>): Observable<SysUser> {
     const apiUrl = this.baseApi.getRestApi('/sys/user/add');
+    sysUser['password'] = md5(sysUser.password);

Review comment:
       It seems like the password is not encrypted while creating a new user.
   ![password](https://user-images.githubusercontent.com/50860453/97256954-691e2b80-184f-11eb-9803-72809330de15.png)
   




----------------------------------------------------------------
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.

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



[GitHub] [submarine] xunliu commented on a change in pull request #440: SUBMARINE-657. The problem of creating a new user

Posted by GitBox <gi...@apache.org>.
xunliu commented on a change in pull request #440:
URL: https://github.com/apache/submarine/pull/440#discussion_r512026045



##########
File path: submarine-workbench/workbench-web/src/app/services/user.service.ts
##########
@@ -96,6 +96,7 @@ export class UserService {
 
   createUser(sysUser: Partial<SysUser>): Observable<SysUser> {
     const apiUrl = this.baseApi.getRestApi('/sys/user/add');
+    sysUser['password'] = md5(sysUser.password);

Review comment:
       The user password stored in the database is already encrypted.

##########
File path: submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
##########
@@ -153,6 +153,8 @@ export class UserDrawerComponent implements OnInit, OnChanges {
 
           if (formData.birthday) {
             formData.birthday = format(formData.birthday, 'yyyy-MM-dd HH:mm:ss');
+          } else {
+            formData.birthday = format(new Date(2000,0O0,0O1),'yyyy-MM-dd HH:mm:ss');

Review comment:
       What time is `Date(2000,0O0,0O1)`?




----------------------------------------------------------------
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.

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