pub struct TaskPushNotificationConfig {
pub id: String,
pub task_id: String,
pub url: String,
pub token: Option<String>,
pub authentication: Option<PushNotificationAuthenticationInfo>,
pub metadata: BTreeMap<String, Value>,
}Expand description
A registered push-notification configuration for a task.
Wire form:
{
"id": "config-1",
"taskId": "task-1",
"url": "https://example.com/webhook",
"token": "auth-token",
"authentication": { "scheme": "Bearer", "credentials": "..." }
}All fields are required except token and
authentication. The spec lets a client
register a config with no token (a webhook
the agent POSTs to without authentication)
and no authentication block (a webhook
that uses a header the agent does not need
to know about, or an unauthenticated
webhook).
Fields§
§id: StringThe configuration’s id. Required — the spec uses it to address a config within a task.
task_id: StringThe task’s id. Required — a config is scoped to one task.
url: StringThe webhook the server POSTs to. The URL is the SSRF surface the SSRF denylist filters on the server side. Required.
token: Option<String>An optional token the server includes
in the X-A2A-Notification-Token
header. A receiver without a token is
a receiver that does not need to
authenticate the delivery.
authentication: Option<PushNotificationAuthenticationInfo>Optional authentication info. A webhook that needs a Bearer token (or Basic, or Digest) sets this; a webhook that does not leaves it off the wire.
metadata: BTreeMap<String, Value>Per-config metadata.
Implementations§
Source§impl TaskPushNotificationConfig
impl TaskPushNotificationConfig
Sourcepub fn new(
id: impl Into<String>,
task_id: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, task_id: impl Into<String>, url: impl Into<String>, ) -> Self
Starts a new config with id, task_id,
and url. Use with_token
and with_authentication
to set the optional fields.
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Sets the token.
Sourcepub fn with_authentication(
self,
authentication: PushNotificationAuthenticationInfo,
) -> Self
pub fn with_authentication( self, authentication: PushNotificationAuthenticationInfo, ) -> Self
Sets the authentication info.