Class CSRResource


  • @RestController
    @RequestMapping("/api")
    public class CSRResource
    extends Object
    REST controller for managing CSR.
    • Constructor Detail

      • CSRResource

        public CSRResource​(CSRService cSRService,
                           CSRUtil csrUtil,
                           PipelineUtil pipelineUtil,
                           UserRepository userRepository,
                           UserUtil userUtil,
                           @Value("${ca3s.ui.certificate-store.isolation:none}")
                           String certificateStoreIsolation,
                           @Value("${ca3s.ui.csr.dnslookup:false}")
                           boolean doDNSLookup)
    • Method Detail

      • createCSR

        @PostMapping("/csrs")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<CSR> createCSR​(@Valid @RequestBody
                                                                      @Valid CSR cSR)
                                                               throws URISyntaxException
        POST /csrs : Create a new cSR.
        Parameters:
        cSR - the cSR to create.
        Returns:
        the ResponseEntity with status 201 (Created) and with body the new cSR, or with status 400 (Bad Request) if the cSR has already an ID.
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • updateCSR

        @PutMapping("/csrs")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<CSR> updateCSR​(@Valid @RequestBody
                                                                      @Valid CSR cSR)
                                                               throws URISyntaxException
        PUT /csrs : Updates an existing cSR.
        Parameters:
        cSR - the cSR to update.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the updated cSR, or with status 400 (Bad Request) if the cSR is not valid, or with status 500 (Internal Server Error) if the cSR couldn't be updated.
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • getAllCSRS

        @GetMapping("/csrs")
        public List<CSR> getAllCSRS​(@RequestParam(required=false)
                                    String filter)
        GET /csrs : get all the cSRS.
        Parameters:
        filter - the filter of the request.
        Returns:
        the ResponseEntity with status 200 (OK) and the list of cSRS in body.
      • getCSRView

        @GetMapping("/csrView/{id}")
        @Transactional(readOnly=true)
        public org.springframework.http.ResponseEntity<CSRView> getCSRView​(@PathVariable
                                                                           Long id)
        GET /csr/:id : get the "id" cSR.
        Parameters:
        id - the id of the cSR to retrieve.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the cSR, or with status 404 (Not Found).
      • getCSR

        @GetMapping("/csrs/{id}")
        public org.springframework.http.ResponseEntity<CSR> getCSR​(@PathVariable
                                                                   Long id)
        GET /csrs/:id : get the "id" cSR.
        Parameters:
        id - the id of the cSR to retrieve.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the cSR, or with status 404 (Not Found).
      • deleteCSR

        @DeleteMapping("/csrs/{id}")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<Void> deleteCSR​(@PathVariable
                                                                       Long id)
        DELETE /csrs/:id : delete the "id" cSR.
        Parameters:
        id - the id of the cSR to delete.
        Returns:
        the ResponseEntity with status 204 (NO_CONTENT).