From 3aa46e5432e593197549689731f42cfdffe4a58f Mon Sep 17 00:00:00 2001
From: wmqwxb <13628607970@163.com>
Date: Mon, 18 Dec 2023 08:25:58 +0800
Subject: [PATCH 1/2] boot 2.7.12 to 2.7.18
Signed-off-by: wmqwxb <13628607970@163.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index b91a51a3..4492b36b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.12
+ 2.7.18
From e84af00fa93e34674053834a1fc47265f1c724ae Mon Sep 17 00:00:00 2001
From: "Signed-off-by: wmqwxb" <13628607970@163.com>
Date: Mon, 18 Dec 2023 17:31:04 +0800
Subject: [PATCH 2/2] handle sast
Signed-off-by: wmqwxb <13628607970@163.com>
---
.../fate/board/services/JobDetailService.java | 37 +++++++++++++------
src/main/resources/application.properties | 8 ++--
2 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/src/main/java/org/fedai/fate/board/services/JobDetailService.java b/src/main/java/org/fedai/fate/board/services/JobDetailService.java
index f90f959a..323b3efc 100644
--- a/src/main/java/org/fedai/fate/board/services/JobDetailService.java
+++ b/src/main/java/org/fedai/fate/board/services/JobDetailService.java
@@ -50,22 +50,35 @@ public class JobDetailService {
public String getComponentStaticInfo(String componentName) throws Exception {
String projectDir = System.getProperty("user.dir");
String jsonData = "";
- String yamlFilePath = projectDir + File.separator + "dag" + File.separator +componentName + ".yaml";
- File file = new File(yamlFilePath);
- if (!file.exists()) {
- logger.error("no this file find: {} ", yamlFilePath);
- return jsonData;
+ List whiteList = getWhiteList(projectDir);
+ String fileName = componentName + ".yaml";
+ int index = whiteList.indexOf(fileName);
+ if (index > -1) {
+ String yamlFilePath = projectDir + File.separator + "dag" + File.separator +componentName + ".yaml";
+ Yaml yaml = new Yaml();
+ ObjectMapper objectMapper = new ObjectMapper();
+ InputStream inputStream = new FileInputStream(yamlFilePath);
+ Map yamlData = yaml.load(inputStream);
+ jsonData = objectMapper.writeValueAsString(yamlData);
}
-
- Yaml yaml = new Yaml();
- ObjectMapper objectMapper = new ObjectMapper();
- InputStream inputStream = new FileInputStream(yamlFilePath);
- Map yamlData = yaml.load(inputStream);
- jsonData = objectMapper.writeValueAsString(yamlData);
-
return jsonData;
}
+ private List getWhiteList(String projectDir) {
+ String dirPath = projectDir + File.separator + "dag";
+ File dir = new File(dirPath);
+ File[] files = dir.listFiles();
+ List whiteList = new ArrayList<>();
+ if (files != null && files.length > 0) {
+ for (File file : files) {
+ if (file.isFile()) {
+ whiteList.add(file.getName());
+ }
+ }
+ }
+ return whiteList;
+ }
+
public JSONObject getBatchMetricInfo(BatchMetricDTO batchMetricDTO) {
String jobId = batchMetricDTO.getJob_id();
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 3846fd7d..68c7c7dc 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -7,8 +7,8 @@ zookeeper.time_out=30000
zookeeper.url_list=localhost:2181
zookeeper.scheme=digest
zookeeper.charset=UTF-8
-zookeeper.acl_username=admin
-zookeeper.acl_password=admin
+zookeeper.acl_username=
+zookeeper.acl_password=
zookeeper.node_path=/FATE-COMPONENTS/fate-flow
#priority is higher than {fateflow.url}, split by ;
@@ -27,8 +27,8 @@ spring.servlet.multipart.max-request-size=100MB
spring.servlet.session.timeout=1800s
server.compression.enabled=true
server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain
-server.board.login.username=admin
-server.board.login.password=admin
+server.board.login.username=
+server.board.login.password=
server.board.encrypt.private_key=
server.board.encrypt.enable=false
#only [h,m,s] is available