pub struct WebhookSignature;Expand description
Helper for constructing signature configurations.
Use in webhook attributes like:
ⓘ
#[forge::webhook(
signature = WebhookSignature::hmac_sha256("X-Stripe-Signature", "STRIPE_SECRET"),
)]Implementations§
Source§impl WebhookSignature
impl WebhookSignature
Sourcepub const fn hmac_sha256(
header: &'static str,
secret_env: &'static str,
) -> SignatureConfig
pub const fn hmac_sha256( header: &'static str, secret_env: &'static str, ) -> SignatureConfig
Create HMAC-SHA256 signature config.
§Arguments
header- The HTTP header containing the signature (e.g., “X-Hub-Signature-256”)secret_env- Environment variable containing the secret
Sourcepub const fn hmac_sha1(
header: &'static str,
secret_env: &'static str,
) -> SignatureConfig
pub const fn hmac_sha1( header: &'static str, secret_env: &'static str, ) -> SignatureConfig
Create HMAC-SHA1 signature config.
§Arguments
header- The HTTP header containing the signaturesecret_env- Environment variable containing the secret
Sourcepub const fn hmac_sha512(
header: &'static str,
secret_env: &'static str,
) -> SignatureConfig
pub const fn hmac_sha512( header: &'static str, secret_env: &'static str, ) -> SignatureConfig
Create HMAC-SHA512 signature config.
§Arguments
header- The HTTP header containing the signaturesecret_env- Environment variable containing the secret
Auto Trait Implementations§
impl Freeze for WebhookSignature
impl RefUnwindSafe for WebhookSignature
impl Send for WebhookSignature
impl Sync for WebhookSignature
impl Unpin for WebhookSignature
impl UnwindSafe for WebhookSignature
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
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>
Converts
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>
Converts
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