#[non_exhaustive]pub enum SecurityScheme {
ApiKey(ApiKeySecurityScheme),
Http(HttpAuthSecurityScheme),
OAuth2(Box<OAuth2SecurityScheme>),
OpenIdConnect(OpenIdConnectSecurityScheme),
MutualTls(MutualTlsSecurityScheme),
}Expand description
A security scheme supported by an agent.
§Wire format
In A2A v1.0 this is the SecurityScheme oneof from a2a.proto, so
its ProtoJSON encoding is a single-key object naming the arm:
{"apiKeySecurityScheme": {"location": "header", "name": "X-Api-Key"}}
{"httpAuthSecurityScheme": {"scheme": "bearer", "bearerFormat": "JWT"}}v0.3 used the OpenAPI-style internally tagged form instead
({"type": "apiKey", "in": "header", …}). Both are accepted; only the
v1.0 form is emitted, because §5.5 governs emission and the schema is the
normative definition of the JSON shape.
This changed in 0.8: earlier releases emitted the v0.3 form. A reference
a2a-sdk client parsed that via its own legacy-compatibility shim, but a
peer feeding the card straight to ParseDict(…, ignore_unknown_fields=True)
silently got schemes with empty contents — it saw the agent declare
authentication it could not use. See docs/official-tck-findings.md §7.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ApiKey(ApiKeySecurityScheme)
API key authentication (apiKeySecurityScheme).
Http(HttpAuthSecurityScheme)
HTTP authentication, e.g. Bearer or Basic (httpAuthSecurityScheme).
OAuth2(Box<OAuth2SecurityScheme>)
OAuth 2.0 (oauth2SecurityScheme).
Boxed to reduce the enum’s stack size.
OpenIdConnect(OpenIdConnectSecurityScheme)
OpenID Connect (openIdConnectSecurityScheme).
MutualTls(MutualTlsSecurityScheme)
Mutual TLS (mtlsSecurityScheme).
Implementations§
Trait Implementations§
Source§impl Clone for SecurityScheme
impl Clone for SecurityScheme
Source§fn clone(&self) -> SecurityScheme
fn clone(&self) -> SecurityScheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityScheme
impl Debug for SecurityScheme
Source§impl<'de> Deserialize<'de> for SecurityScheme
impl<'de> Deserialize<'de> for SecurityScheme
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SecurityScheme, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SecurityScheme, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl From<LegacySecurityScheme> for SecurityScheme
impl From<LegacySecurityScheme> for SecurityScheme
Source§fn from(v: LegacySecurityScheme) -> SecurityScheme
fn from(v: LegacySecurityScheme) -> SecurityScheme
Source§impl Serialize for SecurityScheme
impl Serialize for SecurityScheme
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl TryFrom<SecurityScheme> for SecurityScheme
impl TryFrom<SecurityScheme> for SecurityScheme
Source§type Error = ConvertError
type Error = ConvertError
Source§fn try_from(
value: SecurityScheme,
) -> Result<SecurityScheme, <SecurityScheme as TryFrom<SecurityScheme>>::Error>
fn try_from( value: SecurityScheme, ) -> Result<SecurityScheme, <SecurityScheme as TryFrom<SecurityScheme>>::Error>
Source§impl TryFrom<SecurityScheme> for SecurityScheme
impl TryFrom<SecurityScheme> for SecurityScheme
Source§type Error = ConvertError
type Error = ConvertError
Source§fn try_from(
value: SecurityScheme,
) -> Result<SecurityScheme, <SecurityScheme as TryFrom<SecurityScheme>>::Error>
fn try_from( value: SecurityScheme, ) -> Result<SecurityScheme, <SecurityScheme as TryFrom<SecurityScheme>>::Error>
Auto Trait Implementations§
impl Freeze for SecurityScheme
impl RefUnwindSafe for SecurityScheme
impl Send for SecurityScheme
impl Sync for SecurityScheme
impl Unpin for SecurityScheme
impl UnsafeUnpin for SecurityScheme
impl UnwindSafe for SecurityScheme
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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>
T in a tonic::Request