pub struct HttpPushSender { /* private fields */ }Expand description
HTTP-based PushSender using hyper.
Retries failed deliveries according to a configurable PushRetryPolicy.
§Security
- Rejects webhook URLs targeting private/loopback/link-local addresses to prevent SSRF attacks.
- Validates authentication credentials to prevent HTTP header injection (rejects values containing CR/LF characters).
Implementations§
Source§impl HttpPushSender
impl HttpPushSender
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new HttpPushSender with the default 30-second request timeout
and default retry policy.
Sourcepub fn with_timeout(request_timeout: Duration) -> Self
pub fn with_timeout(request_timeout: Duration) -> Self
Creates a new HttpPushSender with a custom per-request timeout.
Sourcepub fn with_retry_policy(self, policy: PushRetryPolicy) -> Self
pub fn with_retry_policy(self, policy: PushRetryPolicy) -> Self
Sets a custom retry policy for push notification delivery.
Sourcepub const fn allow_private_urls(self) -> Self
pub const fn allow_private_urls(self) -> Self
Creates an HttpPushSender that allows private/loopback URLs.
Warning: This disables SSRF protection and should only be used in testing or trusted environments.
Trait Implementations§
Source§impl Debug for HttpPushSender
impl Debug for HttpPushSender
Source§impl Default for HttpPushSender
impl Default for HttpPushSender
Source§impl PushSender for HttpPushSender
impl PushSender for HttpPushSender
Source§fn allows_private_urls(&self) -> bool
fn allows_private_urls(&self) -> bool
Returns
true if this sender allows webhook URLs targeting
private/loopback addresses. Used by the handler to skip SSRF
validation at push config creation time in testing environments. Read moreAuto Trait Implementations§
impl Freeze for HttpPushSender
impl !RefUnwindSafe for HttpPushSender
impl Send for HttpPushSender
impl Sync for HttpPushSender
impl Unpin for HttpPushSender
impl UnsafeUnpin for HttpPushSender
impl !UnwindSafe for HttpPushSender
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request