pub struct WebhookConfig { /* private fields */ }Expand description
Configuration used by the VerifiedBody extractor: provider, secret,
and verification options.
Register it once per app (or per scoped webhook route) with
App::app_data(...). Requests arriving at routes without a registered
config fail closed with 500 Internal Server Error.
Implementations§
Source§impl WebhookConfig
impl WebhookConfig
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 WebhookConfig::new, with explicit VerifyOptions
(timestamp tolerance, injected clock, URL-scoped schemes such as
Square/Twilio).
Trait Implementations§
Source§impl Clone for WebhookConfig
impl Clone for WebhookConfig
Auto Trait Implementations§
impl !RefUnwindSafe for WebhookConfig
impl !UnwindSafe for WebhookConfig
impl Freeze for WebhookConfig
impl Send for WebhookConfig
impl Sync for WebhookConfig
impl Unpin for WebhookConfig
impl UnsafeUnpin for WebhookConfig
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