[][src]Struct slack_http_verifier::SlackVerifier

pub struct SlackVerifier { /* fields omitted */ }

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

Methods

impl SlackVerifier[src]

pub fn new<S: AsRef<[u8]>>(
    secret: S
) -> Result<SlackVerifier, InvalidKeyLengthError>
[src]

Returns a new SlackVerifier.

This code runs with edition 2018
let verifier = SlackVerifier::new("8f742231b10e8888abcd99yyyzzz85a5").unwrap();

pub fn verify(
    &self,
    ts: &str,
    body: &str,
    exp_sig: &str
) -> Result<(), VerificationError>
[src]

Verifies the given request.

This code runs with edition 2018

assert!(verifier.verify(ts_header, req_body, sig_header).is_ok());

Trait Implementations

impl Clone for SlackVerifier[src]

impl Debug for SlackVerifier[src]

impl Send for SlackVerifier[src]

impl Sync for SlackVerifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.