Class WebhookController

java.lang.Object
edu.ucsb.cs156.frontiers.controllers.WebhookController

@RestController @RequestMapping("/api/webhooks") public class WebhookController extends Object
  • Constructor Details

  • Method Details

    • createGitHubWebhook

      @PostMapping("/github") public org.springframework.http.ResponseEntity<String> createGitHubWebhook(@RequestBody String requestBody, @RequestHeader(value="X-Hub-Signature-256",required=false) String signature) throws com.fasterxml.jackson.core.JsonProcessingException, NoSuchAlgorithmException, InvalidKeyException
      Accepts webhooks from GitHub, currently to update the membership status of a RosterStudent.
      Parameters:
      signature - the GitHub webhook signature header for security validation
      jsonBody - body of the webhook. The description of the currently used webhook is available in docs/webhooks.md
      Returns:
      either the word success so GitHub will not flag the webhook as a failure, or the updated RosterStudent
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
      NoSuchAlgorithmException
      InvalidKeyException