A library for verifying Zoom webhook events through the x-zm-signature and x-zm-request-timestamp headers.
The library is distributed on Maven Central. Add this dependency:
<dependency>
<groupId>name.seguri.java</groupId>
<artifactId>x-zm-signature</artifactId>
<version>1.0.0</version>
</dependency>
If you copy and paste the following code, make sure that zoom.secret-token is available, e.g. through application.properties, an environment variable ZOOM_SECRET_TOKEN , vault, k8s secrets, etc.
@Configuration
@ConfigurationProperties(prefix = "zoom")
class ZoomConfiguration {
private String secretToken;
// Getters and setters
@Bean
ZoomWebhookValidator zoomWebhookValidator() {
return new DefaultZoomWebhookValidator(secretToken);
}
}
@RestController
class ZoomDeauthController {
@Autowired ZoomWebhookValidator zoomWebhookValidator;
@PostMapping("/zoom/deauth")
void deauth(@RequestHeader("x-zm-signature") String signature,
@RequestHeader("x-zm-request-timestamp") String timestamp,
@RequestBody String body) {
if (zoomWebhookValidator.validate(signature, timestamp, body)) {
// Webhook request came from Zoom
} else {
// Webhook request did not come from Zoom
}
}
}- Follow the Initial Setup
- Replace
your-jira-idandyour-jira-passwordwith your Jira credentials insettings-sonatype.xml - Set a proper version (not a SNAPSHOT) in
pom.xml - Run
mvn -s settings-sonatype.xml clean deploy
- Install GPG with
brew install gnupg - Generate a key with
gpg --gen-key - Set
gpg.keynameas the output ofgpg --list-signatures --keyid-format 0xshort - Submit your key to a key server with
gpg --keyserver hkps://keyserver.ubuntu.com --send-keys <KEY_ID>