Skip to main content

ExtendedCardProvider

Trait ExtendedCardProvider 

Source
pub trait ExtendedCardProvider:
    Send
    + Sync
    + 'static {
    // Required method
    fn card_for<'a>(
        &'a self,
        ctx: &'a CallContext,
        configured: &'a AgentCard,
    ) -> Pin<Box<dyn Future<Output = Result<AgentCard, ServerError>> + Send + 'a>>;
}
Expand description

Chooses the extended agent card GetExtendedAgentCard serves to the caller of one request (spec §13.3 MAY).

It runs after the interceptor chain has authenticated the request, so CallContext::caller_identity and CallContext::auth_scheme name the caller. configured is the card set with with_extended_agent_card, with this server’s extensions already advertised on it; returning it unchanged serves it as before. An error refuses the request with that error, for a caller the agent does not describe itself to.

The card returned is checked as build() checks the configured one: it must be valid, it may declare push notifications only when a push sender is wired, and the extensions this server advertises are added to it when it leaves them out (refused on a signed card, which would no longer verify). A card that fails is not served: the request gets an internal error that says why.

Object-safe; registered with with_extended_card_provider.

Required Methods§

Source

fn card_for<'a>( &'a self, ctx: &'a CallContext, configured: &'a AgentCard, ) -> Pin<Box<dyn Future<Output = Result<AgentCard, ServerError>> + Send + 'a>>

The extended card for the caller of ctx.

§Errors

Whatever refusal the provider chooses; the request answers with it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§