pub struct RequestVerifierAsync { /* private fields */ }Expand description
Exposes verify method and caches new certificates asynchronously on the first request
Implementations§
Source§impl RequestVerifierAsync
impl RequestVerifierAsync
Sourcepub async fn verify(
&self,
signature_cert_chain_url: &str,
signature: &str,
body: &[u8],
timestamp: &str,
timestamp_tolerance_millis: Option<u64>,
) -> Result<(), Error>
pub async fn verify( &self, signature_cert_chain_url: &str, signature: &str, body: &[u8], timestamp: &str, timestamp_tolerance_millis: Option<u64>, ) -> Result<(), Error>
Asynchronously verify that the request came from Alexa. Returns a std::future::Future
that can .await’d.
-
SignatureCertChainUrlandSignatureare headers of the request -
Pass the entire body of the request for signature verification
-
Timestamp comes from the body,
{ "request" : { "timestamp": "" } }. If deserialized using alexa_sdk then timestamp can be taken fromalexa_sdk::Request.body.timestamp -
A tolerance value in milliseconds can be passed to verify the request was received within that tolerance (default is
150_000)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RequestVerifierAsync
impl !RefUnwindSafe for RequestVerifierAsync
impl Send for RequestVerifierAsync
impl Sync for RequestVerifierAsync
impl Unpin for RequestVerifierAsync
impl UnwindSafe for RequestVerifierAsync
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more