[][src]Crate slack_http_verifier

slack_http_verifier verifies request signatures from Slacks HTTP Events API, as described here.

Usage

If you're using the http crate, requests can be verified directly

This code runs with edition 2018


let http_verifier = SlackHTTPVerifier::new(my_secret_key).unwrap();

// ...
// Receive requests


http_verifier.verify(&req).unwrap();
This code runs with edition 2018


let verifier = SlackVerifier::new(my_secret_key).unwrap();

// ...
// Receive requests, extract from your framework


verifier
    .verify(slack_sample_timestamp, slack_sample_body, slack_sample_sig)
    .unwrap();

Structs

SlackHTTPVerifier

Verifies Slack http requests are signed by the given secret. A convenience wrapper around SlackVerifier.

SlackVerifier

Verifies raw request bodies are signed by Slack's secret. An alternative if it is inconvenient/impossible to use SlackHTTPVerifier