pub struct PushNotificationAuthenticationInfo {
pub scheme: String,
pub credentials: Option<String>,
}Expand description
The authentication block inside a
TaskPushNotificationConfig.
Wire form:
{ "scheme": "Bearer", "credentials": "..." }scheme is required; credentials is
optional. The spec lets a config carry
just a scheme name (e.g. "Bearer") and
rely on a side channel for the
credentials; the agent reads the
credentials field when present and
falls back to the side channel when it
is not.
Fields§
§scheme: StringThe HTTP authentication scheme. Per
IANA registry,
examples are Bearer, Basic,
Digest. Scheme names are
case-insensitive per RFC 9110
§11.1; the wire form is the
canonical casing the client sends,
and the agent normalises on read.
credentials: Option<String>The credentials. The format depends
on the scheme (a token for Bearer,
a base64-encoded user:pass for
Basic, etc.). Optional — a config
that names a scheme without
credentials is valid per the spec
and relies on a side channel for
the value.
Implementations§
Source§impl PushNotificationAuthenticationInfo
impl PushNotificationAuthenticationInfo
Sourcepub fn new(scheme: impl Into<String>) -> Self
pub fn new(scheme: impl Into<String>) -> Self
Starts a new authentication block with
scheme. Use with_credentials
to set the credentials.
Sourcepub fn with_credentials(self, credentials: impl Into<String>) -> Self
pub fn with_credentials(self, credentials: impl Into<String>) -> Self
Sets the credentials.