Expand description
Authentication interceptor and credential storage.
AuthInterceptor injects Authorization headers from a
CredentialsStore before each request. InMemoryCredentialsStore
provides a simple in-process credential store.
§Usage
use std::sync::Arc;
use a2a_protocol_client::auth::{
InMemoryCredentialsStore, AuthInterceptor, SessionId, CredentialsStore,
};
use a2a_protocol_client::ClientBuilder;
let store = Arc::new(InMemoryCredentialsStore::new());
let session = SessionId::new("my-session");
store.set(session.clone(), "bearer", "my-token".into());
let _builder = ClientBuilder::new("http://localhost:8080")
.with_interceptor(AuthInterceptor::new(store, session));Structs§
- Auth
Interceptor - A
CallInterceptorthat injectsAuthorizationheaders from aCredentialsStore. - InMemory
Credentials Store - An in-memory
CredentialsStorebacked by anRwLock<HashMap>. - Session
Id - Opaque identifier for a client authentication session.
Traits§
- Credentials
Store - Persistent storage for auth credentials, keyed by session + scheme.