Browse Source

[Fix] Fix audit log parma typo (#16077)

upstream-dev
旺阳 5 months ago committed by GitHub
parent
commit
e93ed78c0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/OperatorUtils.java
  2. 16
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/BaseAuditOperator.java
  3. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/AlertGroupAuditOperatorImpl.java
  4. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/AlertInstanceAuditOperatorImpl.java
  5. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ClusterAuditOperatorImpl.java
  6. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/DatasourceAuditOperatorImpl.java
  7. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/EnvironmentAuditOperatorImpl.java
  8. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/K8SNamespaceAuditOperatorImpl.java
  9. 8
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ProcessAuditOperatorImpl.java
  10. 8
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ProcessInstanceAuditOperatorImpl.java
  11. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ProjectAuditOperatorImpl.java
  12. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ResourceAuditOperatorImpl.java
  13. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ScheduleAuditOperatorImpl.java
  14. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TaskAuditOperatorImpl.java
  15. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TaskGroupAuditOperatorImpl.java
  16. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TaskInstancesAuditOperatorImpl.java
  17. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TenantAuditOperatorImpl.java
  18. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TokenAuditOperatorImpl.java
  19. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/UdfFunctionAuditOperatorImpl.java
  20. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/UserAuditOperatorImpl.java
  21. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/WorkerGroupAuditOperatorImpl.java
  22. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/YarnQueueAuditOperatorImpl.java
  23. 2
      dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/generator/sources/HdfsSourceGenerator.java
  24. 4
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-linkis.ts

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/OperatorUtils.java

@ -126,7 +126,7 @@ public class OperatorUtils {
return auditType.getAuditOperationType();
}
public static long getObjectIdentityByParma(String[] paramNameArr, Map<String, Object> paramsMap) {
public static long getObjectIdentityByParam(String[] paramNameArr, Map<String, Object> paramsMap) {
for (String name : paramNameArr) {
if (paramsMap.get(name) instanceof String) {
String param = (String) paramsMap.get(name);

16
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/BaseAuditOperator.java

@ -80,14 +80,14 @@ public abstract class BaseAuditOperator implements AuditOperator {
}
modifyRequestParams(paramNameArr, paramsMap, auditLogList);
setObjectByParma(paramNameArr, paramsMap, auditLogList);
setObjectByParam(paramNameArr, paramsMap, auditLogList);
if (auditLogList.get(0).getModelId() == null) {
auditLogList.get(0).setModelId(OperatorUtils.getObjectIdentityByParma(paramNameArr, paramsMap));
auditLogList.get(0).setModelId(OperatorUtils.getObjectIdentityByParam(paramNameArr, paramsMap));
}
}
protected void setObjectByParma(String[] paramNameArr, Map<String, Object> paramsMap,
protected void setObjectByParam(String[] paramNameArr, Map<String, Object> paramsMap,
List<AuditLog> auditLogList) {
String name = paramNameArr[0];
@ -97,7 +97,7 @@ public abstract class BaseAuditOperator implements AuditOperator {
return;
}
String objName = getObjectNameFromReturnIdentity(value);
String objName = getObjectNameFromIdentity(value);
if (Strings.isNullOrEmpty(objName)) {
auditLogList.get(0).setModelName(value.toString());
@ -114,7 +114,7 @@ public abstract class BaseAuditOperator implements AuditOperator {
auditLogList.get(0).setModelName(objName);
}
protected void setObjectByParmaArr(String[] paramNameArr, Map<String, Object> paramsMap,
protected void setObjectByParamArr(String[] paramNameArr, Map<String, Object> paramsMap,
List<AuditLog> auditLogList) {
AuditLog auditLog = auditLogList.get(0);
@ -127,7 +127,7 @@ public abstract class BaseAuditOperator implements AuditOperator {
for (String identityString : identityArr) {
long identity = toLong(identityString);
String value = getObjectNameFromReturnIdentity(identity);
String value = getObjectNameFromIdentity(identity);
if (value == null) {
continue;
@ -156,7 +156,7 @@ public abstract class BaseAuditOperator implements AuditOperator {
protected void setObjectNameFromReturnIdentity(List<AuditLog> auditLogList) {
auditLogList
.forEach(auditLog -> auditLog.setModelName(getObjectNameFromReturnIdentity(auditLog.getModelId())));
.forEach(auditLog -> auditLog.setModelName(getObjectNameFromIdentity(auditLog.getModelId())));
}
protected void modifyObjectFromReturnObject(String[] params, Map<String, Object> returnObjectMap,
@ -180,7 +180,7 @@ public abstract class BaseAuditOperator implements AuditOperator {
return NumberUtils.toLong(str.toString(), -1);
}
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
return identity.toString();
}

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/AlertGroupAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class AlertGroupAuditOperatorImpl extends BaseAuditOperator {
private AlertGroupMapper alertGroupMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/AlertInstanceAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class AlertInstanceAuditOperatorImpl extends BaseAuditOperator {
private AlertPluginInstanceMapper alertPluginInstanceMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ClusterAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class ClusterAuditOperatorImpl extends BaseAuditOperator {
private ClusterMapper clusterMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/DatasourceAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class DatasourceAuditOperatorImpl extends BaseAuditOperator {
private DataSourceMapper dataSourceMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/EnvironmentAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class EnvironmentAuditOperatorImpl extends BaseAuditOperator {
private EnvironmentMapper environmentMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/K8SNamespaceAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class K8SNamespaceAuditOperatorImpl extends BaseAuditOperator {
private K8sNamespaceMapper k8sNamespaceMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

8
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ProcessAuditOperatorImpl.java

@ -46,14 +46,14 @@ public class ProcessAuditOperatorImpl extends BaseAuditOperator {
}
@Override
protected void setObjectByParma(String[] paramNameArr, Map<String, Object> paramsMap,
protected void setObjectByParam(String[] paramNameArr, Map<String, Object> paramsMap,
List<AuditLog> auditLogList) {
if (paramNameArr[0].equals(AuditLogConstants.CODES)
|| paramNameArr[0].equals(AuditLogConstants.PROCESS_DEFINITION_CODES)
|| paramNameArr[0].equals(AuditLogConstants.PROCESS_INSTANCE_IDS)) {
super.setObjectByParmaArr(paramNameArr, paramsMap, auditLogList);
super.setObjectByParamArr(paramNameArr, paramsMap, auditLogList);
} else {
super.setObjectByParma(paramNameArr, paramsMap, auditLogList);
super.setObjectByParam(paramNameArr, paramsMap, auditLogList);
}
if (paramsMap.containsKey(AuditLogConstants.VERSION)) {
if (paramsMap.get(AuditLogConstants.VERSION) != null) {
@ -65,7 +65,7 @@ public class ProcessAuditOperatorImpl extends BaseAuditOperator {
}
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

8
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ProcessInstanceAuditOperatorImpl.java

@ -48,17 +48,17 @@ public class ProcessInstanceAuditOperatorImpl extends BaseAuditOperator {
}
@Override
protected void setObjectByParma(String[] paramNameArr, Map<String, Object> paramsMap,
protected void setObjectByParam(String[] paramNameArr, Map<String, Object> paramsMap,
List<AuditLog> auditLogList) {
if (paramNameArr[0].equals(AuditLogConstants.PROCESS_INSTANCE_IDS)) {
super.setObjectByParmaArr(paramNameArr, paramsMap, auditLogList);
super.setObjectByParamArr(paramNameArr, paramsMap, auditLogList);
} else {
super.setObjectByParma(paramNameArr, paramsMap, auditLogList);
super.setObjectByParam(paramNameArr, paramsMap, auditLogList);
}
}
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
int objId = NumberUtils.toInt(identity.toString(), -1);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ProjectAuditOperatorImpl.java

@ -34,7 +34,7 @@ public class ProjectAuditOperatorImpl extends BaseAuditOperator {
private ProjectMapper projectMapper;
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ResourceAuditOperatorImpl.java

@ -37,7 +37,7 @@ public class ResourceAuditOperatorImpl extends BaseAuditOperator {
}
@Override
protected void setObjectByParma(String[] paramNameArr, Map<String, Object> paramsMap,
protected void setObjectByParam(String[] paramNameArr, Map<String, Object> paramsMap,
List<AuditLog> auditLogList) {
Object objName = getFileNameFromParam(paramNameArr, paramsMap);

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/ScheduleAuditOperatorImpl.java

@ -72,7 +72,7 @@ public class ScheduleAuditOperatorImpl extends BaseAuditOperator {
}
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TaskAuditOperatorImpl.java

@ -46,17 +46,17 @@ public class TaskAuditOperatorImpl extends BaseAuditOperator {
}
@Override
protected void setObjectByParma(String[] paramNameArr, Map<String, Object> paramsMap,
protected void setObjectByParam(String[] paramNameArr, Map<String, Object> paramsMap,
List<AuditLog> auditLogList) {
super.setObjectByParma(paramNameArr, paramsMap, auditLogList);
super.setObjectByParam(paramNameArr, paramsMap, auditLogList);
if (paramsMap.containsKey(AuditLogConstants.VERSION)) {
auditLogList.get(0).setDetail(paramsMap.get(AuditLogConstants.VERSION).toString());
}
}
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TaskGroupAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class TaskGroupAuditOperatorImpl extends BaseAuditOperator {
private TaskGroupMapper taskGroupMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TaskInstancesAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class TaskInstancesAuditOperatorImpl extends BaseAuditOperator {
private TaskInstanceMapper taskInstanceMapper;
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TenantAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class TenantAuditOperatorImpl extends BaseAuditOperator {
private TenantMapper tenantMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/TokenAuditOperatorImpl.java

@ -54,7 +54,7 @@ public class TokenAuditOperatorImpl extends BaseAuditOperator {
}
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/UdfFunctionAuditOperatorImpl.java

@ -33,7 +33,7 @@ public class UdfFunctionAuditOperatorImpl extends BaseAuditOperator {
private UdfFuncMapper udfFuncMapper;
@Override
protected String getObjectNameFromReturnIdentity(Object identity) {
protected String getObjectNameFromIdentity(Object identity) {
int objId = NumberUtils.toInt(identity.toString(), -1);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/UserAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class UserAuditOperatorImpl extends BaseAuditOperator {
private UserMapper userMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/WorkerGroupAuditOperatorImpl.java

@ -48,7 +48,7 @@ public class WorkerGroupAuditOperatorImpl extends BaseAuditOperator {
}
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/audit/operator/impl/YarnQueueAuditOperatorImpl.java

@ -31,7 +31,7 @@ public class YarnQueueAuditOperatorImpl extends BaseAuditOperator {
private QueueMapper queueMapper;
@Override
public String getObjectNameFromReturnIdentity(Object identity) {
public String getObjectNameFromIdentity(Object identity) {
Long objId = toLong(identity);
if (objId == -1) {
return "";

2
dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/generator/sources/HdfsSourceGenerator.java

@ -57,7 +57,7 @@ public class HdfsSourceGenerator implements ISourceGenerator {
}
}
} catch (Exception e) {
log.error(String.format("Sqoop hdfs source parmas build failed: [%s]", e.getMessage()));
log.error(String.format("Sqoop hdfs source params build failed: [%s]", e.getMessage()));
}
return hdfsSourceSb.toString();

4
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-linkis.ts

@ -23,7 +23,7 @@ export function useLinkis(model: { [field: string]: any }): IJsonItem[] {
const { t } = useI18n()
const configEditorSpan = computed(() => (model.useCustom ? 24 : 0))
const parmaEditorSpan = computed(() => (model.useCustom ? 0 : 24))
const paramEditorSpan = computed(() => (model.useCustom ? 0 : 24))
computed(() => (model.useCustom ? 0 : 24))
return [
{
@ -35,7 +35,7 @@ export function useLinkis(model: { [field: string]: any }): IJsonItem[] {
type: 'custom-parameters',
field: 'paramScript',
name: t('project.node.option_parameters'),
span: parmaEditorSpan,
span: paramEditorSpan,
children: [
{
type: 'input',

Loading…
Cancel
Save