All four content-over-peer handlers prefer FIPS when the peer is in our federation and has advertised a FIPS npub; fall back to Tor otherwise (unknown peers, FIPS daemon down, transient failure). - content.handle_content_download_peer / _paid: DID-authenticated fetch, payment token header threaded through both transports. - content.handle_content_browse_peer / _preview: no DID header by design (anonymous browse) — still benefits from FIPS when the peer happens to be federated. - federation::fips_npub_for_onion: storage helper that looks up a peer's FIPS npub from the federation nodes file given their onion address. Suffix-tolerant (`abc` matches `abc.onion`). Preserves the Tor-only path for truly unknown peers: PeerRequest returns Err from the Tor branch instead of silently succeeding, matching the previous behavior when the peer was unreachable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
747 B
Rust
21 lines
747 B
Rust
//! Node federation: trusted multi-node clusters with state sync.
|
|
//!
|
|
//! Nodes federate by exchanging invite codes containing DID + onion address.
|
|
//! Trust is bilateral — both sides must agree. Federated nodes periodically
|
|
//! sync container status, health metrics, and availability.
|
|
|
|
mod invites;
|
|
pub mod pending;
|
|
mod storage;
|
|
mod sync;
|
|
mod types;
|
|
|
|
// Re-export all public items so `crate::federation::*` continues to work.
|
|
pub use invites::{accept_invite, create_invite};
|
|
pub use storage::{
|
|
add_node, fips_npub_for_onion, load_nodes, remove_node, save_nodes, set_trust_level,
|
|
update_node,
|
|
};
|
|
pub use sync::{build_local_state, deploy_to_peer, sync_with_peer};
|
|
pub use types::{AppStatus, FederatedNode, NodeStateSnapshot, TrustLevel};
|