Search in sources :

Example 1 with UseCaseUpdateProjectWhitelist

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);
}
Also used : ProjectWhiteList(com.mercedesbenz.sechub.domain.administration.project.ProjectJsonInput.ProjectWhiteList) URI(java.net.URI) UseCaseUpdateProjectWhitelist(com.mercedesbenz.sechub.sharedkernel.usecases.admin.project.UseCaseUpdateProjectWhitelist) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ProjectWhiteList (com.mercedesbenz.sechub.domain.administration.project.ProjectJsonInput.ProjectWhiteList)1 UseCaseUpdateProjectWhitelist (com.mercedesbenz.sechub.sharedkernel.usecases.admin.project.UseCaseUpdateProjectWhitelist)1 URI (java.net.URI)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1