This commit is contained in:
Anthony Stirling 2023-12-27 15:18:26 +00:00
parent 84aebe3851
commit e9947da5b4
3 changed files with 6 additions and 4 deletions

View file

@ -33,8 +33,8 @@ public class ApiDocService {
return userService.getApiKeyForUser(Role.INTERNAL_API_USER.getRoleId()); return userService.getApiKeyForUser(Role.INTERNAL_API_USER.getRoleId());
} }
@EventListener(ApplicationReadyEvent.class) //@EventListener(ApplicationReadyEvent.class)
private void loadApiDocumentation() { private synchronized void loadApiDocumentation() {
try { try {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
String apiKey = getApiKeyForUser(); String apiKey = getApiKeyForUser();
@ -67,6 +67,9 @@ public class ApiDocService {
} }
public boolean isValidOperation(String operationName, Map<String, Object> parameters) { public boolean isValidOperation(String operationName, Map<String, Object> parameters) {
if(apiDocumentation.size() == 0) {
loadApiDocumentation();
}
if (!apiDocumentation.containsKey(operationName)) { if (!apiDocumentation.containsKey(operationName)) {
return false; return false;
} }

View file

@ -332,7 +332,6 @@ public class PipelineController {
String apiKey = getApiKeyForUser(); String apiKey = getApiKeyForUser();
headers.add("X-API-Key", apiKey); headers.add("X-API-Key", apiKey);
headers.setContentType(MediaType.MULTIPART_FORM_DATA); headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<MultiValueMap<String, Object>> entity = new HttpEntity<>(body, headers); HttpEntity<MultiValueMap<String, Object>> entity = new HttpEntity<>(body, headers);

View file

@ -77,7 +77,7 @@
<li>For reuse, download the config file and re-upload it when needed, or place it in /pipeline/defaultWebUIConfigs/ to auto-load in the web UI for all users</li> <li>For reuse, download the config file and re-upload it when needed, or place it in /pipeline/defaultWebUIConfigs/ to auto-load in the web UI for all users</li>
</ul> </ul>
<h3>How to use config for folder scanning</h3> <h3>How to use pre-load configs in web UI</h3>
<ul> <ul>
<li>Download config files</li> <li>Download config files</li>
<li>For reuse, download the config file and re-upload it when needed, or place it in /pipeline/defaultWebUIConfigs/ to auto-load in the web UI for all users</li> <li>For reuse, download the config file and re-upload it when needed, or place it in /pipeline/defaultWebUIConfigs/ to auto-load in the web UI for all users</li>