pub struct WebhookConfig {
pub provider: Option<String>,
pub path: Option<String>,
pub secret_env: String,
pub signature_scheme: Option<String>,
pub signature_header: Option<String>,
pub timestamp_header: Option<String>,
pub timestamp_tolerance: u64,
pub idempotent: bool,
pub events: HashMap<String, WebhookEventConfig>,
}Expand description
Webhook endpoint configuration
Fields§
§provider: Option<String>Provider type (stripe, github, etc.) - inferred from key if not specified
path: Option<String>Endpoint path (default: /webhooks/{name})
secret_env: StringSecret environment variable name
signature_scheme: Option<String>Signature scheme (for custom providers)
signature_header: Option<String>Custom signature header (for custom providers)
timestamp_header: Option<String>Timestamp header (for custom providers)
timestamp_tolerance: u64Timestamp tolerance in seconds
idempotent: boolEnable idempotency checking
events: HashMap<String, WebhookEventConfig>Event mappings
Implementations§
Source§impl WebhookConfig
impl WebhookConfig
Sourcepub fn validate_secret_env(&self) -> Result<(), WebhookError>
pub fn validate_secret_env(&self) -> Result<(), WebhookError>
Validate that secret_env is a legal POSIX environment variable name.
Accepts [A-Za-z_][A-Za-z0-9_]*. Rejects =, NUL bytes, and empty strings
which are OS-undefined or could cause environment injection.
§Errors
Returns WebhookError::Configuration if secret_env is invalid.
§Panics
Cannot panic in practice — the expect is guarded by a preceding
emptiness check that returns Err before the call site is reached.
Trait Implementations§
Source§impl Clone for WebhookConfig
impl Clone for WebhookConfig
Source§fn clone(&self) -> WebhookConfig
fn clone(&self) -> WebhookConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebhookConfig
impl Debug for WebhookConfig
Source§impl<'de> Deserialize<'de> for WebhookConfig
impl<'de> Deserialize<'de> for WebhookConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WebhookConfig
impl RefUnwindSafe for WebhookConfig
impl Send for WebhookConfig
impl Sync for WebhookConfig
impl Unpin for WebhookConfig
impl UnsafeUnpin for WebhookConfig
impl UnwindSafe for WebhookConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more