File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
src/main/java/org/hibernate/infra/replicate/jira/service/validation Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 2121import org .jboss .resteasy .reactive .server .ServerRequestFilter ;
2222import org .jboss .resteasy .reactive .server .WithFormRead ;
2323
24+ import io .quarkus .logging .Log ;
2425import jakarta .enterprise .context .ApplicationScoped ;
2526import jakarta .inject .Inject ;
2627import jakarta .ws .rs .container .ContainerRequestContext ;
@@ -63,13 +64,15 @@ public Response checkSignature(ContainerRequestContext requestContext) throws IO
6364 String signature = requestContext .getHeaderString ("x-hub-signature" );
6465
6566 if (signature == null || !requestContext .hasEntity ()) {
67+ Log .warnf ("Rejecting a web hook event because of the missing signature. Posted to %s" , path );
6668 return Response .status (401 ).entity ("Invalid request. Missing x-hub-signature header." ).build ();
6769 }
6870 try (InputStream entityStream = requestContext .getEntityStream ()) {
6971 byte [] payload = entityStream .readAllBytes ();
7072
7173 final String calculatedSignature = sign (mac , payload );
7274 if (!calculatedSignature .equals (signature )) {
75+ Log .warnf ("Rejecting a web hook event because of the signature mismatch. Posted to %s" , path );
7376 return Response .status (401 ).entity ("Signatures do not match." ).build ();
7477 }
7578 requestContext .setEntityStream (new ByteArrayInputStream (payload ));
You can’t perform that action at this time.
0 commit comments