pub struct WebhookVerifier { /* private fields */ }Expand description
Compiled inbound webhook verification engine backing WebhookPlugin.
Implementations§
Source§impl WebhookVerifier
Compiled webhook verifier engine backing WebhookPlugin.
impl WebhookVerifier
Compiled webhook verifier engine backing WebhookPlugin.
Sourcepub fn new(config: WebhookConfig) -> Self
pub fn new(config: WebhookConfig) -> Self
Sourcepub fn get_replay_cache(&self) -> &ReplayNonceCache
pub fn get_replay_cache(&self) -> &ReplayNonceCache
Sourcepub fn reject_wire(&self, reason: WebhookRejectReason) -> &Vec<u8> ⓘ
pub fn reject_wire(&self, reason: WebhookRejectReason) -> &Vec<u8> ⓘ
Maps a WebhookRejectReason to its prebuilt zero-allocation HTTP wire buffer.
§Arguments
WebhookRejectReason- Rejection classification.
§Returns
&Vec<u8>- Pre-serialized wire bytes.
Sourcepub fn verify_context_at(
&self,
ctx: &mut Context,
now_secs: u64,
) -> Result<Option<WebhookEvent>, WebhookRejectReason>
pub fn verify_context_at( &self, ctx: &mut Context, now_secs: u64, ) -> Result<Option<WebhookEvent>, WebhookRejectReason>
Verifies a request context at an explicit now_secs timestamp and injects WebhookEvent on success.
Returns Ok(None) when ctx’s path does not match any configured webhook endpoint.
§Arguments
&mut Context- Incoming Hyperlane request context.u64- Current Unix epoch seconds.
§Returns
Result<Option<WebhookEvent>, WebhookRejectReason>- Verified event,Noneif unmatched, or rejection reason.
Sourcepub fn verify_context(
&self,
ctx: &mut Context,
) -> Result<Option<WebhookEvent>, WebhookRejectReason>
pub fn verify_context( &self, ctx: &mut Context, ) -> Result<Option<WebhookEvent>, WebhookRejectReason>
Verifies a request context using webhook_now_secs lazily after endpoint matching.
§Arguments
&mut Context- Incoming Hyperlane request context.
§Returns
Result<Option<WebhookEvent>, WebhookRejectReason>- Verified event,Noneif unmatched, or rejection reason.
Trait Implementations§
Auto Trait Implementations§
impl Forget for WebhookVerifier
impl Freeze for WebhookVerifier
impl Move for WebhookVerifier
impl RefUnwindSafe for WebhookVerifierwhere
Atomic<usize>: RefUnwindSafe,
Mutex<HashMap<[u8; 32], u64, BuildHasherDefault<DigestIdentityHasher>>>: RefUnwindSafe,
impl Send for WebhookVerifier
impl Sync for WebhookVerifier
impl Unpin for WebhookVerifier
impl UnsafeUnpin for WebhookVerifierwhere
*const ArcInner<Vec<CompiledEndpoint>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<CompiledEndpoint>>>: UnsafeUnpin,
*const ArcInner<ReplayNonceCacheInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<ReplayNonceCacheInner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for WebhookVerifierwhere
Arc<Vec<CompiledEndpoint>>: UnwindSafe,
Arc<ReplayNonceCacheInner>: UnwindSafe,
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