class ProjectWhiteListSecHubConfigurationValidationService {

	public void assertAllowedForProject(SecHubConfiguration configuration) {
		List<URI> allowed = fetchAllowedUris(configuration);

		Optional<SecHubInfrastructureScanConfiguration> infrascanOpt = configuration.getInfraScan();
		if (infrascanOpt.isPresent()) {
			SecHubInfrastructureScanConfiguration infraconf = infrascanOpt.get();
			assertWhitelisted(allowed, infraconf.getUris());
			assertWhitelisted(allowed, asUris(infraconf.getIps()));
		}
		Optional<SecHubWebScanConfiguration> webscanopt = configuration.getWebScan();
		if (webscanopt.isPresent()) {
			SecHubWebScanConfiguration webconf = webscanopt.get();
			assertWhitelisted(allowed, webconf.getUris());
		}

	}

}