You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2022/11/03 16:34:10 UTC

[GitHub] [incubator-streampark] macksonmu opened a new pull request, #1960: [Feature] Add sensitivity option when creating variable #1958

macksonmu opened a new pull request, #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960

   <!--
   Thank you for contributing to StreamPark! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   ## Contribution Checklist
   
     - If this is your first time, please read our contributor guidelines: [Submit Code](https://streampark.apache.org/community/submit_guide/submit_code).
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/streampark/issues).
   
     - Name the pull request in the form "[Feature] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
   
     - If the PR is unfinished, add `[WIP]` in your PR title, e.g., `[WIP][Feature] Title of the pull request`.
   
   -->
   
   ## What changes were proposed in this pull request
   
   Issue Number: close #1958  <!-- REMOVE this line if no issue to close -->
   
   <!--(For example: This pull request proposed to add checkstyle plugin).-->
   
   ## Brief change log
   
   <!--*(for example:)*
   - *Add maven-checkstyle-plugin to root pom.xml*
   -->
   
   ## Verifying this change
   
   <!--*(Please pick either of the following options)*-->
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   <!--*(example:)*
   - *Added integration tests for end-to-end.*
   - *Added *Test to verify the change.*
   - *Manually verified the change by testing locally.* -->
   
   ## Does this pull request potentially affect one of the following parts
    - Dependencies (does it add or upgrade a dependency): (yes / 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.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1013506445


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -72,6 +77,11 @@ public RestResponse page(RestRequest restRequest, Variable variable) {
     @PostMapping("list")
     public RestResponse variableList(@RequestParam Long teamId, String keyword) {
         List<Variable> variableList = variableService.findByTeamId(teamId, keyword);
+        for (Variable v : variableList) {
+            if (v.getSensitive()) {
+                v.setVariableValue(v.getVariableValue().replaceAll("[\\s\\S]", "*"));

Review Comment:
   v.setVariableValue(ConfigConst.DEFAULT_DATAMASK_STRING())



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] macksonmu commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
macksonmu commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1013858948


##########
streampark-console/streampark-console-newui/src/views/system/variable/components/VariableDrawer.vue:
##########
@@ -114,6 +115,17 @@
         componentProps: { rows: 4 },
         rules: [{ max: 100, message: t('system.variable.form.descriptionMessage') }],
       },
+      {
+        field: 'sensitive',
+        label: 'Sensitive',

Review Comment:
   Is it just that the front-end Sensitive is changed to Datamask, and the database fields and the fields of the back-end classes need to be changed?



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys merged pull request #1960: [Feature] Add sensitivity option when creating variable

Posted by GitBox <gi...@apache.org>.
wolfboys merged PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960


-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] macksonmu commented on pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
macksonmu commented on PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#issuecomment-1302817340

   @wolfboys When there are problems with the update, do not merge.


-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1014079261


##########
streampark-console/streampark-console-newui/src/views/system/variable/components/VariableDrawer.vue:
##########
@@ -114,6 +115,17 @@
         componentProps: { rows: 4 },
         rules: [{ max: 100, message: t('system.variable.form.descriptionMessage') }],
       },
+      {
+        field: 'desensitization',
+        label: 'Desensitization',
+        component: 'Switch',
+        componentProps: {
+          checkedChildren: 'ON',
+          unCheckedChildren: 'OFF',
+        },
+        defaultValue: false,
+        afterItem: h('span', { class: 'conf-switch' }, 'If set to ON, the value of the variable will be displayed as ******** elsewhere.'),

Review Comment:
   Whether desensitization is required, e.g: desensitization of sensitive data such as passwords, if enable variable value will be displayed as ********



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1014610205


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -59,8 +60,13 @@ public class VariableController {
     @PostMapping("page")
     @RequiresPermissions("variable:view")
     public RestResponse page(RestRequest restRequest, Variable variable) {
-        IPage<Variable> variableList = variableService.page(variable, restRequest);
-        return RestResponse.success(variableList);
+        IPage<Variable> page = variableService.page(variable, restRequest);
+        for (Variable v : page.getRecords()) {
+            if (v.getDesensitization()) {
+                v.setVariableValue(ConfigConst.DEFAULT_DATAMASK_STRING());

Review Comment:
   I suggest to define the method in the Variable class:
   
   ```
   public void dataMasking() {
           if (desensitization) {
               String dataMask = ConfigConst.DEFAULT_DATAMASK_STRING();
               this.setVariableValue(dataMask);
           }
       }
   ```
   In this way, we just call `dataMasking` method.



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1014085454


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -102,6 +113,9 @@ public RestResponse updateVariable(@Valid Variable variable) throws Exception {
         if (!findVariable.getVariableCode().equals(variable.getVariableCode())) {
             throw new ApiAlertException("Sorry, the variable code cannot be updated.");
         }
+        if (ConfigConst.DEFAULT_DATAMASK_STRING().equals(variable.getVariableValue())) {
+            variable.setVariableValue(null);

Review Comment:
   I think it can be done without special treatment



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1013994543


##########
streampark-console/streampark-console-newui/src/views/system/variable/components/VariableDrawer.vue:
##########
@@ -114,6 +115,17 @@
         componentProps: { rows: 4 },
         rules: [{ max: 100, message: t('system.variable.form.descriptionMessage') }],
       },
+      {
+        field: 'sensitive',
+        label: 'Sensitive',

Review Comment:
   > `Datamask` is a replacement for sensitive values, `Sensitive` refers to whether it is sensitive, so change `Sensitive` to `Datamask`, is it correct?
   
   `Desensitization` is better, I recommend the front-end and back-end all replace to `Desensitization `.



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1014610579


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -106,9 +117,16 @@ public RestResponse updateVariable(@Valid Variable variable) throws Exception {
         return RestResponse.success();
     }
 
+    @PostMapping("sensitive")

Review Comment:
   how about `show_original`?



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1013505547


##########
streampark-console/streampark-console-newui/src/views/system/variable/components/VariableDrawer.vue:
##########
@@ -114,6 +115,17 @@
         componentProps: { rows: 4 },
         rules: [{ max: 100, message: t('system.variable.form.descriptionMessage') }],
       },
+      {
+        field: 'sensitive',
+        label: 'Sensitive',

Review Comment:
   how about replace Sensitive to Datamask?



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1013506060


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -59,8 +59,13 @@ public class VariableController {
     @PostMapping("page")
     @RequiresPermissions("variable:view")
     public RestResponse page(RestRequest restRequest, Variable variable) {
-        IPage<Variable> variableList = variableService.page(variable, restRequest);
-        return RestResponse.success(variableList);
+        IPage<Variable> page = variableService.page(variable, restRequest);
+        for (Variable v : page.getRecords()) {
+            if (v.getSensitive()) {
+                v.setVariableValue(v.getVariableValue().replaceAll("[\\s\\S]", "*"));

Review Comment:
   `v.setVariableValue(ConfigConst.DEFAULT_DATAMASK_STRING())`



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] macksonmu commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable #1958

Posted by GitBox <gi...@apache.org>.
macksonmu commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1013875188


##########
streampark-console/streampark-console-newui/src/views/system/variable/components/VariableDrawer.vue:
##########
@@ -114,6 +115,17 @@
         componentProps: { rows: 4 },
         rules: [{ max: 100, message: t('system.variable.form.descriptionMessage') }],
       },
+      {
+        field: 'sensitive',
+        label: 'Sensitive',

Review Comment:
   `Datamask` is a replacement for sensitive values, `Sensitive` refers to whether it is sensitive, so change `Sensitive` to `Datamask`, is it correct?



-- 
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: issues-unsubscribe@streampark.apache.org

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


[GitHub] [incubator-streampark] macksonmu commented on a diff in pull request #1960: [Feature] Add sensitivity option when creating variable

Posted by GitBox <gi...@apache.org>.
macksonmu commented on code in PR #1960:
URL: https://github.com/apache/incubator-streampark/pull/1960#discussion_r1014623399


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -59,8 +60,13 @@ public class VariableController {
     @PostMapping("page")
     @RequiresPermissions("variable:view")
     public RestResponse page(RestRequest restRequest, Variable variable) {
-        IPage<Variable> variableList = variableService.page(variable, restRequest);
-        return RestResponse.success(variableList);
+        IPage<Variable> page = variableService.page(variable, restRequest);
+        for (Variable v : page.getRecords()) {
+            if (v.getDesensitization()) {
+                v.setVariableValue(ConfigConst.DEFAULT_DATAMASK_STRING());

Review Comment:
   good idea



-- 
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: issues-unsubscribe@streampark.apache.org

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