Skip to content

Commit

Permalink
Change OpenAPI Doc from revoke to delete (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
f11h authored Jun 10, 2021
1 parent 0794988 commit 6f84282
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ public ResponseEntity<Void> postVerificationInformation(
}

/**
* Http Method for revoking signer certificate.
* Http Method for deleting signer certificate.
*/
@CertificateAuthenticationRequired
@DeleteMapping(path = "", consumes = CmsMessageConverter.CONTENT_TYPE_CMS_VALUE)
@Operation(
summary = "Revokes Signer Certificate of a trusted Issuer",
summary = "Deletes Signer Certificate of a trusted Issuer",
tags = {"Signer Information"},
parameters = {
@Parameter(
Expand All @@ -207,7 +207,7 @@ public ResponseEntity<Void> postVerificationInformation(
responses = {
@ApiResponse(
responseCode = "204",
description = "Certificate was revoked successfully."),
description = "Certificate was deleted successfully."),
@ApiResponse(
responseCode = "400",
description = "Bad request. Possible reasons: Wrong Format, no CMS, not the correct signing alg,"
Expand All @@ -224,7 +224,7 @@ public ResponseEntity<Void> postVerificationInformation(
))
}
)
public ResponseEntity<Void> revokeVerificationInformation(
public ResponseEntity<Void> deleteVerificationInformation(
@RequestBody SignedCertificateDto cms,
@RequestAttribute(CertificateAuthenticationFilter.REQUEST_PROP_COUNTRY) String countryCode,
@RequestAttribute(CertificateAuthenticationFilter.REQUEST_PROP_THUMBPRINT) String authThumbprint
Expand Down Expand Up @@ -262,11 +262,11 @@ public ResponseEntity<Void> revokeVerificationInformation(
countryCode,
cms.getSignerCertificate(),
authThumbprint,
"UPLOAD_FAILED",
"DELETE_FAILED",
"revokeVerificationInformation triggered UPLOAD_FAILED");

throw new DgcgResponseException(HttpStatus.INTERNAL_SERVER_ERROR,
"0x006", "Upload of Signer Certificate failed", sentValues, e.getMessage());
"0x006", "Delete of Signer Certificate failed", sentValues, e.getMessage());
} else {
auditService.addAuditEvent(
countryCode,
Expand All @@ -291,12 +291,12 @@ public ResponseEntity<Void> revokeVerificationInformation(
}

/**
* Alias Method for revoking signer certificate.
* Alias Method for deleting signer certificate.
*/
@CertificateAuthenticationRequired
@PostMapping(path = "/delete", consumes = CmsMessageConverter.CONTENT_TYPE_CMS_VALUE)
@Operation(
summary = "Revokes Signer Certificate of a trusted Issuer",
summary = "Deletes Signer Certificate of a trusted Issuer",
description = "This endpoint is a workaround alias endpoint. This should only be used if it is not possible"
+ " to send http payloads with DELETE requests.",
tags = {"Signer Information"},
Expand Down Expand Up @@ -324,7 +324,7 @@ public ResponseEntity<Void> revokeVerificationInformation(
responses = {
@ApiResponse(
responseCode = "204",
description = "Certificate was revoked successfully."),
description = "Certificate was deleted successfully."),
@ApiResponse(
responseCode = "400",
description = "Bad request. Possible reasons: Wrong Format, no CMS, not the correct signing alg,"
Expand All @@ -341,11 +341,11 @@ public ResponseEntity<Void> revokeVerificationInformation(
))
}
)
public ResponseEntity<Void> revokeVerificationInformationAlias(
public ResponseEntity<Void> deleteVerificationInformationAlias(
@RequestBody SignedCertificateDto cms,
@RequestAttribute(CertificateAuthenticationFilter.REQUEST_PROP_COUNTRY) String countryCode,
@RequestAttribute(CertificateAuthenticationFilter.REQUEST_PROP_THUMBPRINT) String authThumbprint
) {
return revokeVerificationInformation(cms, countryCode, authThumbprint);
return deleteVerificationInformation(cms, countryCode, authThumbprint);
}
}

0 comments on commit 6f84282

Please sign in to comment.