pub struct WebhookUrl(/* private fields */);Expand description
The push-notification URL a client registered, after URL filter approval.
The newtype exists so the wire codec can parse a Url once, hand the
filtered value to the use case, and have the type system prove the URL
was checked before delivery. A Url that arrives at the delivery port
without going through WebhookUrl::new is a delivery path that
bypassed the SSRF guard.
Implementations§
Source§impl WebhookUrl
impl WebhookUrl
Sourcepub fn new(
filter: &dyn UrlFilter,
url: Url,
version: A2aVersion,
) -> Result<Self, FilterDenial>
pub fn new( filter: &dyn UrlFilter, url: Url, version: A2aVersion, ) -> Result<Self, FilterDenial>
Wraps a URL that has already passed the UrlFilter::check_at_config
gate.
§Errors
The only thing this constructor can refuse is a URL that the filter
would refuse — UrlFilter::check_at_config is the gate, not this
constructor, but the constructor delegates the check to the
provided filter so the wire codec has one call to make and one
error to handle.
Sourcepub fn idempotency_key(&self) -> IdempotencyKey
pub fn idempotency_key(&self) -> IdempotencyKey
The key the delivery adapter uses to dedupe retried deliveries.
WebhookUrl::idempotency_key(url) is a pure function of the URL —
the same URL produces the same key on every call. The delivery
adapter records (key, response) and returns the recorded
response on retry, so a network blip that lost the 2xx reply
does not produce a duplicate notification.