pub struct VerifyLayer<B = Bytes> { /* private fields */ }Expand description
A tower_layer::Layer verifying webhook signatures with
crate::verify() before passing the request to the inner service.
See the module docs for the security contract, status-code table,
and framework notes. The type parameter selects the body type the inner
service receives after buffering (default Bytes); anything convertible
from Bytes works, e.g. axum::body::Body.
Implementations§
Source§impl<B> VerifyLayer<B>
impl<B> VerifyLayer<B>
Sourcepub fn new(provider: Provider, secret: Secret) -> Self
pub fn new(provider: Provider, secret: Secret) -> Self
Verifies provider signatures using the shared secret.
Sourcepub fn with_options(
provider: Provider,
secret: Secret,
options: VerifyOptions,
) -> Self
pub fn with_options( provider: Provider, secret: Secret, options: VerifyOptions, ) -> Self
Like VerifyLayer::new, with explicit VerifyOptions (timestamp
tolerance, injected clock, URL-scoped schemes such as Square/Twilio).
Trait Implementations§
Source§impl<B: Clone> Clone for VerifyLayer<B>
impl<B: Clone> Clone for VerifyLayer<B>
Source§impl<B: Debug> Debug for VerifyLayer<B>
impl<B: Debug> Debug for VerifyLayer<B>
Auto Trait Implementations§
impl<B = Bytes> !RefUnwindSafe for VerifyLayer<B>
impl<B = Bytes> !UnwindSafe for VerifyLayer<B>
impl<B> Freeze for VerifyLayer<B>where
PhantomData<B>: Freeze,
impl<B> Send for VerifyLayer<B>where
PhantomData<B>: Send,
impl<B> Sync for VerifyLayer<B>where
PhantomData<B>: Sync,
impl<B> Unpin for VerifyLayer<B>where
PhantomData<B>: Unpin,
impl<B> UnsafeUnpin for VerifyLayer<B>where
PhantomData<B>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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