From d62ce25a011732cf81b6871e786186b56c0d384b Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Thu, 24 Aug 2023 15:19:01 +0800 Subject: [PATCH] Remove `@AccessLogAnnotation` annotation, replace with built-in access log (#14803) --- .../api/aspect/AccessLogAnnotation.java | 35 ---- .../api/aspect/AccessLogAspect.java | 178 ------------------ .../api/controller/AccessTokenController.java | 7 - .../api/controller/AlertGroupController.java | 8 - .../AlertPluginInstanceController.java | 8 - .../api/controller/AuditLogController.java | 2 - .../api/controller/CloudController.java | 4 - .../api/controller/ClusterController.java | 8 - .../controller/DataAnalysisController.java | 6 - .../api/controller/DataSourceController.java | 13 -- .../controller/DynamicTaskTypeController.java | 3 - .../api/controller/EnvironmentController.java | 8 - .../api/controller/ExecutorController.java | 9 - .../api/controller/FavTaskController.java | 4 - .../controller/K8sNamespaceController.java | 9 - .../api/controller/LoggerController.java | 5 - .../api/controller/LoginController.java | 3 - .../api/controller/MonitorController.java | 4 - .../ProcessDefinitionController.java | 25 --- .../controller/ProcessInstanceController.java | 14 -- .../ProcessTaskRelationController.java | 8 - .../api/controller/ProjectController.java | 14 -- .../ProjectParameterController.java | 7 - .../ProjectPreferenceController.java | 4 - .../api/controller/QueueController.java | 7 - .../api/controller/ResourcesController.java | 28 --- .../api/controller/SchedulerController.java | 10 - .../controller/TaskDefinitionController.java | 13 -- .../api/controller/TaskGroupController.java | 11 -- .../controller/TaskInstanceController.java | 6 - .../api/controller/TenantController.java | 7 - .../api/controller/UiPluginController.java | 3 - .../api/controller/UsersController.java | 23 --- .../controller/WorkFlowLineageController.java | 5 - .../api/controller/WorkerGroupController.java | 6 - .../v2/AccessTokenV2Controller.java | 2 - .../v2/ProcessTaskRelationV2Controller.java | 4 - .../controller/v2/ProjectV2Controller.java | 12 -- .../api/controller/v2/QueueV2Controller.java | 6 - .../controller/v2/ScheduleV2Controller.java | 6 - .../controller/v2/StatisticsV2Controller.java | 9 - .../v2/TaskDefinitionV2Controller.java | 6 - .../v2/TaskInstanceV2Controller.java | 6 - .../v2/WorkflowInstanceV2Controller.java | 5 - .../controller/v2/WorkflowV2Controller.java | 6 - .../src/main/resources/application.yaml | 3 + .../api/aspect/AccessLogAspectTest.java | 43 ----- .../src/main/resources/application.yaml | 3 + 48 files changed, 6 insertions(+), 610 deletions(-) delete mode 100644 dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAnnotation.java delete mode 100644 dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspect.java delete mode 100644 dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspectTest.java diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAnnotation.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAnnotation.java deleted file mode 100644 index 9b3f55c6e5151..0000000000000 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAnnotation.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.api.aspect; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface AccessLogAnnotation { - - // ignore request args - String[] ignoreRequestArgs() default {"loginUser"}; - - boolean ignoreRequest() default false; -} diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspect.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspect.java deleted file mode 100644 index f22e98da8cbb7..0000000000000 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspect.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.api.aspect; - -import org.apache.dolphinscheduler.api.metrics.ApiServerMetrics; -import org.apache.dolphinscheduler.common.constants.Constants; -import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils; -import org.apache.dolphinscheduler.dao.entity.User; - -import org.apache.commons.lang3.StringUtils; - -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -import javax.servlet.http.HttpServletRequest; - -import lombok.extern.slf4j.Slf4j; - -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.stereotype.Component; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -@Aspect -@Component -@Slf4j -public class AccessLogAspect { - - private static final String TRACE_ID = "traceId"; - - public static final String sensitiveDataRegEx = "(password=[\'\"]+)(\\S+)([\'\"]+)"; - - private static final Pattern sensitiveDataPattern = Pattern.compile(sensitiveDataRegEx, Pattern.CASE_INSENSITIVE); - - @Pointcut("@annotation(org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation)") - public void logPointCut() { - // Do nothing because of it's a pointcut - } - - @Around("logPointCut()") - public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { - long startTime = System.currentTimeMillis(); - - String URI = null; - String requestMethod = null; - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - if (attributes != null) { - HttpServletRequest request = attributes.getRequest(); - URI = request.getRequestURI(); - requestMethod = request.getMethod(); - } - - // fetch AccessLogAnnotation - MethodSignature sign = (MethodSignature) proceedingJoinPoint.getSignature(); - Method method = sign.getMethod(); - AccessLogAnnotation annotation = method.getAnnotation(AccessLogAnnotation.class); - - String traceId = String.valueOf(CodeGenerateUtils.getInstance().genCode()); - - int userId = -1; - String userName = "NOT LOGIN"; - - // log request - if (!annotation.ignoreRequest()) { - if (attributes != null) { - HttpServletRequest request = attributes.getRequest(); - String traceIdFromHeader = request.getHeader(TRACE_ID); - if (StringUtils.isNotEmpty(traceIdFromHeader)) { - traceId = traceIdFromHeader; - } - // handle login info - User loginUser = parseLoginInfo(request); - if (loginUser != null) { - userName = loginUser.getUserName(); - userId = loginUser.getId(); - } - - // handle args - String argsString = parseArgs(proceedingJoinPoint, annotation); - // handle sensitive data in the string - argsString = handleSensitiveData(argsString); - log.info("REQUEST TRACE_ID:{}, LOGIN_USER:{}, URI:{}, METHOD:{}, HANDLER:{}, ARGS:{}", - traceId, - userName, - request.getRequestURI(), - request.getMethod(), - proceedingJoinPoint.getSignature().getDeclaringTypeName() + "." - + proceedingJoinPoint.getSignature().getName(), - argsString); - - } - } - - Object ob = proceedingJoinPoint.proceed(); - - long costTime = System.currentTimeMillis() - startTime; - log.info("Call {}:{} success, cost: {}ms", requestMethod, URI, costTime); - - if (userId != -1) { - ApiServerMetrics.recordApiResponseTime(costTime, userId); - } - - return ob; - } - - private String parseArgs(ProceedingJoinPoint proceedingJoinPoint, AccessLogAnnotation annotation) { - Object[] args = proceedingJoinPoint.getArgs(); - String argsString = Arrays.toString(args); - if (annotation.ignoreRequestArgs().length > 0) { - String[] parameterNames = ((MethodSignature) proceedingJoinPoint.getSignature()).getParameterNames(); - if (parameterNames.length > 0) { - Set ignoreSet = Arrays.stream(annotation.ignoreRequestArgs()).collect(Collectors.toSet()); - HashMap argsMap = new HashMap<>(); - - for (int i = 0; i < parameterNames.length; i++) { - if (!ignoreSet.contains(parameterNames[i])) { - argsMap.put(parameterNames[i], args[i]); - } - } - argsString = argsMap.toString(); - } - } - return argsString; - } - - protected String handleSensitiveData(String originalData) { - Matcher matcher = sensitiveDataPattern.matcher(originalData.toLowerCase()); - IntStream stream = IntStream.builder().build(); - boolean exists = false; - while (matcher.find()) { - if (matcher.groupCount() == 3) { - stream = IntStream.concat(stream, IntStream.range(matcher.end(1), matcher.end(2))); - exists = true; - } - } - - if (exists) { - char[] chars = originalData.toCharArray(); - stream.forEach(idx -> { - chars[idx] = '*'; - }); - return new String(chars); - } - - return originalData; - } - - private User parseLoginInfo(HttpServletRequest request) { - User loginUser = (User) (request.getAttribute(Constants.SESSION_USER)); - return loginUser; - } - -} diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java index 7bcc129275246..dcc083f4a3b84 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ACCESSTOKEN_LIST_PAGING_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ACCESS_TOKEN_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AccessTokenService; import org.apache.dolphinscheduler.api.utils.Result; @@ -82,7 +81,6 @@ public class AccessTokenController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ACCESS_TOKEN_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "expireTime") String expireTime, @@ -103,7 +101,6 @@ public Result createToken(@Parameter(hidden = true) @RequestAttribute(value = Co @PostMapping(value = "/generate") @ResponseStatus(HttpStatus.CREATED) @ApiException(GENERATE_TOKEN_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result generateToken(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "expireTime") String expireTime) { @@ -129,7 +126,6 @@ public Result generateToken(@RequestAttribute(value = Constants.SESSION_USER) Us @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ACCESSTOKEN_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAccessTokenList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @@ -158,7 +154,6 @@ public Result queryAccessTokenList(@Parameter(hidden = true) @RequestAttribute(v @GetMapping(value = "/user/{userId}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ACCESSTOKEN_BY_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAccessTokenByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("userId") Integer userId) { Map result = this.accessTokenService.queryAccessTokenByUser(loginUser, userId); @@ -176,7 +171,6 @@ public Result queryAccessTokenByUser(@Parameter(hidden = true) @RequestAttribute @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ACCESS_TOKEN_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result delAccessTokenById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = accessTokenService.delAccessTokenById(loginUser, id); @@ -203,7 +197,6 @@ public Result delAccessTokenById(@Parameter(hidden = true) @RequestAttribute(val @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ACCESS_TOKEN_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "userId") int userId, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java index 74406e73f3e31..86bfb6a4a1cef 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERTGROUP_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_GROUP_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AlertGroupService; @@ -85,7 +84,6 @@ public class AlertGroupController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ALERT_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createAlertgroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "groupName") String groupName, @RequestParam(value = "description", required = false) String description, @@ -105,7 +103,6 @@ public Result createAlertgroup(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALL_ALERTGROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result list(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = alertGroupService.queryAlertgroup(loginUser); @@ -130,7 +127,6 @@ public Result list(@Parameter(hidden = true) @RequestAttribute(value = Constants @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(LIST_PAGING_ALERT_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @@ -157,7 +153,6 @@ public Result listPaging(@Parameter(hidden = true) @RequestAttribute(value = Con @PostMapping(value = "/query") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALERT_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAlertGroupById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") Integer id) { @@ -184,7 +179,6 @@ public Result queryAlertGroupById(@Parameter(hidden = true) @RequestAttribute(va @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ALERT_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateAlertgroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "groupName") String groupName, @@ -210,7 +204,6 @@ public Result updateAlertgroup(@Parameter(hidden = true) @RequestAttribute(value @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ALERT_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result delAlertgroupById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = alertGroupService.delAlertgroupById(loginUser, id); @@ -230,7 +223,6 @@ public Result delAlertgroupById(@Parameter(hidden = true) @RequestAttribute(valu }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyGroupName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "groupName") String groupName) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java index 76efc7972384b..3ccba174a2c0c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_PLUGIN_INSTANCE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AlertPluginInstanceService; @@ -86,7 +85,6 @@ public class AlertPluginInstanceController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ALERT_PLUGIN_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "pluginDefineId") int pluginDefineId, @RequestParam(value = "instanceName") String instanceName, @@ -114,7 +112,6 @@ public Result createAlertPluginInstance(@Parameter(hidden = true) @RequestAttrib @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ALERT_PLUGIN_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "instanceName") String instanceName, @@ -138,7 +135,6 @@ public Result updateAlertPluginInstance(@Parameter(hidden = true) @RequestAttrib @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ALERT_PLUGIN_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { @@ -157,7 +153,6 @@ public Result deleteAlertPluginInstance(@Parameter(hidden = true) @RequestAttrib @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(GET_ALERT_PLUGIN_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = alertPluginInstanceService.get(loginUser, id); @@ -174,7 +169,6 @@ public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = alertPluginInstanceService.queryAll(); return returnDataList(result); @@ -193,7 +187,6 @@ public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyGroupName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "alertInstanceName") String alertInstanceName) { @@ -224,7 +217,6 @@ public Result verifyGroupName(@Parameter(hidden = true) @RequestAttribute(value @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java index a2a3e335fdca0..ee258df615df9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java @@ -19,7 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_AUDIT_LOG_LIST_PAGING; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AuditService; import org.apache.dolphinscheduler.api.utils.Result; @@ -77,7 +76,6 @@ public class AuditLogController extends BaseController { @GetMapping(value = "/audit-log-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUDIT_LOG_LIST_PAGING) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAuditLogListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/CloudController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/CloudController.java index a5d73748cb150..ad1065cee5ff2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/CloudController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/CloudController.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.LIST_AZURE_DATA_FACTORY_PIPELINE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.LIST_AZURE_RESOURCE_GROUP_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.CloudService; @@ -66,7 +65,6 @@ public class CloudController extends BaseController { @GetMapping(value = "/azure/datafactory/factories") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_AZURE_DATA_FACTORY_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listDataFactory(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List factoryNames = cloudService.listDataFactory(loginUser); return success(Status.SUCCESS.getMsg(), factoryNames); @@ -82,7 +80,6 @@ public Result listDataFactory(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/azure/datafactory/resourceGroups") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_AZURE_RESOURCE_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listResourceGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List resourceGroupNames = cloudService.listResourceGroup(loginUser); return success(Status.SUCCESS.getMsg(), resourceGroupNames); @@ -98,7 +95,6 @@ public Result listResourceGroup(@Parameter(hidden = true) @RequestAttribute(valu @GetMapping(value = "/azure/datafactory/pipelines") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_AZURE_DATA_FACTORY_PIPELINE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listPipeline(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("factoryName") String factoryName, @RequestParam("resourceGroupName") String resourceGroupName) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java index 9ae6612f7f330..524eedeefe69c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_CLUSTER_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_CLUSTER_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ClusterService; import org.apache.dolphinscheduler.api.utils.Result; @@ -79,7 +78,6 @@ public class ClusterController extends BaseController { @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_CLUSTER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("name") String name, @RequestParam("config") String config, @@ -109,7 +107,6 @@ public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_CLUSTER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateCluster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("code") Long code, @RequestParam("name") String name, @@ -132,7 +129,6 @@ public Result updateCluster(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/query-by-code") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CLUSTER_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryClusterByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("clusterCode") Long clusterCode) { @@ -157,7 +153,6 @@ public Result queryClusterByCode(@Parameter(hidden = true) @RequestAttribute(val @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CLUSTER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryClusterListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @@ -186,7 +181,6 @@ public Result queryClusterListPaging(@Parameter(hidden = true) @RequestAttribute @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_CLUSTER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteCluster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("clusterCode") Long clusterCode) { @@ -204,7 +198,6 @@ public Result deleteCluster(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/query-cluster-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CLUSTER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllClusterList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = clusterService.queryAllClusterList(); return returnDataList(result); @@ -224,7 +217,6 @@ public Result queryAllClusterList(@Parameter(hidden = true) @RequestAttribute(va @PostMapping(value = "/verify-cluster") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_CLUSTER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyCluster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "clusterName") String clusterName) { Map result = clusterService.verifyCluster(clusterName); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java index 41b4ba49b7714..dcd8ac2d8c0bc 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUEUE_COUNT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_INSTANCE_STATE_COUNT_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.DataAnalysisService; import org.apache.dolphinscheduler.api.utils.Result; @@ -76,7 +75,6 @@ public class DataAnalysisController extends BaseController { @GetMapping(value = "/task-state-count") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_INSTANCE_STATE_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countTaskState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "endDate", required = false) String endDate, @@ -105,7 +103,6 @@ public Result countTaskState(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/process-state-count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_INSTANCE_STATE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countProcessInstanceState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "endDate", required = false) String endDate, @@ -130,7 +127,6 @@ public Result countProcessInstanceState(@Parameter(hidden = true) @RequestAttrib @GetMapping(value = "/define-user-count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_DEFINITION_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "projectCode", required = false, defaultValue = "0") long projectCode) { @@ -148,7 +144,6 @@ public Result countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/command-state-count") @ResponseStatus(HttpStatus.OK) @ApiException(COMMAND_STATE_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countCommandState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = dataAnalysisService.countCommandState(loginUser); @@ -165,7 +160,6 @@ public Result countCommandState(@Parameter(hidden = true) @RequestAttribute(valu @GetMapping(value = "/queue-count") @ResponseStatus(HttpStatus.OK) @ApiException(QUEUE_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countQueueState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = dataAnalysisService.countQueueState(loginUser); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java index 71b753e71106a..949d21c87488f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java @@ -31,7 +31,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_DATASOURCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_DATASOURCE_NAME_FAILURE; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.DataSourceService; @@ -93,7 +92,6 @@ public class DataSourceController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_DATASOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "dataSourceParam", description = "DATA_SOURCE_PARAM", required = true) @RequestBody String jsonStr) { BaseDataSourceParamDTO dataSourceParam = DataSourceUtils.buildDatasourceParam(jsonStr); @@ -117,7 +115,6 @@ public Result createDataSource(@Parameter(hidden = true) @RequestAttribu @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_DATASOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") Integer id, @RequestBody String jsonStr) { @@ -141,7 +138,6 @@ public Result updateDataSource(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { BaseDataSourceParamDTO dataSource = dataSourceService.queryDataSource(id, loginUser); @@ -162,7 +158,6 @@ public Result queryDataSource(@Parameter(hidden = true) @RequestAttribut @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryDataSourceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("type") DbType type) { List datasourceList = dataSourceService.queryDataSourceList(loginUser, type.ordinal()); @@ -187,7 +182,6 @@ public Result queryDataSourceList(@Parameter(hidden = true) @RequestAttr @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryDataSourceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @@ -214,7 +208,6 @@ public Result queryDataSourceListPaging(@Parameter(hidden = true) @Reque @PostMapping(value = "/connect") @ResponseStatus(HttpStatus.OK) @ApiException(CONNECT_DATASOURCE_FAILURE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result connectDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "dataSourceParam") @RequestBody String jsonStr) { BaseDataSourceParamDTO dataSourceParam = DataSourceUtils.buildDatasourceParam(jsonStr); @@ -237,7 +230,6 @@ public Result connectDataSource(@Parameter(hidden = true) @RequestAttrib @GetMapping(value = "/{id}/connect-test") @ResponseStatus(HttpStatus.OK) @ApiException(CONNECTION_TEST_FAILURE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result connectionTest(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { return dataSourceService.connectionTest(id); @@ -257,7 +249,6 @@ public Result connectionTest(@Parameter(hidden = true) @RequestAttribute @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_DATA_SOURCE_FAILURE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { return dataSourceService.delete(loginUser, id); @@ -277,7 +268,6 @@ public Result deleteDataSource(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_DATASOURCE_NAME_FAILURE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyDataSourceName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "name") String name) { return dataSourceService.verifyDataSourceName(name); @@ -297,7 +287,6 @@ public Result verifyDataSourceName(@Parameter(hidden = true) @RequestAtt @GetMapping(value = "/unauth-datasource") @ResponseStatus(HttpStatus.OK) @ApiException(UNAUTHORIZED_DATASOURCE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result unAuthDatasource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { @@ -319,7 +308,6 @@ public Result unAuthDatasource(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/authed-datasource") @ResponseStatus(HttpStatus.OK) @ApiException(AUTHORIZED_DATA_SOURCE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result authedDatasource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { List authedDatasourceList = dataSourceService.authedDatasource(loginUser, userId); @@ -336,7 +324,6 @@ public Result authedDatasource(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/kerberos-startup-state") @ResponseStatus(HttpStatus.OK) @ApiException(KERBEROS_STARTUP_STATE) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result getKerberosStartupState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { // if upload resource is HDFS and kerberos startup is true , else false return success(Status.SUCCESS.getMsg(), CommonUtils.getKerberosStartupState()); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DynamicTaskTypeController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DynamicTaskTypeController.java index 4dd4af6ddee7e..c388faa31cf3e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DynamicTaskTypeController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DynamicTaskTypeController.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.LIST_TASK_TYPE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.configuration.DynamicTaskTypeConfiguration; import org.apache.dolphinscheduler.api.dto.taskType.DynamicTaskInfo; import org.apache.dolphinscheduler.api.enums.Status; @@ -67,7 +66,6 @@ public class DynamicTaskTypeController extends BaseController { @GetMapping(value = "/taskCategories") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_TASK_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listDynamicTaskCategories(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List taskCategories = dynamicTaskTypeConfiguration.getTaskCategories(); return success(Status.SUCCESS.getMsg(), taskCategories); @@ -83,7 +81,6 @@ public Result listDynamicTaskCategories(@Parameter(hidden = true) @RequestAttrib @GetMapping(value = "/{taskCategory}/taskTypes") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_TASK_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listDynamicTaskTypes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("taskCategory") String taskCategory) { List taskTypes = dynamicTaskTypeConfiguration.getTaskTypesByCategory(taskCategory); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java index 94c6345e20032..47e7d09284c8f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ENVIRONMENT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_ENVIRONMENT_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.EnvironmentService; import org.apache.dolphinscheduler.api.utils.Result; @@ -80,7 +79,6 @@ public class EnvironmentController extends BaseController { @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ENVIRONMENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("name") String name, @RequestParam("config") String config, @@ -113,7 +111,6 @@ public Result createEnvironment(@Parameter(hidden = true) @RequestAttribute(valu @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ENVIRONMENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("code") Long code, @RequestParam("name") String name, @@ -138,7 +135,6 @@ public Result updateEnvironment(@Parameter(hidden = true) @RequestAttribute(valu @GetMapping(value = "/query-by-code") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ENVIRONMENT_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryEnvironmentByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("environmentCode") Long environmentCode) { @@ -163,7 +159,6 @@ public Result queryEnvironmentByCode(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ENVIRONMENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryEnvironmentListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @@ -192,7 +187,6 @@ public Result queryEnvironmentListPaging(@Parameter(hidden = true) @RequestAttri @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ENVIRONMENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("environmentCode") Long environmentCode) { @@ -210,7 +204,6 @@ public Result deleteEnvironment(@Parameter(hidden = true) @RequestAttribute(valu @GetMapping(value = "/query-environment-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ENVIRONMENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllEnvironmentList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = environmentService.queryAllEnvironmentList(loginUser); return returnDataList(result); @@ -230,7 +223,6 @@ public Result queryAllEnvironmentList(@Parameter(hidden = true) @RequestAttribut @PostMapping(value = "/verify-environment") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_ENVIRONMENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "environmentName") String environmentName) { Map result = environmentService.verifyEnvironment(environmentName); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java index cdfabedcaef65..d6176cfd70cce 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_EXECUTING_WORKFLOW_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.START_PROCESS_INSTANCE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.ExecuteType; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -131,7 +130,6 @@ public class ExecutorController extends BaseController { @PostMapping(value = "start-process-instance") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result startProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode") long processDefinitionCode, @@ -229,7 +227,6 @@ public Result startProcessInstance(@Parameter(hidden = true) @RequestAttribute(v @PostMapping(value = "batch-start-process-instance") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result batchStartProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCodes") String processDefinitionCodes, @@ -319,7 +316,6 @@ public Result batchStartProcessInstance(@Parameter(hidden = true) @RequestAttrib @PostMapping(value = "/execute") @ResponseStatus(HttpStatus.OK) @ApiException(EXECUTE_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("processInstanceId") Integer processInstanceId, @@ -346,7 +342,6 @@ public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Consta @PostMapping(value = "/batch-execute") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_EXECUTE_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result batchExecute(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable long projectCode, @RequestParam("processInstanceIds") String processInstanceIds, @@ -395,7 +390,6 @@ public Result batchExecute(@RequestAttribute(value = Constants.SESSION_USER) Use @PostMapping(value = "/start-check") @ResponseStatus(HttpStatus.OK) @ApiException(CHECK_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result startCheckProcessDefinition(@RequestParam(value = "processDefinitionCode") long processDefinitionCode) { Map result = execService.startCheckByProcessDefinedCode(processDefinitionCode); return returnDataList(result); @@ -411,7 +405,6 @@ public Result startCheckProcessDefinition(@RequestParam(value = "processDefiniti @GetMapping(value = "/query-executing-workflow") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_EXECUTING_WORKFLOW_ERROR) - @AccessLogAnnotation public Result queryExecutingWorkflow(@RequestParam("id") Integer processInstanceId) { WorkflowExecuteDto workflowExecuteDto = execService.queryExecutingWorkflowByProcessInstanceId(processInstanceId); @@ -445,7 +438,6 @@ public Result queryExecutingWorkflow(@RequestParam("id") Integer processInstance @PostMapping(value = "/task-instance/{code}/start") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result startStreamTaskInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @Parameter(name = "code", description = "TASK_CODE", required = true) @PathVariable long code, @@ -488,7 +480,6 @@ public Result startStreamTaskInstance(@Parameter(hidden = true) @RequestAttribut @PostMapping(value = "/execute-task") @ResponseStatus(HttpStatus.OK) @ApiException(EXECUTE_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result executeTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("processInstanceId") Integer processInstanceId, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java index 35b11627b329d..0bdcc7a346e64 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_TYPE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.LIST_TASK_TYPE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.FavTaskDto; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -69,7 +68,6 @@ public class FavTaskController extends BaseController { @GetMapping(value = "/taskTypes") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_TASK_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listTaskType(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List favTaskList = favTaskService.getFavTaskList(loginUser); return success(Status.SUCCESS.getMsg(), favTaskList); @@ -85,7 +83,6 @@ public Result listTaskType(@Parameter(hidden = true) @RequestAttribute(value = C @DeleteMapping(value = "/{taskType}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteFavTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("taskType") String taskType) { boolean b = favTaskService.deleteFavTask(loginUser, taskType); @@ -102,7 +99,6 @@ public Result deleteFavTask(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/{taskType}") @ResponseStatus(HttpStatus.OK) @ApiException(ADD_TASK_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result addFavTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("taskType") String taskType) { int i = favTaskService.addFavTask(loginUser, taskType); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java index 1477f8b73e71d..41a34cdd58b3a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java @@ -26,7 +26,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_K8S_NAMESPACE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_K8S_NAMESPACE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.K8sNamespaceService; import org.apache.dolphinscheduler.api.utils.Result; @@ -85,7 +84,6 @@ public class K8sNamespaceController extends BaseController { @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_K8S_NAMESPACE_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryNamespaceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @@ -120,7 +118,6 @@ public Result queryNamespaceListPaging(@Parameter(hidden = true) @RequestAttribu @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_K8S_NAMESPACE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "namespace") String namespace, @RequestParam(value = "clusterCode") Long clusterCode, @@ -149,7 +146,6 @@ public Result createNamespace(@Parameter(hidden = true) @RequestAttribute(value @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_K8S_NAMESPACE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "userName", required = false) String userName, @@ -177,7 +173,6 @@ public Result updateNamespace(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/verify") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_K8S_NAMESPACE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "namespace") String namespace, @RequestParam(value = "clusterCode") Long clusterCode) { @@ -199,7 +194,6 @@ public Result verifyNamespace(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_K8S_NAMESPACE_BY_ID_ERROR) - @AccessLogAnnotation public Result delNamespaceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) { Map result = k8sNamespaceService.deleteNamespaceById(loginUser, id); @@ -220,7 +214,6 @@ public Result delNamespaceById(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/unauth-namespace") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UNAUTHORIZED_NAMESPACE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUnauthorizedNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = k8sNamespaceService.queryUnauthorizedNamespace(loginUser, userId); @@ -241,7 +234,6 @@ public Result queryUnauthorizedNamespace(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/authed-namespace") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_NAMESPACE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAuthorizedNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = k8sNamespaceService.queryAuthorizedNamespace(loginUser, userId); @@ -258,7 +250,6 @@ public Result queryAuthorizedNamespace(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/available-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CAN_USE_K8S_NAMESPACE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAvailableNamespaceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List result = k8sNamespaceService.queryNamespaceAvailable(loginUser); return success(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java index bd2a79285d4cb..435850537de7d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java @@ -20,7 +20,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_INSTANCE_LOG_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.LoggerService; import org.apache.dolphinscheduler.api.utils.Result; @@ -76,7 +75,6 @@ public class LoggerController extends BaseController { @GetMapping(value = "/detail") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_INSTANCE_LOG_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "taskInstanceId") int taskInstanceId, @RequestParam(value = "skipLineNum") int skipNum, @@ -98,7 +96,6 @@ public Result queryLog(@Parameter(hidden = true) @RequestAttrib @GetMapping(value = "/download-log") @ResponseBody @ApiException(DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "taskInstanceId") int taskInstanceId) { byte[] logBytes = loggerService.getLogBytes(loginUser, taskInstanceId); @@ -129,7 +126,6 @@ public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribut @GetMapping(value = "/{projectCode}/detail") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_INSTANCE_LOG_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskInstanceId") int taskInstanceId, @@ -154,7 +150,6 @@ public Result queryLog(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/{projectCode}/download-log") @ResponseBody @ApiException(DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskInstanceId") int taskInstanceId) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java index e03cafe0dc252..f535e487765d0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java @@ -22,7 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.SIGN_OUT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.USER_LOGIN_FAILURE; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.configuration.OAuth2Configuration; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -107,7 +106,6 @@ public class LoginController extends BaseController { }) @PostMapping(value = "/login") @ApiException(USER_LOGIN_FAILURE) - @AccessLogAnnotation(ignoreRequestArgs = {"userPassword", "request", "response"}) public Result login(@RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, HttpServletRequest request, @@ -171,7 +169,6 @@ public Result ssoLogin(HttpServletRequest request) { @Operation(summary = "signOut", description = "SIGNOUT_NOTES") @PostMapping(value = "/signOut") @ApiException(SIGN_OUT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "request"}) public Result signOut(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, HttpServletRequest request) { String ip = getClientIpAddress(request); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java index ae83591f07e95..779d230cd4814 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.LIST_WORKERS_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DATABASE_STATE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.MonitorService; import org.apache.dolphinscheduler.api.utils.Result; @@ -63,7 +62,6 @@ public class MonitorController extends BaseController { @GetMapping(value = "/masters") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_MASTERS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listMaster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = monitorService.queryMaster(loginUser); return returnDataList(result); @@ -79,7 +77,6 @@ public Result listMaster(@Parameter(hidden = true) @RequestAttribute(value = Con @GetMapping(value = "/workers") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_WORKERS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result listWorker(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = monitorService.queryWorker(loginUser); return returnDataList(result); @@ -95,7 +92,6 @@ public Result listWorker(@Parameter(hidden = true) @RequestAttribute(value = Con @GetMapping(value = "/databases") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATABASE_STATE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryDatabaseState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = monitorService.queryDatabaseState(loginUser); return returnDataList(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java index ecafc7a7f7578..65589cea0d6c4 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java @@ -36,7 +36,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProcessDefinitionService; @@ -113,7 +112,6 @@ public class ProcessDefinitionController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @@ -148,7 +146,6 @@ public Result createProcessDefinition(@Parameter(hidden = true) @RequestAttribut @PostMapping(value = "/batch-copy") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_COPY_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result copyProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "codes", required = true) String codes, @@ -174,7 +171,6 @@ public Result copyProcessDefinition(@Parameter(hidden = true) @RequestAttribute( @PostMapping(value = "/batch-move") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_MOVE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result moveProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "codes", required = true) String codes, @@ -199,7 +195,6 @@ public Result moveProcessDefinition(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyProcessDefinitionName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @@ -237,7 +232,6 @@ public Result verifyProcessDefinitionName(@Parameter(hidden = true) @RequestAttr @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @@ -286,7 +280,6 @@ public Result updateProcessDefinition(@Parameter(hidden = true) @RequestAttribut @GetMapping(value = "/{code}/versions") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_VERSIONS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessDefinitionVersions(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "pageNo") int pageNo, @@ -320,7 +313,6 @@ public Result queryProcessDefinitionVersions(@Parameter(hidden = true) @RequestA @GetMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(SWITCH_PROCESS_DEFINITION_VERSION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result switchProcessDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -347,7 +339,6 @@ public Result switchProcessDefinitionVersion(@Parameter(hidden = true) @RequestA @DeleteMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_DEFINITION_VERSION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteProcessDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -375,7 +366,6 @@ public Result deleteProcessDefinitionVersion(@Parameter(hidden = true) @RequestA @PostMapping(value = "/{code}/release") @ResponseStatus(HttpStatus.OK) @ApiException(RELEASE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result releaseProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code, @@ -400,7 +390,6 @@ public Result releaseProcessDefinition(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code) { @@ -424,7 +413,6 @@ public Result queryProcessDefinitionByCode(@Parameter(hidden = true) @RequestAtt @GetMapping(value = "/query-by-name") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessDefinitionByName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("name") String name) { @@ -444,7 +432,6 @@ public Result queryProcessDefinitionByName(@Parameter(hidden @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessDefinitionList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = processDefinitionService.queryProcessDefinitionList(loginUser, projectCode); @@ -462,7 +449,6 @@ public Result queryProcessDefinitionList(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/simple-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessDefinitionSimpleList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = processDefinitionService.queryProcessDefinitionSimpleList(loginUser, projectCode); @@ -492,7 +478,6 @@ public Result queryProcessDefinitionSimpleList(@Parameter(hidden = true) @Reques @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryProcessDefinitionListPaging( @Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @@ -531,7 +516,6 @@ public Result> queryProcessDefinitionListPaging( @GetMapping(value = "/{code}/view-tree") @ResponseStatus(HttpStatus.OK) @ApiException(ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") long code, @@ -636,7 +620,6 @@ public Result getTaskListByProcessDefinitionCode(@Parameter(hidden = true) @Requ @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_DEFINE_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteProcessDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") long workflowDefinitionCode) { @@ -659,7 +642,6 @@ public Result deleteProcessDefinitionByCode(@Parameter(hidden = true) @RequestAt @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result batchDeleteProcessDefinitionByCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes) { @@ -683,7 +665,6 @@ public Result batchDeleteProcessDefinitionByCodes(@Parameter(hidden = true) @Req }) @PostMapping(value = "/batch-export") @ResponseBody - @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "response"}) public void batchExportProcessDefinitionByCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes, @@ -706,7 +687,6 @@ public void batchExportProcessDefinitionByCodes(@Parameter(hidden = true) @Reque @GetMapping(value = "/all") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllProcessDefinitionByProjectCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = @@ -728,7 +708,6 @@ public Result queryAllProcessDefinitionByProjectCode(@Parameter(hidden = true) @ }) @PostMapping(value = "/import") @ApiException(IMPORT_PROCESS_DEFINE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "file"}) public Result importProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("file") MultipartFile file) { @@ -762,7 +741,6 @@ public Result importProcessDefinition(@Parameter(hidden = true) @RequestAttribut @PostMapping(value = "/empty") @ResponseStatus(HttpStatus.OK) @ApiException(CREATE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createEmptyProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @@ -803,7 +781,6 @@ public Result createEmptyProcessDefinition(@Parameter(hidden = true) @RequestAtt @PutMapping(value = "/{code}/basic-info") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateProcessDefinitionBasicInfo(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @@ -848,7 +825,6 @@ public Result updateProcessDefinitionBasicInfo(@Parameter(hidden = true) @Reques @PostMapping(value = "/{code}/release-workflow") @ResponseStatus(HttpStatus.OK) @ApiException(RELEASE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result releaseWorkflowAndSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code, @@ -871,7 +847,6 @@ public Result releaseWorkflowAndSchedule(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/{code}/view-variables") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_ALL_VARIABLES_ERROR) - @AccessLogAnnotation public Result viewVariables(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") Long code) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java index 947cb059517b1..09b4001339509 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java @@ -19,7 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.DynamicSubWorkflowDto; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -104,7 +103,6 @@ public class ProcessInstanceController extends BaseController { @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessInstanceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefineCode", required = false, defaultValue = "0") long processDefineCode, @@ -144,7 +142,6 @@ public Result queryProcessInstanceList(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/{id}/tasks") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskListByProcessId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) throws IOException { @@ -180,7 +177,6 @@ public Result queryTaskListByProcessId(@Parameter(hidden = true) @RequestAttribu @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(Status.UPDATE_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskRelationJson", required = true) String taskRelationJson, @@ -211,7 +207,6 @@ public Result updateProcessInstance(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PROCESS_INSTANCE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProcessInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { @@ -238,7 +233,6 @@ public Result queryProcessInstanceById(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/top-n") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PROCESS_INSTANCE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTopNLongestRunningProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("size") Integer size, @@ -265,7 +259,6 @@ public Result queryTopNLongestRunningProcessInstance(@Parameter @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(Status.DELETE_PROCESS_INSTANCE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteProcessInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { @@ -288,7 +281,6 @@ public Result deleteProcessInstanceById(@Parameter(hidden = true) @Request @GetMapping(value = "/query-sub-by-parent") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result querySubProcessInstanceByTaskId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("taskId") Integer taskId) { @@ -312,7 +304,6 @@ public Result querySubProcessInstanceByTaskId(@Parameter(hidden = true) @Request @GetMapping(value = "/query-parent-by-sub") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PARENT_PROCESS_INSTANCE_DETAIL_INFO_BY_SUB_PROCESS_INSTANCE_ID_ERROR) - @AccessLogAnnotation public Result queryParentInstanceBySubId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("subId") Integer subId) { @@ -334,7 +325,6 @@ public Result queryParentInstanceBySubId(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/query-dynamic-sub-workflows") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryDynamicSubWorkflowInstances(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("taskId") Integer taskId) { List dynamicSubWorkflowDtos = @@ -356,7 +346,6 @@ public Result> queryDynamicSubWorkflowInstances(@Par @GetMapping(value = "/{id}/view-variables") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PROCESS_INSTANCE_ALL_VARIABLES_ERROR) - @AccessLogAnnotation public Result viewVariables(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { @@ -379,7 +368,6 @@ public Result viewVariables(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/{id}/view-gantt") @ResponseStatus(HttpStatus.OK) @ApiException(Status.ENCAPSULATION_PROCESS_INSTANCE_GANTT_STRUCTURE_ERROR) - @AccessLogAnnotation public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) throws Exception { @@ -404,7 +392,6 @@ public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Const @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) @ApiException(Status.BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR) - @AccessLogAnnotation public Result batchDeleteProcessInstanceByIds(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable long projectCode, @RequestParam("processInstanceIds") String processInstanceIds) { @@ -441,7 +428,6 @@ public Result batchDeleteProcessInstanceByIds(@RequestAttribute(value = Constant @GetMapping("/trigger") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR) - @AccessLogAnnotation() public Result queryProcessInstancesByTriggerCode(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable long projectCode, @RequestParam(value = "triggerCode") Long triggerCode) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java index 34cdaebad384a..d285077a25c35 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_PROCESS_RELATION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_PROCESS_RELATION_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProcessTaskRelationService; import org.apache.dolphinscheduler.api.utils.Result; @@ -82,7 +81,6 @@ public class ProcessTaskRelationController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_TASK_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createProcessTaskRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "processDefinitionCode", required = true) long processDefinitionCode, @@ -118,7 +116,6 @@ public Result createProcessTaskRelation(@Parameter(hidden = true) @RequestAttrib @DeleteMapping(value = "/{taskCode}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteTaskProcessRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "processDefinitionCode", required = true) long processDefinitionCode, @@ -145,7 +142,6 @@ public Result deleteTaskProcessRelation(@Parameter(hidden = true) @RequestAttrib @DeleteMapping(value = "/{taskCode}/upstream") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteUpstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "preTaskCodes", required = true) String preTaskCodes, @@ -172,7 +168,6 @@ public Result deleteUpstreamRelation(@Parameter(hidden = true) @RequestAttribute @DeleteMapping(value = "/{taskCode}/downstream") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteDownstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "postTaskCodes", required = true) String postTaskCodes, @@ -197,7 +192,6 @@ public Result deleteDownstreamRelation(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/{taskCode}/upstream") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUpstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("taskCode") long taskCode) { @@ -220,7 +214,6 @@ public Result queryUpstreamRelation(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/{taskCode}/downstream") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryDownstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("taskCode") long taskCode) { @@ -247,7 +240,6 @@ public Result queryDownstreamRelation(@Parameter(hidden = true) @RequestAttribut @DeleteMapping(value = "/{processDefinitionCode}/{preTaskCode}/{postTaskCode}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_EDGE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteEdge(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable long processDefinitionCode, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java index e46cb7c3462b5..cdc15865b3c0b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java @@ -27,7 +27,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UNAUTHORIZED_PROJECT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProjectService; import org.apache.dolphinscheduler.api.utils.Result; @@ -84,7 +83,6 @@ public class ProjectController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description) { @@ -109,7 +107,6 @@ public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestParam("projectName") String projectName, @@ -131,7 +128,6 @@ public Result updateProject(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_DETAILS_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") long code) { return projectService.queryByCode(loginUser, code); @@ -155,7 +151,6 @@ public Result queryProjectByCode(@Parameter(hidden = true) @RequestAttribute(val @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @@ -191,7 +186,6 @@ public Result queryProjectListPaging(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/project-with-authorized-level-list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectWithAuthorizedLevelListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId, @RequestParam(value = "searchVal", required = false) String searchVal, @@ -222,7 +216,6 @@ public Result queryProjectWithAuthorizedLevelListPaging(@Parameter(hidden = true @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { return projectService.deleteProject(loginUser, code); @@ -242,7 +235,6 @@ public Result deleteProject(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/unauth-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UNAUTHORIZED_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUnauthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { return projectService.queryUnauthorizedProject(loginUser, userId); @@ -262,7 +254,6 @@ public Result queryUnauthorizedProject(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/authed-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_PROJECT) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAuthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { return projectService.queryAuthorizedProject(loginUser, userId); @@ -282,7 +273,6 @@ public Result queryAuthorizedProject(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/project-with-authorized-level") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_PROJECT) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectWithAuthorizedLevel(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { return projectService.queryProjectWithAuthorizedLevel(loginUser, userId); @@ -302,7 +292,6 @@ public Result queryProjectWithAuthorizedLevel(@Parameter(hidden = true) @Request @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_USER) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAuthorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectCode") Long projectCode) { return projectService.queryAuthorizedUser(loginUser, projectCode); @@ -318,7 +307,6 @@ public Result queryAuthorizedUser(@Parameter(hidden = true) @RequestAttribute(va @GetMapping(value = "/created-and-authed") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectCreatedAndAuthorizedByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return projectService.queryProjectCreatedAndAuthorizedByUser(loginUser); } @@ -333,7 +321,6 @@ public Result queryProjectCreatedAndAuthorizedByUser(@Parameter(hidden = true) @ @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllProjectList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return projectService.queryAllProjectList(loginUser); } @@ -348,7 +335,6 @@ public Result queryAllProjectList(@Parameter(hidden = true) @RequestAttribute(va @GetMapping(value = "/list-dependent") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllProjectListForDependent(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return projectService.queryAllProjectListForDependent(); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectParameterController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectParameterController.java index 79fd49c227a4b..0c73801c7ab28 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectParameterController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectParameterController.java @@ -22,7 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROJECT_PARAMETER_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_PARAMETER_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProjectParameterService; import org.apache.dolphinscheduler.api.utils.Result; @@ -67,7 +66,6 @@ public class ProjectParameterController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROJECT_PARAMETER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createProjectParameter(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("projectParameterName") String projectParameterName, @@ -85,7 +83,6 @@ public Result createProjectParameter(@Parameter(hidden = true) @RequestAttribute @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROJECT_PARAMETER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateProjectParameter(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") Long code, @@ -102,7 +99,6 @@ public Result updateProjectParameter(@Parameter(hidden = true) @RequestAttribute @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROJECT_PARAMETER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteProjectParametersByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("code") long code) { @@ -117,7 +113,6 @@ public Result deleteProjectParametersByCode(@Parameter(hidden = true) @RequestAt @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROJECT_PARAMETER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result batchDeleteProjectParametersByCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes) { @@ -134,7 +129,6 @@ public Result batchDeleteProjectParametersByCodes(@Parameter(hidden = true) @Req @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_PARAMETER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectParameterListPaging( @Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @@ -159,7 +153,6 @@ public Result queryProjectParameterListPaging( @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_PARAMETER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectParameterByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") long code) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectPreferenceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectPreferenceController.java index 4405cf3782467..1ad54859a37ec 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectPreferenceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectPreferenceController.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_PREFERENCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_PREFERENCE_STATE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProjectPreferenceService; import org.apache.dolphinscheduler.api.utils.Result; @@ -64,7 +63,6 @@ public class ProjectPreferenceController extends BaseController { @PutMapping @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_PROJECT_PREFERENCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateProjectPreference(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "projectPreferences", required = true) String projectPreferences) { @@ -75,7 +73,6 @@ public Result updateProjectPreference(@Parameter(hidden = true) @RequestAttribut @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_PREFERENCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryProjectPreferenceByProjectCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { return projectPreferenceService.queryProjectPreferenceByProjectCode(loginUser, projectCode); @@ -88,7 +85,6 @@ public Result queryProjectPreferenceByProjectCode(@Parameter(hidden = true) @Req @PostMapping @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROJECT_PREFERENCE_STATE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result enableProjectPreference(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "state", required = true) int state) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java index 0527ce77ae63d..65e23a9069248 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_QUEUE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_QUEUE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.QueueService; import org.apache.dolphinscheduler.api.utils.Result; @@ -73,7 +72,6 @@ public class QueueController extends BaseController { @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return queueService.queryList(loginUser); } @@ -96,7 +94,6 @@ public Result queryList(@Parameter(hidden = true) @RequestAttribute(value = Cons @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryQueueListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @@ -127,7 +124,6 @@ public Result queryQueueListPaging(@Parameter(hidden = true) @RequestAttribute(v @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_QUEUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queue") String queue, @RequestParam(value = "queueName") String queueName) { @@ -152,7 +148,6 @@ public Result createQueue(@Parameter(hidden = true) @RequestAttribute(value = Co @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_QUEUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "queue") String queue, @@ -174,7 +169,6 @@ public Result updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Co @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_QUEUE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteQueueById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) throws Exception { Map result = queueService.deleteQueueById(loginUser, id); @@ -197,7 +191,6 @@ public Result deleteQueueById(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/verify") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_QUEUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queue") String queue, @RequestParam(value = "queueName") String queueName) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java index f2108390a5c99..69c19b32b36df 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java @@ -41,7 +41,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.VIEW_RESOURCE_FILE_ON_LINE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VIEW_UDF_FUNCTION_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.resources.DeleteDataTransferResponse; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ResourcesService; @@ -118,7 +117,6 @@ public class ResourcesController extends BaseController { }) @PostMapping(value = "/directory") @ApiException(CREATE_RESOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createDirectory(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "name") String alias, @@ -142,7 +140,6 @@ public Result createDirectory(@Parameter(hidden = true) @RequestAttribut }) @PostMapping() @ApiException(CREATE_RESOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "name") String alias, @@ -171,7 +168,6 @@ public Result createResource(@Parameter(hidden = true) @RequestAttribute }) @PutMapping() @ApiException(UPDATE_RESOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName, @RequestParam(value = "tenantCode", required = false) String tenantCode, @@ -196,7 +192,6 @@ public Result updateResource(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RESOURCES_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryResourceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "fullName") String fullName) { @@ -225,7 +220,6 @@ public Result queryResourceList(@Parameter(hidden = true) @RequestAttrib @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RESOURCES_LIST_PAGING) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryResourceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName, @RequestParam(value = "tenantCode") String tenantCode, @@ -257,7 +251,6 @@ public Result> queryResourceListPaging(@Parameter(hidden @DeleteMapping() @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_RESOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName, @RequestParam(value = "tenantCode", required = false) String tenantCode) throws Exception { @@ -277,7 +270,6 @@ public Result deleteResource(@Parameter(hidden = true) @RequestAttribute @DeleteMapping(value = "/data-transfer") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_RESOURCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public DeleteDataTransferResponse deleteDataTransferData(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "days") Integer days) { return resourceService.deleteDataTransferData(loginUser, days); @@ -299,7 +291,6 @@ public DeleteDataTransferResponse deleteDataTransferData(@Parameter(hidden = tru @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyResourceName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName, @RequestParam(value = "type") ResourceType type) { @@ -320,7 +311,6 @@ public Result verifyResourceName(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/query-by-type") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RESOURCES_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryResourceJarList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "programType", required = false) ProgramType programType) { @@ -345,7 +335,6 @@ public Result queryResourceJarList(@Parameter(hidden = true) @RequestAtt @GetMapping(value = "/query-file-name") @ResponseStatus(HttpStatus.OK) @ApiException(RESOURCE_NOT_EXIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryResourceByFileName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fileName", required = false) String fileName, @RequestParam(value = "tenantCode", required = false) String tenantCode, @@ -371,7 +360,6 @@ public Result queryResourceByFileName(@Parameter(hidden = true) @Request }) @GetMapping(value = "/view") @ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result viewResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "skipLineNum") int skipLineNum, @RequestParam(value = "limit") int limit, @@ -396,7 +384,6 @@ public Result viewResource(@Parameter(hidden = true) @RequestAttribute(value = C }) @PostMapping(value = "/online-create") @ApiException(CREATE_RESOURCE_FILE_ON_LINE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result onlineCreateResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "fileName") String fileName, @@ -425,7 +412,6 @@ public Result onlineCreateResource(@Parameter(hidden = true) @RequestAttribute(v }) @PutMapping(value = "/update-content") @ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateResourceContent(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName, @RequestParam(value = "tenantCode") String tenantCode, @@ -450,7 +436,6 @@ public Result updateResourceContent(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/download") @ResponseBody @ApiException(DOWNLOAD_RESOURCE_FILE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ResponseEntity downloadResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName) throws Exception { Resource file = resourceService.downloadResource(loginUser, fullName); @@ -489,7 +474,6 @@ public ResponseEntity downloadResource(@Parameter(hidden = true) @RequestAttribu @PostMapping(value = "/udf-func") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_UDF_FUNCTION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") UdfType type, @RequestParam(value = "funcName") String funcName, @@ -518,7 +502,6 @@ public Result createUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/{id}/udf-func") @ResponseStatus(HttpStatus.OK) @ApiException(VIEW_UDF_FUNCTION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result viewUIUdfFunction(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { return udfFuncService.queryUdfFuncDetail(loginUser, id); @@ -549,7 +532,6 @@ public Result viewUIUdfFunction(@Parameter(hidden = true) @RequestAttribute(valu }) @PutMapping(value = "/udf-func/{id}") @ApiException(UPDATE_UDF_FUNCTION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int udfFuncId, @RequestParam(value = "type") UdfType type, @@ -581,7 +563,6 @@ public Result updateUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/udf-func") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUdfFuncListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @@ -607,7 +588,6 @@ public Result queryUdfFuncListPaging(@Parameter(hidden = true) @RequestA @GetMapping(value = "/udf-func/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_BY_TYPE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUdfFuncList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("type") UdfType type) { return udfFuncService.queryUdfFuncList(loginUser, type.ordinal()); @@ -628,7 +608,6 @@ public Result queryUdfFuncList(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/udf-func/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_UDF_FUNCTION_NAME_ERROR) - @AccessLogAnnotation public Result verifyUdfFuncName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "name") String name) { return udfFuncService.verifyUdfFuncByName(loginUser, name); @@ -648,7 +627,6 @@ public Result verifyUdfFuncName(@Parameter(hidden = true) @RequestAttribute(valu @DeleteMapping(value = "/udf-func/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_UDF_FUNCTION_ERROR) - @AccessLogAnnotation public Result deleteUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int udfFuncId) { return udfFuncService.delete(loginUser, udfFuncId); @@ -668,7 +646,6 @@ public Result deleteUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/authed-file") @ResponseStatus(HttpStatus.CREATED) @ApiException(AUTHORIZED_FILE_RESOURCE_ERROR) - @AccessLogAnnotation public Result authorizedFile(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.authorizedFile(loginUser, userId); @@ -689,7 +666,6 @@ public Result authorizedFile(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/authed-resource-tree") @ResponseStatus(HttpStatus.CREATED) @ApiException(AUTHORIZE_RESOURCE_TREE) - @AccessLogAnnotation public Result authorizeResourceTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.authorizeResourceTree(loginUser, userId); @@ -710,7 +686,6 @@ public Result authorizeResourceTree(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/unauth-udf-func") @ResponseStatus(HttpStatus.CREATED) @ApiException(UNAUTHORIZED_UDF_FUNCTION_ERROR) - @AccessLogAnnotation public Result unauthUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { @@ -732,7 +707,6 @@ public Result unauthUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/authed-udf-func") @ResponseStatus(HttpStatus.CREATED) @ApiException(AUTHORIZED_UDF_FUNCTION_ERROR) - @AccessLogAnnotation public Result authorizedUDFFunction(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.authorizedUDFFunction(loginUser, userId); @@ -754,7 +728,6 @@ public Result authorizedUDFFunction(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/query-full-name") @ResponseStatus(HttpStatus.OK) @ApiException(RESOURCE_NOT_EXIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryResourceByFullName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "fullName") String fullName, @@ -770,7 +743,6 @@ public Result queryResourceByFullName(@Parameter(hidden = true) @RequestAttribut @GetMapping(value = "/base-dir") @ResponseStatus(HttpStatus.OK) @ApiException(RESOURCE_NOT_EXIST) - @AccessLogAnnotation public Result queryResourceBaseDir(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type) { return resourceService.queryResourceBaseDir(loginUser, type); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java index cd714ae236fa5..164127c4e6810 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java @@ -27,7 +27,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_SCHEDULE_ERROR; import static org.apache.dolphinscheduler.common.constants.Constants.SESSION_USER; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.SchedulerService; @@ -106,7 +105,6 @@ public class SchedulerController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode") long processDefinitionCode, @@ -164,7 +162,6 @@ public Result createSchedule(@Parameter(hidden = true) @RequestAttribute(value = @PutMapping("/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id, @@ -197,7 +194,6 @@ public Result updateSchedule(@Parameter(hidden = true) @RequestAttribute(value = }) @PostMapping("/{id}/online") @ApiException(PUBLISH_SCHEDULE_ONLINE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result publishScheduleOnline(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { @@ -219,7 +215,6 @@ public Result publishScheduleOnline(@Parameter(hidden = true) @RequestAttribute( }) @PostMapping("/{id}/offline") @ApiException(OFFLINE_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result offlineSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { @@ -247,7 +242,6 @@ public Result offlineSchedule(@Parameter(hidden = true) @RequestAttribute(value }) @GetMapping() @ApiException(QUERY_SCHEDULE_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryScheduleListPaging(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode", required = false, defaultValue = "0") long processDefinitionCode, @@ -280,7 +274,6 @@ public Result queryScheduleListPaging(@Parameter(hidden = true) @RequestAttribut @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteScheduleById(@RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { @@ -298,7 +291,6 @@ public Result deleteScheduleById(@RequestAttribute(value = SESSION_USER) User lo @Operation(summary = "queryScheduleList", description = "QUERY_SCHEDULE_LIST_NOTES") @PostMapping("/list") @ApiException(QUERY_SCHEDULE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryScheduleList(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = schedulerService.queryScheduleList(loginUser, projectCode); @@ -319,7 +311,6 @@ public Result queryScheduleList(@Parameter(hidden = true) @RequestAttribute(valu @PostMapping("/preview") @ResponseStatus(HttpStatus.CREATED) @ApiException(PREVIEW_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result previewSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @RequestParam(value = "schedule") String schedule) { Map result = schedulerService.previewSchedule(loginUser, schedule); @@ -355,7 +346,6 @@ public Result previewSchedule(@Parameter(hidden = true) @RequestAttribute(value @PutMapping("/update/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateScheduleByProcessDefinitionCode(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long processDefinitionCode, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java index ab376184ff3a3..e22e0eb00d003 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java @@ -28,7 +28,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.SWITCH_TASK_DEFINITION_VERSION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskDefinitionService; @@ -89,7 +88,6 @@ public class TaskDefinitionController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskDefinitionJson", required = true) String taskDefinitionJson) { @@ -118,7 +116,6 @@ public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(v @PostMapping("/save-single") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createTaskBindsWorkFlow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode", required = true) long processDefinitionCode, @@ -147,7 +144,6 @@ public Result createTaskBindsWorkFlow(@Parameter(hidden = true) @RequestAttribut @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -177,7 +173,6 @@ public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(v @PutMapping(value = "/{code}/with-upstream") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateTaskWithUpstream(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -208,7 +203,6 @@ public Result updateTaskWithUpstream(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/{code}/versions") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_DEFINITION_VERSIONS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskDefinitionVersions(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -238,7 +232,6 @@ public Result queryTaskDefinitionVersions(@Parameter(hidden = true) @RequestAttr @GetMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(SWITCH_TASK_DEFINITION_VERSION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result switchTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -264,7 +257,6 @@ public Result switchTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttr @DeleteMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_DEFINITION_VERSION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @@ -289,7 +281,6 @@ public Result deleteTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttr @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_DEFINE_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteTaskDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code) { @@ -312,7 +303,6 @@ public Result deleteTaskDefinitionByCode(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskDefinitionDetail(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code) { @@ -346,7 +336,6 @@ public Result queryTaskDefinitionDetail(@Parameter(hidden = true) @RequestAttrib @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_DEFINITION_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskDefinitionListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "searchTaskName", required = false) String searchTaskName, @@ -377,7 +366,6 @@ public Result queryTaskDefinitionListPaging(@Parameter(hidden = true) @RequestAt @GetMapping(value = "/gen-task-codes") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result genTaskCodeList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("genNum") Integer genNum) { Map result = taskDefinitionService.genTaskCodeList(genNum); @@ -402,7 +390,6 @@ public Result genTaskCodeList(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/{code}/release") @ResponseStatus(HttpStatus.OK) @ApiException(RELEASE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result releaseTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java index 038ec8a8a5e9c..498b695fcd30a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.START_TASK_GROUP_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_GROUP_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskGroupQueueService; import org.apache.dolphinscheduler.api.service.TaskGroupService; @@ -82,7 +81,6 @@ public class TaskGroupController extends BaseController { @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("name") String name, @RequestParam(value = "projectCode", required = false, defaultValue = "0") Long projectcode, @@ -114,7 +112,6 @@ public Result createTaskGroup(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/update") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_TASK_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") Integer id, @RequestParam("name") String name, @@ -141,7 +138,6 @@ public Result updateTaskGroup(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "status", required = false) Integer status, @@ -169,7 +165,6 @@ public Result queryAllTaskGroup(@Parameter(hidden = true) @RequestAttribute(valu @GetMapping(value = "/query-list-by-status") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskGroupByStatus(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "status", required = false) Integer status, @@ -196,7 +191,6 @@ public Result queryTaskGroupByStatus(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/query-list-by-projectCode") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskGroupByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "projectCode", required = false) Long projectCode, @@ -220,7 +214,6 @@ public Result queryTaskGroupByCode(@Parameter(hidden = true) @RequestAttribute(v @PostMapping(value = "/close-task-group") @ResponseStatus(HttpStatus.CREATED) @ApiException(CLOSE_TASK_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result closeTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id", required = false) Integer id) { @@ -242,7 +235,6 @@ public Result closeTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/start-task-group") @ResponseStatus(HttpStatus.CREATED) @ApiException(START_TASK_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result startTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id", required = false) Integer id) { Map result = taskGroupService.startTaskGroup(loginUser, id); @@ -263,7 +255,6 @@ public Result startTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/forceStart") @ResponseStatus(HttpStatus.CREATED) @ApiException(START_TASK_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result forceStart(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queueId") Integer queueId) { Map result = taskGroupService.forceStartTask(loginUser, queueId); @@ -285,7 +276,6 @@ public Result forceStart(@Parameter(hidden = true) @RequestAttribute(value = Con @PostMapping(value = "/modifyPriority") @ResponseStatus(HttpStatus.CREATED) @ApiException(START_TASK_GROUP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result modifyPriority(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queueId") Integer queueId, @RequestParam(value = "priority") Integer priority) { @@ -320,7 +310,6 @@ public Result modifyPriority(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/query-list-by-group-id") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_QUEUE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTasksByGroupId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "groupId", required = false, defaultValue = "-1") Integer groupId, @RequestParam(value = "taskInstanceName", required = false) String taskName, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java index 8c032b399ecab..071ecfe8ba623 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_SAVEPOINT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_STOP_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.taskInstance.TaskInstanceRemoveCacheResponse; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskInstanceService; @@ -98,7 +97,6 @@ public class TaskInstanceController extends BaseController { @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processInstanceId", required = false, defaultValue = "0") Integer processInstanceId, @@ -153,7 +151,6 @@ public Result queryTaskListPaging(@Parameter(hidden = true) @RequestAttribute(va @PostMapping(value = "/{id}/force-success") @ResponseStatus(HttpStatus.OK) @ApiException(FORCE_TASK_SUCCESS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result forceTaskSuccess(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Schema(name = "projectCode", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { @@ -175,7 +172,6 @@ public Result forceTaskSuccess(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/{id}/savepoint") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_SAVEPOINT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result taskSavePoint(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { @@ -197,7 +193,6 @@ public Result taskSavePoint(@Parameter(hidden = true) @RequestAttribute( @PostMapping(value = "/{id}/stop") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_STOP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result stopTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { @@ -219,7 +214,6 @@ public Result stopTask(@Parameter(hidden = true) @RequestAttribute(value @DeleteMapping(value = "/{id}/remove-cache") @ResponseStatus(HttpStatus.OK) @ApiException(REMOVE_TASK_INSTANCE_CACHE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public TaskInstanceRemoveCacheResponse removeTaskInstanceCache(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java index ee6aea9150f15..4e7367263af34 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TENANT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_OS_TENANT_CODE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TenantService; import org.apache.dolphinscheduler.api.utils.Result; @@ -82,7 +81,6 @@ public class TenantController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TENANT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createTenant(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "tenantCode") String tenantCode, @RequestParam(value = "queueId") int queueId, @@ -110,7 +108,6 @@ public Result createTenant(@Parameter(hidden = true) @RequestAttribute(value = C @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TENANT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTenantlistPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @@ -135,7 +132,6 @@ public Result queryTenantlistPaging(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TENANT_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTenantlist(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = tenantService.queryTenantList(loginUser); return returnDataList(result); @@ -161,7 +157,6 @@ public Result queryTenantlist(@Parameter(hidden = true) @RequestAttribute(value @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TENANT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateTenant(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "tenantCode") String tenantCode, @@ -186,7 +181,6 @@ public Result updateTenant(@Parameter(hidden = true) @RequestAttribute(value = C @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TENANT_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteTenantById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) throws Exception { Map result = tenantService.deleteTenantById(loginUser, id); @@ -207,7 +201,6 @@ public Result deleteTenantById(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/verify-code") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_OS_TENANT_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyTenantCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "tenantCode") String tenantCode) { return tenantService.verifyTenantCode(tenantCode); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java index a8b5fd5f6016a..462db262538da 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java @@ -19,7 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PLUGINS_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.UiPluginService; import org.apache.dolphinscheduler.api.utils.Result; @@ -66,7 +65,6 @@ public class UiPluginController extends BaseController { @GetMapping(value = "/query-by-type") @ResponseStatus(HttpStatus.CREATED) @ApiException(QUERY_PLUGINS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUiPluginsByType(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "pluginType") PluginType pluginType) { @@ -81,7 +79,6 @@ public Result queryUiPluginsByType(@Parameter(hidden = true) @RequestAttribute(v @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(QUERY_PLUGINS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer pluginId) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java index a96b088bfbb19..855d2e37725f3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java @@ -33,7 +33,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.USER_LIST_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_USERNAME_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.UsersService; @@ -102,7 +101,6 @@ public class UsersController extends BaseController { @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "userPassword"}) public Result createUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @@ -138,7 +136,6 @@ public Result createUser(@Parameter(hidden = true) @RequestAttribute(value = Con @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_USER_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryUserList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @@ -180,7 +177,6 @@ public Result queryUserList(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "userPassword"}) public Result updateUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id, @RequestParam(value = "userName") String userName, @@ -210,7 +206,6 @@ public Result updateUser(@Parameter(hidden = true) @RequestAttribute(value = Con @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_USER_BY_ID_ERROR) - @AccessLogAnnotation public Result delUserById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) throws Exception { Map result = usersService.deleteUserById(loginUser, id); @@ -233,7 +228,6 @@ public Result delUserById(@Parameter(hidden = true) @RequestAttribute(value = Co @PostMapping(value = "/revoke-project-by-id") @ResponseStatus(HttpStatus.OK) @ApiException(REVOKE_PROJECT_ERROR) - @AccessLogAnnotation public Result revokeProjectById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectIds") String projectIds) { @@ -257,7 +251,6 @@ public Result revokeProjectById(@Parameter(hidden = true) @RequestAttribute(valu @PostMapping(value = "/grant-project-with-read-perm") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_PROJECT_ERROR) - @AccessLogAnnotation public Result grantProjectWithReadPerm(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectIds") String projectIds) { @@ -281,7 +274,6 @@ public Result grantProjectWithReadPerm(@Parameter(hidden = true) @RequestAttribu @PostMapping(value = "/grant-project") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_PROJECT_ERROR) - @AccessLogAnnotation public Result grantProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectIds") String projectIds) { @@ -305,7 +297,6 @@ public Result grantProject(@Parameter(hidden = true) @RequestAttribute(value = C @PostMapping(value = "/grant-project-by-code") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_PROJECT_ERROR) - @AccessLogAnnotation public Result grantProjectByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectCode") long projectCode) { @@ -329,7 +320,6 @@ public Result grantProjectByCode(@Parameter(hidden = true) @RequestAttribute(val @PostMapping(value = "/revoke-project") @ResponseStatus(HttpStatus.OK) @ApiException(REVOKE_PROJECT_ERROR) - @AccessLogAnnotation public Result revokeProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectCode") long projectCode) { @@ -353,7 +343,6 @@ public Result revokeProject(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/grant-file") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_RESOURCE_ERROR) - @AccessLogAnnotation public Result grantResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "resourceIds") String resourceIds) { @@ -377,7 +366,6 @@ public Result grantResource(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/grant-udf-func") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_UDF_FUNCTION_ERROR) - @AccessLogAnnotation public Result grantUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "udfIds") String udfIds) { @@ -401,7 +389,6 @@ public Result grantUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = C @PostMapping(value = "/grant-namespace") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_K8S_NAMESPACE_ERROR) - @AccessLogAnnotation public Result grantNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "namespaceIds") String namespaceIds) { @@ -425,7 +412,6 @@ public Result grantNamespace(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping(value = "/grant-datasource") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_DATASOURCE_ERROR) - @AccessLogAnnotation public Result grantDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "datasourceIds") String datasourceIds) { @@ -443,7 +429,6 @@ public Result grantDataSource(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/get-user-info") @ResponseStatus(HttpStatus.OK) @ApiException(GET_USER_INFO_ERROR) - @AccessLogAnnotation public Result getUserInfo(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = usersService.getUserInfo(loginUser); return returnDataList(result); @@ -459,7 +444,6 @@ public Result getUserInfo(@Parameter(hidden = true) @RequestAttribute(value = Co @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(USER_LIST_ERROR) - @AccessLogAnnotation public Result listUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = usersService.queryAllGeneralUsers(loginUser); return returnDataList(result); @@ -474,7 +458,6 @@ public Result listUser(@Parameter(hidden = true) @RequestAttribute(value = Const @GetMapping(value = "/list-all") @ResponseStatus(HttpStatus.OK) @ApiException(USER_LIST_ERROR) - @AccessLogAnnotation public Result listAll(@RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = usersService.queryUserList(loginUser); return returnDataList(result); @@ -494,7 +477,6 @@ public Result listAll(@RequestAttribute(value = Constants.SESSION_USER) User log @GetMapping(value = "/verify-user-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_USERNAME_ERROR) - @AccessLogAnnotation public Result verifyUserName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName) { return usersService.verifyUserName(userName); @@ -514,7 +496,6 @@ public Result verifyUserName(@Parameter(hidden = true) @RequestAttribute(value = @GetMapping(value = "/unauth-user") @ResponseStatus(HttpStatus.OK) @ApiException(UNAUTHORIZED_USER_ERROR) - @AccessLogAnnotation public Result unauthorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId) { Map result = usersService.unauthorizedUser(loginUser, alertgroupId); @@ -535,7 +516,6 @@ public Result unauthorizedUser(@Parameter(hidden = true) @RequestAttribute(value @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @ApiException(AUTHORIZED_USER_ERROR) - @AccessLogAnnotation public Result authorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId) { try { @@ -565,7 +545,6 @@ public Result authorizedUser(@Parameter(hidden = true) @RequestAttribute(value = @PostMapping("/register") @ResponseStatus(HttpStatus.OK) @ApiException(CREATE_USER_ERROR) - @AccessLogAnnotation public Result registerUser(@RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @RequestParam(value = "repeatPassword") String repeatPassword, @@ -594,7 +573,6 @@ public Result registerUser(@RequestParam(value = "userName") String user @PostMapping("/activate") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_USER_ERROR) - @AccessLogAnnotation public Result activateUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName) { userName = ParameterUtils.handleEscapes(userName); @@ -614,7 +592,6 @@ public Result activateUser(@Parameter(hidden = true) @RequestAttribute(v @PostMapping("/batch/activate") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_USER_ERROR) - @AccessLogAnnotation public Result batchActivateUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody List userNames) { List formatUserNames = diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java index cc25f16406d31..4dc4973506a01 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_WITH_DEPENDENT_ERROR; import static org.apache.dolphinscheduler.common.constants.Constants.SESSION_USER; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.exceptions.ServiceException; @@ -70,7 +69,6 @@ public class WorkFlowLineageController extends BaseController { @Operation(summary = "queryLineageByWorkFlowName", description = "QUERY_WORKFLOW_LINEAGE_BY_NAME_NOTES") @GetMapping(value = "/query-by-name") @ResponseStatus(HttpStatus.OK) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryWorkFlowLineageByName(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "workFlowName", required = false) String workFlowName) { @@ -87,7 +85,6 @@ public Result> queryWorkFlowLineageByName(@Parameter(hidde @Operation(summary = "queryLineageByWorkFlowCode", description = "QUERY_WORKFLOW_LINEAGE_BY_CODE_NOTE") @GetMapping(value = "/{workFlowCode}") @ResponseStatus(HttpStatus.OK) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryWorkFlowLineageByCode(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "workFlowCode", required = true) long workFlowCode) { @@ -103,7 +100,6 @@ public Result> queryWorkFlowLineageByCode(@Parameter(hidden @Operation(summary = "queryWorkFlowList", description = "QUERY_WORKFLOW_LINEAGE_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryWorkFlowLineage(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { try { @@ -133,7 +129,6 @@ public Result> queryWorkFlowLineage(@Parameter(hidden = true @PostMapping(value = "/tasks/verify-delete") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_WITH_DEPENDENT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result verifyTaskCanDelete(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode", required = true) long processDefinitionCode, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java index 115c20c76f2a6..29be9c61dfe5f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java @@ -22,7 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_WORKER_GROUP_FAIL; import static org.apache.dolphinscheduler.api.enums.Status.SAVE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.WorkerGroupService; import org.apache.dolphinscheduler.api.utils.Result; @@ -81,7 +80,6 @@ public class WorkerGroupController extends BaseController { @PostMapping() @ResponseStatus(HttpStatus.OK) @ApiException(SAVE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result saveWorkerGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id", required = false, defaultValue = "0") int id, @RequestParam(value = "name") String name, @@ -111,7 +109,6 @@ public Result saveWorkerGroup(@Parameter(hidden = true) @RequestAttribute(value @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKER_GROUP_FAIL) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllWorkerGroupsPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @@ -136,7 +133,6 @@ public Result queryAllWorkerGroupsPaging(@Parameter(hidden = true) @RequestAttri @GetMapping(value = "/all") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKER_GROUP_FAIL) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryAllWorkerGroups(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = workerGroupService.queryAllGroup(loginUser); return returnDataList(result); @@ -156,7 +152,6 @@ public Result queryAllWorkerGroups(@Parameter(hidden = true) @RequestAttribute(v @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_WORKER_GROUP_FAIL) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteWorkerGroupById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id) { Map result = workerGroupService.deleteWorkerGroupById(loginUser, id); @@ -173,7 +168,6 @@ public Result deleteWorkerGroupById(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/worker-address-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKER_ADDRESS_LIST_FAIL) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryWorkerAddressList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = workerGroupService.getWorkerAddressList(); return returnDataList(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/AccessTokenV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/AccessTokenV2Controller.java index da6a471b0176b..6012c7ad58cbe 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/AccessTokenV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/AccessTokenV2Controller.java @@ -19,7 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.CREATE_ACCESS_TOKEN_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.CreateTokenRequest; import org.apache.dolphinscheduler.api.dto.CreateTokenResponse; @@ -66,7 +65,6 @@ public class AccessTokenV2Controller extends BaseController { @ResponseStatus(HttpStatus.CREATED) @Parameter(name = "createTokenRequest", description = "createTokenRequest", required = true, schema = @Schema(implementation = CreateTokenRequest.class)) @ApiException(CREATE_ACCESS_TOKEN_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public CreateTokenResponse createToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody CreateTokenRequest createTokenRequest) { Result result = accessTokenService.createToken(loginUser, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProcessTaskRelationV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProcessTaskRelationV2Controller.java index 2ae69cec58067..a31c84faf0bd0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProcessTaskRelationV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProcessTaskRelationV2Controller.java @@ -21,7 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_PROCESS_RELATION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_UPSTREAM_TASK_PROCESS_RELATION_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationCreateRequest; import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationDeleteRequest; @@ -75,7 +74,6 @@ public class ProcessTaskRelationV2Controller extends BaseController { @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_TASK_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createTaskRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody TaskRelationCreateRequest TaskRelationCreateRequest) { ProcessTaskRelation processTaskRelation = @@ -97,7 +95,6 @@ public Result createTaskRelation(@Parameter(hidden = true) @DeleteMapping(value = "/{code-pair}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteTaskRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code-pair") String codePair) { TaskRelationDeleteRequest taskRelationDeleteRequest = new TaskRelationDeleteRequest(codePair); @@ -121,7 +118,6 @@ public Result deleteTaskRelation(@Parameter(hidden = true) @RequestAttribute(val @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_UPSTREAM_TASK_PROCESS_RELATION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> updateUpstreamTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody TaskRelationUpdateUpstreamRequest taskRelationUpdateUpstreamRequest) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProjectV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProjectV2Controller.java index 38df7fd132115..c547cfb9a5626 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProjectV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ProjectV2Controller.java @@ -27,7 +27,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UNAUTHORIZED_PROJECT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.project.ProjectCreateRequest; import org.apache.dolphinscheduler.api.dto.project.ProjectCreateResponse; @@ -88,7 +87,6 @@ public class ProjectV2Controller extends BaseController { @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectCreateResponse createProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody ProjectCreateRequest projectCreateRequest) { Result result = projectService.createProject(loginUser, projectCreateRequest.getProjectName(), @@ -108,7 +106,6 @@ public ProjectCreateResponse createProject(@Parameter(hidden = true) @RequestAtt @PutMapping(value = "/{code}", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectUpdateResponse updateProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody ProjectUpdateRequest projectUpdateReq) { @@ -131,7 +128,6 @@ public ProjectUpdateResponse updateProject(@Parameter(hidden = true) @RequestAtt @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_DETAILS_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectQueryResponse queryProjectByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") long code) { Result result = projectService.queryByCode(loginUser, code); @@ -154,7 +150,6 @@ public ProjectQueryResponse queryProjectByCode(@Parameter(hidden = true) @Reques @GetMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectListPagingResponse queryProjectListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, ProjectQueryRequest projectQueryReq) { Result result = checkPageParams(projectQueryReq.getPageNo(), projectQueryReq.getPageSize()); @@ -181,7 +176,6 @@ public ProjectListPagingResponse queryProjectListPaging(@Parameter(hidden = true @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectDeleteResponse deleteProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { Result result = projectService.deleteProject(loginUser, code); @@ -202,7 +196,6 @@ public ProjectDeleteResponse deleteProject(@Parameter(hidden = true) @RequestAtt @GetMapping(value = "/unauth-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UNAUTHORIZED_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectListResponse queryUnauthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Result result = projectService.queryUnauthorizedProject(loginUser, userId); @@ -223,7 +216,6 @@ public ProjectListResponse queryUnauthorizedProject(@Parameter(hidden = true) @R @GetMapping(value = "/authed-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_PROJECT) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectListResponse queryAuthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Result result = projectService.queryAuthorizedProject(loginUser, userId); @@ -244,7 +236,6 @@ public ProjectListResponse queryAuthorizedProject(@Parameter(hidden = true) @Req @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_USER) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public UserListResponse queryAuthorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectCode") Long projectCode) { Result result = projectService.queryAuthorizedUser(loginUser, projectCode); @@ -264,7 +255,6 @@ public UserListResponse queryAuthorizedUser(@Parameter(hidden = true) @RequestAt @GetMapping(value = "/created-and-authed") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectListResponse queryProjectCreatedAndAuthorizedByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = projectService.queryProjectCreatedAndAuthorizedByUser(loginUser); return new ProjectListResponse(result); @@ -283,7 +273,6 @@ public ProjectListResponse queryProjectCreatedAndAuthorizedByUser(@Parameter(hid @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectListResponse queryAllProjectList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = projectService.queryAllProjectList(loginUser); return new ProjectListResponse(result); @@ -299,7 +288,6 @@ public ProjectListResponse queryAllProjectList(@Parameter(hidden = true) @Reques @GetMapping(value = "/list-dependent") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public ProjectListResponse queryAllProjectListForDependent(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = projectService.queryAllProjectListForDependent(); return new ProjectListResponse(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/QueueV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/QueueV2Controller.java index 843cc2f508aa5..5a7c3329102d5 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/QueueV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/QueueV2Controller.java @@ -22,7 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_QUEUE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_QUEUE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.queue.QueueCreateRequest; import org.apache.dolphinscheduler.api.dto.queue.QueueCreateResponse; @@ -79,7 +78,6 @@ public class QueueV2Controller extends BaseController { @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public QueueListResponse queryList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = queueService.queryList(loginUser); return new QueueListResponse(result); @@ -101,7 +99,6 @@ public QueueListResponse queryList(@Parameter(hidden = true) @RequestAttribute(v @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public QueueListPagingResponse queryQueueListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, QueueQueryRequest queueQueryRequest) { Result result = checkPageParams(queueQueryRequest.getPageNo(), queueQueryRequest.getPageSize()); @@ -126,7 +123,6 @@ public QueueListPagingResponse queryQueueListPaging(@Parameter(hidden = true) @R @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_QUEUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public QueueCreateResponse createQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody QueueCreateRequest queueCreateRequest) { Result result = @@ -149,7 +145,6 @@ public QueueCreateResponse createQueue(@Parameter(hidden = true) @RequestAttribu @PutMapping(value = "/{id}", consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_QUEUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public QueueUpdateResponse updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestBody QueueUpdateRequest queueUpdateRequest) { @@ -169,7 +164,6 @@ public QueueUpdateResponse updateQueue(@Parameter(hidden = true) @RequestAttribu @PostMapping(value = "/verify", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_QUEUE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public QueueVerifyResponse verifyQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody QueueVerifyRequest queueVerifyRequest) { Result result = queueService.verifyQueue(queueVerifyRequest.getQueue(), queueVerifyRequest.getQueueName()); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ScheduleV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ScheduleV2Controller.java index f7f4771033699..7a4e01c2e2a78 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ScheduleV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/ScheduleV2Controller.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_SCHEDULE_LIST_PAGING_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_SCHEDULE_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.schedule.ScheduleCreateRequest; import org.apache.dolphinscheduler.api.dto.schedule.ScheduleFilterRequest; @@ -77,7 +76,6 @@ public class ScheduleV2Controller extends BaseController { @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody ScheduleCreateRequest scheduleCreateRequest) { Schedule schedule = schedulerService.createSchedulesV2(loginUser, scheduleCreateRequest); @@ -97,7 +95,6 @@ public Result createSchedule(@Parameter(hidden = true) @RequestAttribu @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id) { schedulerService.deleteSchedulesById(loginUser, id); @@ -116,7 +113,6 @@ public Result deleteSchedule(@Parameter(hidden = true) @RequestAttribute(value = @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_SCHEDULE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id, @RequestBody ScheduleUpdateRequest scheduleUpdateRequest) { @@ -135,7 +131,6 @@ public Result updateSchedule(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_SCHEDULE_LIST_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result getSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id) { Schedule schedule = schedulerService.getSchedule(loginUser, id); @@ -153,7 +148,6 @@ public Result getSchedule(@Parameter(hidden = true) @RequestAttribute( @PostMapping(value = "/filter", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_SCHEDULE_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> filterSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody ScheduleFilterRequest scheduleFilterRequest) { PageInfo schedules = schedulerService.filterSchedules(loginUser, scheduleFilterRequest); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/StatisticsV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/StatisticsV2Controller.java index bcb9989e2f052..bab04989f3c7a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/StatisticsV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/StatisticsV2Controller.java @@ -24,7 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_STATES_COUNT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_WORKFLOW_STATES_COUNT_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.project.StatisticsStateRequest; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -70,7 +69,6 @@ public class StatisticsV2Controller extends BaseController { @GetMapping(value = "/workflows/count") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALL_WORKFLOW_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryWorkflowInstanceCounts(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = dataAnalysisService.queryAllWorkflowCounts(loginUser); return returnDataList(result); @@ -86,7 +84,6 @@ public Result queryWorkflowInstanceCounts(@Parameter(hidden = true) @RequestAttr @GetMapping(value = "/workflows/states/count") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKFLOW_STATES_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryWorkflowStatesCounts(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody(required = false) StatisticsStateRequest statisticsStateRequest) { Map result = @@ -104,7 +101,6 @@ public Result queryWorkflowStatesCounts(@Parameter(hidden = true) @RequestAttrib @GetMapping(value = "/{workflowCode}/states/count") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ONE_WORKFLOW_STATE_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryOneWorkflowStates(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("workflowCode") Long workflowCode) { Map result = @@ -122,7 +118,6 @@ public Result queryOneWorkflowStates(@Parameter(hidden = true) @RequestAttribute @GetMapping(value = "/tasks/states/count") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_STATES_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryTaskStatesCounts(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody(required = false) StatisticsStateRequest statisticsStateRequest) { Map result = @@ -140,7 +135,6 @@ public Result queryTaskStatesCounts(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/tasks/{taskCode}/states/count") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ONE_TASK_STATES_COUNT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryOneTaskStatesCounts(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("taskCode") Long taskCode) { Map result = @@ -158,7 +152,6 @@ public Result queryOneTaskStatesCounts(@Parameter(hidden = true) @RequestAttribu @GetMapping(value = "/workflows/users/count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_DEFINITION_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody(required = false) StatisticsStateRequest statisticsStateRequest) { String projectName = statisticsStateRequest.getProjectName(); @@ -180,7 +173,6 @@ public Result countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute( @GetMapping(value = "/workflows/users/{userId}/count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_DEFINITION_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countDefinitionByUserId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("userId") Integer userId) { Map result = dataAnalysisService.countDefinitionByUserV2(loginUser, null, userId, null); @@ -197,7 +189,6 @@ public Result countDefinitionByUserId(@Parameter(hidden = true) @RequestAttribut @GetMapping(value = "/workflows/users/{userId}/{releaseState}/count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_DEFINITION_USER_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result countDefinitionByUserState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("userId") Integer userId, @PathVariable("releaseState") Integer releaseState) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskDefinitionV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskDefinitionV2Controller.java index 26e89882ae9d2..66fff8cbe9998 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskDefinitionV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskDefinitionV2Controller.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest; import org.apache.dolphinscheduler.api.dto.task.TaskFilterRequest; @@ -77,7 +76,6 @@ public class TaskDefinitionV2Controller extends BaseController { @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody TaskCreateRequest taskCreateRequest) { TaskDefinition taskDefinition = taskDefinitionService.createTaskDefinitionV2(loginUser, taskCreateRequest); @@ -97,7 +95,6 @@ public Result createTaskDefinition(@Parameter(hidden = true) @Re @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { taskDefinitionService.deleteTaskDefinitionByCode(loginUser, code); @@ -119,7 +116,6 @@ public Result deleteTaskDefinition(@Parameter(hidden = true) @RequestAttribute(v @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody TaskUpdateRequest taskUpdateRequest) { @@ -142,7 +138,6 @@ public Result updateTaskDefinition(@Parameter(hidden = true) @Re @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_TASK_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result getTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { TaskDefinition taskDefinition = taskDefinitionService.getTaskDefinition(loginUser, code); @@ -160,7 +155,6 @@ public Result getTaskDefinition(@Parameter(hidden = true) @Reque @PostMapping(value = "/query", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> filterTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody TaskFilterRequest taskFilterRequest) { PageInfo taskDefinitions = diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2Controller.java index 20f5cdb583920..1f2f1db5d06f1 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/TaskInstanceV2Controller.java @@ -23,7 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_SAVEPOINT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_STOP_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.taskInstance.TaskInstanceListPagingResponse; import org.apache.dolphinscheduler.api.dto.taskInstance.TaskInstanceQueryRequest; @@ -90,7 +89,6 @@ public class TaskInstanceV2Controller extends BaseController { @GetMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public TaskInstanceListPagingResponse queryTaskListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, TaskInstanceQueryRequest taskInstanceQueryReq) { @@ -125,7 +123,6 @@ public TaskInstanceListPagingResponse queryTaskListPaging(@Parameter(hidden = tr @PostMapping(value = "/{id}/savepoint") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_SAVEPOINT_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result taskSavePoint(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { @@ -147,7 +144,6 @@ public Result taskSavePoint(@Parameter(hidden = true) @RequestAttribute( @PostMapping(value = "/{id}/stop") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_STOP_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result stopTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { @@ -169,7 +165,6 @@ public Result stopTask(@Parameter(hidden = true) @RequestAttribute(value @PostMapping(value = "/{id}/force-success", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(FORCE_TASK_SUCCESS_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public TaskInstanceSuccessResponse forceTaskSuccess(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { @@ -192,7 +187,6 @@ public TaskInstanceSuccessResponse forceTaskSuccess(@Parameter(hidden = true) @R @PostMapping(value = "/{taskInstanceId}", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public TaskInstance queryTaskInstanceByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "taskInstanceId") Long taskInstanceId) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowInstanceV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowInstanceV2Controller.java index 92c231f2d7473..eecd0605cec30 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowInstanceV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowInstanceV2Controller.java @@ -17,7 +17,6 @@ package org.apache.dolphinscheduler.api.controller.v2; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceQueryRequest; import org.apache.dolphinscheduler.api.enums.ExecuteType; @@ -73,7 +72,6 @@ public class WorkflowInstanceV2Controller extends BaseController { @GetMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryWorkflowInstanceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody WorkflowInstanceQueryRequest workflowInstanceQueryRequest) { Result result = @@ -100,7 +98,6 @@ public Result queryWorkflowInstanceListPaging(@Parameter(hidden = true) @Request @GetMapping(value = "/{workflowInstanceId}") @ResponseStatus(HttpStatus.OK) @ApiException(Status.QUERY_PROCESS_INSTANCE_BY_ID_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result queryWorkflowInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("workflowInstanceId") Integer workflowInstanceId) { Map result = processInstanceService.queryProcessInstanceById(loginUser, workflowInstanceId); @@ -121,7 +118,6 @@ public Result queryWorkflowInstanceById(@Parameter(hidden = true) @RequestAttrib @DeleteMapping(value = "/{workflowInstanceId}") @ResponseStatus(HttpStatus.OK) @ApiException(Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteWorkflowInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("workflowInstanceId") Integer workflowInstanceId) { processInstanceService.deleteProcessInstanceById(loginUser, workflowInstanceId); @@ -144,7 +140,6 @@ public Result deleteWorkflowInstance(@Parameter(hidden = true) @RequestAtt @PostMapping(value = "/{workflowInstanceId}/execute/{executeType}") @ResponseStatus(HttpStatus.OK) @ApiException(Status.EXECUTE_PROCESS_INSTANCE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("workflowInstanceId") Integer workflowInstanceId, @PathVariable("executeType") ExecuteType executeType) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowV2Controller.java index 5f0c99872fd36..055168126b2d1 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/v2/WorkflowV2Controller.java @@ -22,7 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR; -import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.dto.workflow.WorkflowCreateRequest; import org.apache.dolphinscheduler.api.dto.workflow.WorkflowFilterRequest; @@ -76,7 +75,6 @@ public class WorkflowV2Controller extends BaseController { @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result createWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody WorkflowCreateRequest workflowCreateRequest) { ProcessDefinition processDefinition = @@ -98,7 +96,6 @@ public Result createWorkflow(@Parameter(hidden = true) @Reque @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_DEFINE_BY_CODE_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { processDefinitionService.deleteProcessDefinitionByCode(loginUser, code); @@ -117,7 +114,6 @@ public Result deleteWorkflow(@Parameter(hidden = true) @RequestAttribute(value = @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_DEFINITION_ERROR) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result updateWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody WorkflowUpdateRequest workflowUpdateRequest) { @@ -137,7 +133,6 @@ public Result updateWorkflow(@Parameter(hidden = true) @Reque @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result getWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { ProcessDefinition processDefinition = processDefinitionService.getProcessDefinition(loginUser, code); @@ -155,7 +150,6 @@ public Result getWorkflow(@Parameter(hidden = true) @RequestA @PostMapping(value = "/query", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) - @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> filterWorkflows(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody WorkflowFilterRequest workflowFilterRequest) { PageInfo processDefinitions = diff --git a/dolphinscheduler-api/src/main/resources/application.yaml b/dolphinscheduler-api/src/main/resources/application.yaml index 911b8ac106100..081381466e5cb 100644 --- a/dolphinscheduler-api/src/main/resources/application.yaml +++ b/dolphinscheduler-api/src/main/resources/application.yaml @@ -26,6 +26,9 @@ server: mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml jetty: max-http-form-post-size: 5000000 + accesslog: + enabled: true + custom-format: '%{client}a - %u %t "%r" %s %O %{ms}Tms' spring: banner: diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspectTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspectTest.java deleted file mode 100644 index 44ddae818d916..0000000000000 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/aspect/AccessLogAspectTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.api.aspect; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -/** - * @author Hua Jiang - */ - -public class AccessLogAspectTest { - - private AccessLogAspect accessLogAspect = new AccessLogAspect(); - - @Test - public void testHandleSensitiveData() { - String data = - "userPassword='7ad2410b2f4c074479a8937a28a22b8f', email='xxx@qq.com', database='null', userName='root', password='root', other='null'"; - String expected = - "userPassword='********************************', email='xxx@qq.com', database='null', userName='root', password='****', other='null'"; - - String actual = accessLogAspect.handleSensitiveData(data); - - Assertions.assertEquals(expected, actual); - } - -} diff --git a/dolphinscheduler-standalone-server/src/main/resources/application.yaml b/dolphinscheduler-standalone-server/src/main/resources/application.yaml index a9250b7392ef1..7453ce81d3cfe 100644 --- a/dolphinscheduler-standalone-server/src/main/resources/application.yaml +++ b/dolphinscheduler-standalone-server/src/main/resources/application.yaml @@ -242,6 +242,9 @@ server: mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml jetty: max-http-form-post-size: 5000000 + accesslog: + enabled: true + custom-format: '%{client}a - %u %t "%r" %s %O %{ms}Tms' management: endpoints: