use of com.mercedesbenz.sechub.sharedkernel.usecases.admin.project.UseCaseUpdateProjectWhitelist in project sechub by mercedes-benz.
the class ProjectUpdateAdministrationRestController method updateProjectWhitelist.
/* @formatter:off */
@UseCaseUpdateProjectWhitelist(@Step(number = 1, name = "Rest call", description = "White list will be updated", needsRestDoc = true))
@RequestMapping(path = AdministrationAPIConstants.API_UPDATE_PROJECT_WHITELIST, method = RequestMethod.POST, produces = { MediaType.APPLICATION_JSON_VALUE })
public void updateProjectWhitelist(@Validated @RequestBody ProjectJsonInput input, @PathVariable(name = "projectId") String projectId) {
/* @formatter:on */
Optional<ProjectWhiteList> projectWhiteList = input.getWhiteList();
List<URI> whiteList;
if (projectWhiteList.isPresent()) {
ProjectWhiteList r = projectWhiteList.get();
whiteList = r.getUris();
} else {
whiteList = Collections.emptyList();
}
updateProjectWhitelistService.updateProjectWhitelist(projectId, whiteList);
}
Aggregations