github-advanced-security[bot] commented on code in PR #15181:
URL: 
https://github.com/apache/dolphinscheduler/pull/15181#discussion_r1398068538


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java:
##########
@@ -175,9 +176,9 @@
     @GetMapping(value = "/list")
     @ResponseStatus(HttpStatus.OK)
     @ApiException(QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR)
-    public Result getAlertPluginInstance(@Parameter(hidden = true) 
@RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
-        Map<String, Object> result = alertPluginInstanceService.queryAll();
-        return returnDataList(result);
+    public Result<List<AlertPluginInstanceVO>> 
getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = 
Constants.SESSION_USER) User loginUser) {

Review Comment:
   ## Useless parameter
   
   The parameter 'loginUser' is never used.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3555)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java:
##########
@@ -64,7 +65,7 @@
      * @param expireTime token expire time
      * @return token string
      */
-    Map<String, Object> generateToken(User loginUser, int userId, String 
expireTime);
+    String generateToken(User loginUser, int userId, String expireTime);

Review Comment:
   ## Useless parameter
   
   The parameter 'loginUser' is never used.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3556)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java:
##########
@@ -215,21 +176,17 @@
         try {
             int insert = alertGroupMapper.insert(alertGroup);
             if (insert > 0) {
-                result.put(Constants.DATA_LIST, alertGroup);
-                putMsg(result, Status.SUCCESS);
                 permissionPostHandle(AuthorizationType.ALERT_GROUP, 
loginUser.getId(),
                         Collections.singletonList(alertGroup.getId()), log);
                 log.info("Create alert group complete, groupName:{}", 
alertGroup.getGroupName());
-            } else {
-                log.error("Create alert group error, groupName:{}", 
alertGroup.getGroupName());
-                putMsg(result, Status.CREATE_ALERT_GROUP_ERROR);
+                return alertGroup;
             }
+            log.error("Create alert group error, groupName:{}", 
alertGroup.getGroupName());

Review Comment:
   ## Log Injection
   
   This log entry depends on a [user-provided value](1).
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/3562)



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