]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19977 add AppId to force auth via webhook
authorAurelien Poscia <aurelien.poscia@sonarsource.com>
Wed, 23 Aug 2023 09:57:44 +0000 (11:57 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 24 Aug 2023 20:03:09 +0000 (20:03 +0000)
sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java
sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/SendGithubCodeScanningAlertWebhookPayloadRequest.java

index 35075f7ae720168af2aafaf2ed1cee271f655462..43120ad451bebe1c189e6d353bceeafaa63f23d0 100644 (file)
@@ -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();
index 770d1fd99a1c99812aa9169c67fe56323df5446e..46863363a22387c0dcafbf7d704c1e64f030c7b6 100644 (file)
@@ -24,6 +24,7 @@ import javax.annotation.Generated;
 /**
  * This is part of the internal API.
  * This is a POST request.
+ *
  * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/webhook_github">Further information about this action online (including a response example)</a>
  * @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;
+  }
 }