$ show LemmyNet/activitypub-federation-rust
Activitypub-federation is a high-level Rust framework for implementing ActivityPub federation. It provides abstractions for handling incoming and outgoing activities, fetching remote objects, managing HTTP signatures, and integrating with web frameworks like Actix-web and Axum. The library uses a trait-based design where users define their own data structures and implement Object, Activity, and Actor traits to plug into the federation system. It includes sophisticated features like an activity queue with exponential backoff retry logic (1 minute, 1 hour, 2.5 days), automatic caching of remote objects, and comprehensive security measures including HTTP signature verification.
The LLM identified 1 files worth highlighting for reuse:
Contains deserialization helper functions that solve the common problem of handling both single values and arrays in JSON fields (e.g., 'to' and 'cc' fields in ActivityPub). The deserialize_one_or_many function gracefully handles cases where some platforms send single values while others send arrays, and also understands special 'Public' aliases. This demonstrates non-obvious serde expertise and is highly reusable in any JSON processing context with minimal dependencies.