Commit 56440f9e authored by ipatini's avatar ipatini
Browse files

EMS: Control Service: Extended Info service class EmsInfoServiceImpl to...

EMS: Control Service: Extended Info service class EmsInfoServiceImpl to include properties for task scheduler and authorization. Added default values to ControlServiceProperties.AuthorizationProperties.
parent c12bf9b8
......@@ -182,6 +182,20 @@ public class EmsInfoServiceImpl implements IEmsInfoService {
staticResourceCfg.put("logs-path", staticResourceProperties.getLogsPath());
controlServiceInfo.put("prop-static-resource", staticResourceCfg);
}
if (controlServiceProperties!=null && controlServiceProperties.getTaskScheduler()!=null) {
ControlServiceProperties.TaskSchedulerProperties taskSchedulerProperties = controlServiceProperties.getTaskScheduler();
Map<String,Object> taskSchedulerMap = new LinkedHashMap<>();
taskSchedulerMap.put("thread-pool-size", taskSchedulerProperties.getThreadPoolSize());
controlServiceInfo.put("prop-task-scheduler", taskSchedulerMap);
}
if (controlServiceProperties!=null && controlServiceProperties.getAuthorization()!=null) {
ControlServiceProperties.AuthorizationProperties authorizationProperties = controlServiceProperties.getAuthorization();
Map<String,Object> authMap = new LinkedHashMap<>();
authMap.put("enabled", authorizationProperties.isEnabled());
authMap.put("paths-protected", authorizationProperties.getPathsProtected());
authMap.put("paths-excluded", authorizationProperties.getPathsExcluded());
controlServiceInfo.put("prop-authorization", authMap);
}
metrics.put(CONTROL_INFO_PROVIDER, controlServiceInfo);
// Collect Broker-CEP metrics
......
......@@ -9,6 +9,7 @@
package eu.melodic.event.control.properties;
import eu.melodic.event.control.webconf.WebMvcConfig;
import eu.melodic.event.util.KeystoreAndCertificateProperties;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
......@@ -19,7 +20,7 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.Min;
import java.util.Collections;
import java.util.Arrays;
import java.util.List;
@Slf4j
......@@ -89,7 +90,7 @@ public class ControlServiceProperties {
@Data
public static class AuthorizationProperties {
private boolean enabled = true;
private List<String> pathsProtected = Collections.emptyList();
private List<String> pathsExcluded = Collections.emptyList();
private List<String> pathsProtected = Arrays.asList(WebMvcConfig.DEFAULT_PATHS_PROTECTED);
private List<String> pathsExcluded = Arrays.asList(WebMvcConfig.DEFAULT_PATHS_EXCLUDED);
}
}
......@@ -33,8 +33,8 @@ import java.util.concurrent.TimeUnit;
@Component
@ComponentScan(basePackages={"eu.melodic.security.authorization.util.properties"})
public class WebMvcConfig implements WebMvcConfigurer {
private final static String[] DEFAULT_PATHS_PROTECTED = { "/**" };
private final static String[] DEFAULT_PATHS_EXCLUDED = { };
public final static String[] DEFAULT_PATHS_PROTECTED = { "/**" };
public final static String[] DEFAULT_PATHS_EXCLUDED = { };
@Autowired
private AuthorizationServiceClientProperties authProperties;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment