pub struct RequestVerifier { /* private fields */ }Expand description
Exposes verify method and caches new certificates synchronously on the first request
Implementations§
Source§impl RequestVerifier
impl RequestVerifier
Sourcepub fn verify(
&self,
signature_cert_chain_url: &str,
signature: &str,
body: &[u8],
timestamp: &str,
timestamp_tolerance_millis: Option<u64>,
) -> Result<(), Error>
pub fn verify( &self, signature_cert_chain_url: &str, signature: &str, body: &[u8], timestamp: &str, timestamp_tolerance_millis: Option<u64>, ) -> Result<(), Error>
Verify that the request came from Alexa.
-
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 RequestVerifier
impl RefUnwindSafe for RequestVerifier
impl Send for RequestVerifier
impl Sync for RequestVerifier
impl Unpin for RequestVerifier
impl UnsafeUnpin for RequestVerifier
impl UnwindSafe for RequestVerifier
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