Class WebhookController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.WebhookController
-
Constructor Summary
ConstructorsConstructorDescriptionWebhookController
(CourseRepository courseRepository, RosterStudentRepository rosterStudentRepository, CourseStaffRepository courseStaffRepository) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<String> createGitHubWebhook
(String requestBody, String signature) Accepts webhooks from GitHub, currently to update the membership status of a RosterStudent.
-
Constructor Details
-
WebhookController
public WebhookController(CourseRepository courseRepository, RosterStudentRepository rosterStudentRepository, CourseStaffRepository courseStaffRepository)
-
-
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 validationjsonBody
- 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
-