use of com.yahoo.elide.modelconfig.Config in project elide by yahoo.
the class DynamicConfigValidator method readSecurityConfig.
/**
* Read and validates security config file.
*/
private ElideSecurityConfig readSecurityConfig(Map<String, ConfigFile> resourceMap) {
return resourceMap.entrySet().stream().filter(entry -> entry.getKey().startsWith(Config.SECURITY.getConfigPath())).map(entry -> {
try {
String content = entry.getValue().getContent();
validateConfigForMissingVariables(content, this.modelVariables);
return DynamicConfigHelpers.stringToElideSecurityPojo(entry.getKey(), content, this.modelVariables, schemaValidator);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}).findAny().orElse(new ElideSecurityConfig());
}
Aggregations