Skip to content

Commit

Permalink
Added a validation method to check the revocation during the verifiab…
Browse files Browse the repository at this point in the history
…le presentation validation.
  • Loading branch information
rubenmodamioin2 committed Nov 5, 2024
1 parent 5579acb commit 1f5d66b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package es.in2.vcverifier.exception.handler;

import es.in2.vcverifier.exception.CredentialRevokedException;
import es.in2.vcverifier.exception.QRCodeGenerationException;
import es.in2.vcverifier.exception.ResourceNotFoundException;
import es.in2.vcverifier.model.GlobalErrorMessage;
Expand Down Expand Up @@ -37,6 +38,12 @@ public GlobalErrorMessage handleQRCodeGenerationException(QRCodeGenerationExcept
return new GlobalErrorMessage("QR Code Generation Failed","","");
}

@ExceptionHandler(CredentialRevokedException.class)
@ResponseStatus(HttpStatus.UNAUTHORIZED)
public GlobalErrorMessage handleException(CredentialRevokedException ex) {
log.error("The credential has been revoked: ", ex);
return new GlobalErrorMessage("Verifiable presentation failed","","");
}
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public GlobalErrorMessage handleException(Exception ex) {
Expand Down

0 comments on commit 1f5d66b

Please sign in to comment.