Skip to main content

a2a_protocol_server/
content_check.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Tom F. <[email protected]> (https://github.com/tomtom215)
3
4//! [`ContentCheck`], re-exported as `request_context::ContentCheck`.
5
6/// What the server found when it checked the message's provenance
7/// signature (`a2a_protocol_types::provenance`, ADR 0027).
8///
9/// A message whose signature does not verify never reaches the executor:
10/// the send is refused. Anyone able to alter a message can also remove its
11/// signature, so [`Unsigned`](Self::Unsigned) content is unverified, whoever
12/// sent it.
13#[derive(Debug, Clone, PartialEq, Eq, Default)]
14#[non_exhaustive]
15pub enum ContentCheck {
16    /// No keys to check against: the handler has none set
17    /// (`RequestHandlerBuilder::with_content_keys`), or the executor is
18    /// driven directly. Signed or not, nothing was verified.
19    #[default]
20    NotChecked,
21    /// The message carries no signature.
22    Unsigned,
23    /// The signature verified; this is the provenance it vouches for.
24    Verified(a2a_protocol_types::provenance::Provenance),
25}