From: Aurelien Poscia Date: Wed, 23 Aug 2023 09:57:44 +0000 (+0200) Subject: SONAR-19977 add AppId to force auth via webhook X-Git-Tag: 10.2.0.77647~60 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52294a5de285dfe587240633d9b4bcfd4caa2d09;p=sonarqube.git SONAR-19977 add AppId to force auth via webhook --- diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java index 35075f7ae72..43120ad451b 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java @@ -239,6 +239,7 @@ public class AlmIntegrationsService extends BaseService { .setHeader("X-GitHub-Event", request.getGithubEventHeader()) .setHeader("X-Hub-Signature", request.getGithubSignatureHeader()) .setHeader("X-Hub-Signature-256", request.getGithubSignature256Header()) + .setHeader("x-github-hook-installation-target-id", request.getGithubAppId()) .setBody(request.getPayload()) .setMediaType(MediaTypes.JSON) ).content(); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SendGithubCodeScanningAlertWebhookPayloadRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SendGithubCodeScanningAlertWebhookPayloadRequest.java index 770d1fd99a1..46863363a22 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SendGithubCodeScanningAlertWebhookPayloadRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SendGithubCodeScanningAlertWebhookPayloadRequest.java @@ -24,6 +24,7 @@ import javax.annotation.Generated; /** * This is part of the internal API. * This is a POST request. + * * @see Further information about this action online (including a response example) * @since 9.7 */ @@ -34,6 +35,8 @@ public class SendGithubCodeScanningAlertWebhookPayloadRequest { private String githubSignatureHeader; private String githubSignature256Header; + private String githubAppId; + /** * This is a mandatory parameter. */ @@ -81,4 +84,13 @@ public class SendGithubCodeScanningAlertWebhookPayloadRequest { public String getGithubSignature256Header() { return githubSignature256Header; } + + public String getGithubAppId() { + return githubAppId; + } + + public SendGithubCodeScanningAlertWebhookPayloadRequest setGithubAppId(String githubAppId) { + this.githubAppId = githubAppId; + return this; + } }