[−][src]Struct slack_http_verifier::SlackVerifier
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]
secret: S
) -> Result<SlackVerifier, InvalidKeyLengthError>
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]
&self,
ts: &str,
body: &str,
exp_sig: &str
) -> Result<(), VerificationError>
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]
fn clone(&self) -> SlackVerifier
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,