pub struct WebhookTrigger {
pub id: String,
pub workflow_id: String,
pub secret: Option<String>,
pub allowed_ips: Vec<String>,
pub parameter_mapping: HashMap<String, String>,
pub active: bool,
}Expand description
Webhook receiver for incoming workflow triggers.
Fields§
§id: StringTrigger ID.
workflow_id: StringWorkflow ID to trigger.
secret: Option<String>Secret for HMAC validation.
allowed_ips: Vec<String>Allowed source IPs.
parameter_mapping: HashMap<String, String>Parameter mapping from webhook payload.
active: boolWhether the webhook is active.
Implementations§
Source§impl WebhookTrigger
impl WebhookTrigger
Sourcepub fn with_secret(self, secret: impl Into<String>) -> Self
pub fn with_secret(self, secret: impl Into<String>) -> Self
Set the webhook secret.
Sourcepub fn with_allowed_ips(self, ips: Vec<String>) -> Self
pub fn with_allowed_ips(self, ips: Vec<String>) -> Self
Add allowed IP addresses.
Sourcepub fn with_parameter(
self,
webhook_field: impl Into<String>,
workflow_param: impl Into<String>,
) -> Self
pub fn with_parameter( self, webhook_field: impl Into<String>, workflow_param: impl Into<String>, ) -> Self
Add parameter mapping.
Sourcepub fn validate_signature(&self, payload: &[u8], signature: &str) -> bool
pub fn validate_signature(&self, payload: &[u8], signature: &str) -> bool
Validate HMAC signature.
Trait Implementations§
Source§impl Clone for WebhookTrigger
impl Clone for WebhookTrigger
Source§fn clone(&self) -> WebhookTrigger
fn clone(&self) -> WebhookTrigger
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebhookTrigger
impl Debug for WebhookTrigger
Source§impl<'de> Deserialize<'de> for WebhookTrigger
impl<'de> Deserialize<'de> for WebhookTrigger
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WebhookTrigger
impl RefUnwindSafe for WebhookTrigger
impl Send for WebhookTrigger
impl Sync for WebhookTrigger
impl Unpin for WebhookTrigger
impl UnsafeUnpin for WebhookTrigger
impl UnwindSafe for WebhookTrigger
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