pub struct WebhookEndpoint { /* private fields */ }Expand description
Verification rules for one inbound webhook route or prefix.
Implementations§
Source§impl WebhookEndpoint
Inherent preset constructors and fluent builders for WebhookEndpoint.
impl WebhookEndpoint
Inherent preset constructors and fluent builders for WebhookEndpoint.
Sourcepub fn new<P, H>(
path_prefix: P,
signature_header: H,
scheme: WebhookScheme,
secrets: Vec<WebhookSecret>,
) -> Self
pub fn new<P, H>( path_prefix: P, signature_header: H, scheme: WebhookScheme, secrets: Vec<WebhookSecret>, ) -> Self
Creates a webhook endpoint verifying scheme signatures delivered in signature_header.
§Arguments
P- Route path or prefix (for example"/webhooks/events").H- Signature request header name.WebhookScheme- Signature encoding/framing scheme.Vec<WebhookSecret>- Active signing secrets (supports rotation).
§Returns
Self- Constructed endpoint definition.
Sourcepub fn stripe<P>(path_prefix: P, secrets: Vec<WebhookSecret>) -> Self
pub fn stripe<P>(path_prefix: P, secrets: Vec<WebhookSecret>) -> Self
Sourcepub fn github<P>(path_prefix: P, secrets: Vec<WebhookSecret>) -> Self
pub fn github<P>(path_prefix: P, secrets: Vec<WebhookSecret>) -> Self
Sourcepub fn shopify<P>(path_prefix: P, secrets: Vec<WebhookSecret>) -> Self
pub fn shopify<P>(path_prefix: P, secrets: Vec<WebhookSecret>) -> Self
Sourcepub fn with_secret(self, secret: WebhookSecret) -> Self
pub fn with_secret(self, secret: WebhookSecret) -> Self
Sourcepub fn with_timestamp_header<H>(
self,
header: H,
separator: Option<String>,
) -> Self
pub fn with_timestamp_header<H>( self, header: H, separator: Option<String>, ) -> Self
Sourcepub fn with_id_header<H>(self, header: H) -> Self
pub fn with_id_header<H>(self, header: H) -> Self
Sourcepub fn with_tolerance_secs(self, tolerance_secs: u64) -> Self
pub fn with_tolerance_secs(self, tolerance_secs: u64) -> Self
Sourcepub fn with_replay_ttl_secs(self, replay_ttl_secs: u64) -> Self
pub fn with_replay_ttl_secs(self, replay_ttl_secs: u64) -> Self
Sourcepub fn with_max_body_bytes(self, max_body_bytes: usize) -> Self
pub fn with_max_body_bytes(self, max_body_bytes: usize) -> Self
Source§impl WebhookEndpoint
impl WebhookEndpoint
pub fn get_path_prefix(&self) -> &String
pub fn get_mut_path_prefix(&mut self) -> &mut String
pub fn set_path_prefix(&mut self, val: String) -> &mut Self
pub fn get_signature_header(&self) -> &String
pub fn get_mut_signature_header(&mut self) -> &mut String
pub fn set_signature_header(&mut self, val: String) -> &mut Self
pub fn get_scheme(&self) -> &WebhookScheme
pub fn get_mut_scheme(&mut self) -> &mut WebhookScheme
pub fn set_scheme(&mut self, val: WebhookScheme) -> &mut Self
pub fn get_secrets(&self) -> &Vec<WebhookSecret>
pub fn get_mut_secrets(&mut self) -> &mut Vec<WebhookSecret>
pub fn set_secrets(&mut self, val: Vec<WebhookSecret>) -> &mut Self
pub fn get_timestamp_header(&self) -> Option<String>
pub fn try_get_timestamp_header(&self) -> Option<String>
pub fn get_mut_timestamp_header(&mut self) -> &mut Option<String>
pub fn set_timestamp_header(&mut self, val: Option<String>) -> &mut Self
pub fn get_timestamp_payload_separator(&self) -> Option<String>
pub fn try_get_timestamp_payload_separator(&self) -> Option<String>
pub fn get_mut_timestamp_payload_separator(&mut self) -> &mut Option<String>
pub fn set_timestamp_payload_separator( &mut self, val: Option<String>, ) -> &mut Self
pub fn get_id_header(&self) -> Option<String>
pub fn try_get_id_header(&self) -> Option<String>
pub fn get_mut_id_header(&mut self) -> &mut Option<String>
pub fn set_id_header(&mut self, val: Option<String>) -> &mut Self
pub fn get_tolerance_secs(&self) -> u64
pub fn get_mut_tolerance_secs(&mut self) -> &mut u64
pub fn set_tolerance_secs(&mut self, val: u64) -> &mut Self
pub fn get_replay_ttl_secs(&self) -> u64
pub fn get_mut_replay_ttl_secs(&mut self) -> &mut u64
pub fn set_replay_ttl_secs(&mut self, val: u64) -> &mut Self
pub fn get_max_body_bytes(&self) -> usize
pub fn get_mut_max_body_bytes(&mut self) -> &mut usize
pub fn set_max_body_bytes(&mut self, val: usize) -> &mut Self
Trait Implementations§
Source§impl Clone for WebhookEndpoint
impl Clone for WebhookEndpoint
Source§impl Debug for WebhookEndpoint
impl Debug for WebhookEndpoint
impl Eq for WebhookEndpoint
Source§impl PartialEq for WebhookEndpoint
impl PartialEq for WebhookEndpoint
impl StructuralPartialEq for WebhookEndpoint
Auto Trait Implementations§
impl Forget for WebhookEndpoint
impl Freeze for WebhookEndpoint
impl Move for WebhookEndpoint
impl RefUnwindSafe for WebhookEndpoint
impl Send for WebhookEndpointwhere
RawVecInner: Send,
impl Sync for WebhookEndpointwhere
RawVecInner: Sync,
impl Unpin for WebhookEndpoint
impl UnsafeUnpin for WebhookEndpointwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<WebhookSecret>: UnsafeUnpin,
impl UnwindSafe for WebhookEndpointwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.