pub struct FederationConfig {
pub policy: QuorumPolicy,
pub peers: Vec<PeerEndpoint>,
pub client: Client,
pub sender_agent_id: String,
pub api_key: Option<String>,
pub signing_key: Option<Arc<SigningKey>>,
}Expand description
Configured-at-serve federation state. Parsed from
--quorum-writes + --quorum-peers + --quorum-timeout-ms.
Fields§
§policy: QuorumPolicy§peers: Vec<PeerEndpoint>§client: Client§sender_agent_id: String§api_key: Option<String>v0.7.0 fold-A2A1.4 (#702) — the operator-configured [api] api_key
from the local daemon’s AppConfig, threaded here so outbound
federation POSTs can attach the x-api-key header. Without this,
a peer that itself runs with api_key set rejects every fanout
with 401 and quorum can never converge across hosts. None means
the local daemon doesn’t run with api-key auth — outbound headers
stay unmodified (backwards-compatible with mTLS-only deployments
and the v0.6.x default-off auth posture).
signing_key: Option<Arc<SigningKey>>v0.7.0 #791 — Ed25519 signing key the outbound post_once uses
to compute the X-Memory-Sig: ed25519=<base64> header. None
= no header attached (legacy peers + receivers that opted out
via AI_MEMORY_FED_REQUIRE_SIG=0 keep working).
Implementations§
Source§impl FederationConfig
impl FederationConfig
Sourcepub fn build(
quorum_writes: usize,
peer_urls: &[String],
timeout: Duration,
client_cert_path: Option<&Path>,
client_key_path: Option<&Path>,
ca_cert_path: Option<&Path>,
sender_agent_id: String,
api_key: Option<String>,
) -> Result<Option<Self>>
pub fn build( quorum_writes: usize, peer_urls: &[String], timeout: Duration, client_cert_path: Option<&Path>, client_key_path: Option<&Path>, ca_cert_path: Option<&Path>, sender_agent_id: String, api_key: Option<String>, ) -> Result<Option<Self>>
Build a FederationConfig from the serve-time CLI flags. Returns
None when federation is disabled (quorum_writes == 0 or the
peer list is empty).
api_key carries the local daemon’s configured [api] api_key
(issue #702, v0.7.0 fold-A2A1.4). When Some, every outbound
federation POST attaches an x-api-key header so peers that
themselves run with api-key auth accept the request. None
preserves the backwards-compatible header set used by mTLS-only
deployments — outbound POSTs stay unauthenticated at the
application layer and rely on the TLS layer for trust.
§Errors
Returns an error if the reqwest client cannot be constructed with the supplied certificate material.
Sourcepub fn peer_count(&self) -> usize
pub fn peer_count(&self) -> usize
Count of peers in the mesh (excludes the local node). Useful for metrics labels.
Trait Implementations§
Source§impl Clone for FederationConfig
impl Clone for FederationConfig
Source§fn clone(&self) -> FederationConfig
fn clone(&self) -> FederationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FederationConfig
impl !UnwindSafe for FederationConfig
impl Freeze for FederationConfig
impl Send for FederationConfig
impl Sync for FederationConfig
impl Unpin for FederationConfig
impl UnsafeUnpin for FederationConfig
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> ErasedDestructor for Twhere
T: 'static,
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 more