Merge branch 'master' into develop
# Conflicts: # backend/pom.xml # config-data-executor/pom.xml # frontend/pom.xml # pom.xml # resources/pom.xml
This commit is contained in:
commit
9a7f1e1168
6 changed files with 23 additions and 7 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ru.micord.ervu</groupId>
|
||||
<artifactId>eks</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<version>1.1.5</version>
|
||||
</parent>
|
||||
<groupId>ru.micord.ervu.eks</groupId>
|
||||
<artifactId>backend</artifactId>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ru.micord.ervu</groupId>
|
||||
<artifactId>eks</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<version>1.1.5</version>
|
||||
</parent>
|
||||
<groupId>ru.micord.ervu.eks</groupId>
|
||||
<artifactId>config-data-executor</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.stream.IntStream;
|
|||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.micord.config.ArangoDBConnection;
|
||||
import org.micord.config.DatabaseConnection;
|
||||
import org.micord.config.S3HttpConnection;
|
||||
|
|
@ -56,12 +57,18 @@ public class RequestService {
|
|||
|
||||
private static final Logger logger = LoggerFactory.getLogger(RequestService.class);
|
||||
|
||||
private DocumentBuilderFactory secureDocumentFactory;
|
||||
@Autowired
|
||||
private HttpClient httpClient;
|
||||
|
||||
@Autowired
|
||||
private ValidationService validationService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
secureDocumentFactory = createSecureDocumentBuilderFactory();
|
||||
}
|
||||
|
||||
private void processS3Request(S3Request request, RequestParameters parameters, Map<String, Boolean> validationResults) {
|
||||
logger.info("B. Starting processing of single S3 request");
|
||||
try {
|
||||
|
|
@ -219,8 +226,7 @@ public class RequestService {
|
|||
|
||||
private void handleErrorResponse(HttpResponse<String> response, String file) {
|
||||
try {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
DocumentBuilder builder = secureDocumentFactory.newDocumentBuilder();
|
||||
InputSource is = new InputSource(new StringReader(response.body()));
|
||||
Document doc = builder.parse(is);
|
||||
Element root = doc.getDocumentElement();
|
||||
|
|
@ -703,4 +709,14 @@ public class RequestService {
|
|||
}
|
||||
}
|
||||
|
||||
private DocumentBuilderFactory createSecureDocumentBuilderFactory() {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
try {
|
||||
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException("Failed to secure XML parser", e);
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ru.micord.ervu</groupId>
|
||||
<artifactId>eks</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<version>1.1.5</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.micord.ervu.eks</groupId>
|
||||
|
|
|
|||
2
pom.xml
2
pom.xml
|
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>ru.micord.ervu</groupId>
|
||||
<artifactId>eks</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<version>1.1.5</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>backend</module>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ru.micord.ervu</groupId>
|
||||
<artifactId>eks</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<version>1.1.5</version>
|
||||
</parent>
|
||||
|
||||
<groupId>ru.micord.ervu.eks</groupId>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue