Search in sources :

Example 1 with PrincipalHasWritePermsForPath

use of com.nike.cerberus.security.PrincipalHasWritePermsForPath in project cerberus by Nike-Inc.

the class SecureDataController method writeSecureData.

@PrincipalHasWritePermsForPath
@RequestMapping(value = "/**", method = { POST, PUT }, consumes = ALL_VALUE)
public void writeSecureData(HttpEntity<String> httpEntity) {
    CerberusPrincipal principal = sdbAccessRequest.getPrincipal();
    secureDataService.writeSecret(sdbAccessRequest.getSdbId(), sdbAccessRequest.getPath(), Optional.ofNullable(httpEntity.getBody()).orElseThrow(() -> new RuntimeException("The body must not be null")), principal.getName());
}
Also used : CerberusPrincipal(com.nike.cerberus.security.CerberusPrincipal) PrincipalHasWritePermsForPath(com.nike.cerberus.security.PrincipalHasWritePermsForPath) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

CerberusPrincipal (com.nike.cerberus.security.CerberusPrincipal)1 PrincipalHasWritePermsForPath (com.nike.cerberus.security.PrincipalHasWritePermsForPath)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1