Skip to content

Commit

Permalink
Change MDC parameter name for verifciation errors (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
f11h authored May 26, 2021
1 parent 5fb1263 commit 364e761
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/software-design-dgc-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ These key-value-pairs can be followed by additional attributes. The additional a
| **Certificate Upload Check**
| Verifier for certificate could not be instantiated. | ERROR | Failed to instantiate JcaContentVerifierProvider from cert | certHash |
| Certificate Issuer Check has failed | ERROR | Could not verify certificate issuance. | exception |
| Check of uploaded certificate has failed when revoking a certificate | ERROR | Verification certificate delete failed | reason, message |
| Check of uploaded certificate has failed when uploading a certificate | ERROR | Verification certificate upload failed | reason, message |
| Check of uploaded certificate has failed when revoking a certificate | ERROR | Verification certificate delete failed | verificationFailureReason, verificationFailureMessage |
| Check of uploaded certificate has failed when uploading a certificate | ERROR | Verification certificate upload failed | verificationFailureReason, verificationFailureReasonMessage |
| Revoking Certificate | INFO | Revoking verification certificate | signerCertSubject, payloadCertSubject |
| Uploading Certificate | INFO | Uploading new verification certificate | signerCertSubject, payloadCertSubject |
| Saving Certificate into DB (All checks passed) | INFO | Saving new SignerInformation Entity | uploadCertThumbprint, cscaCertThumbprint |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class SignerCertificateController {

private final AuditService auditService;

private static final String MDC_VERIFICATION_ERROR_REASON = "verificationFailureReason";
private static final String MDC_VERIFICATION_ERROR_MESSAGE = "verificationFailureMessage";

/**
* VerificationInformation Upload Controller.
*/
Expand Down Expand Up @@ -131,8 +134,8 @@ public ResponseEntity<Void> postVerificationInformation(
cms.getSignature(),
countryCode);
} catch (SignerInformationService.SignerCertCheckException e) {
DgcMdc.put("reason", e.getReason().toString());
DgcMdc.put("message", e.getMessage());
DgcMdc.put(MDC_VERIFICATION_ERROR_REASON, e.getReason().toString());
DgcMdc.put(MDC_VERIFICATION_ERROR_MESSAGE, e.getMessage());
log.error("Verification certificate upload failed");

String sentValues = String.format("{%s} country:{%s}", cms, countryCode);
Expand Down Expand Up @@ -238,8 +241,8 @@ public ResponseEntity<Void> revokeVerificationInformation(
cms.getSignerCertificate(),
countryCode);
} catch (SignerInformationService.SignerCertCheckException e) {
DgcMdc.put("reason", e.getReason().toString());
DgcMdc.put("message", e.getMessage());
DgcMdc.put(MDC_VERIFICATION_ERROR_REASON, e.getReason().toString());
DgcMdc.put(MDC_VERIFICATION_ERROR_MESSAGE, e.getMessage());
log.error("Verification certificate delete failed");

String sentValues = String.format("{%s} country:{%s}", cms, countryCode);
Expand Down

0 comments on commit 364e761

Please sign in to comment.