Heavily customized version of smokesignal - https://whtwnd.com/kayrozen.com/3lpwe4ymowg2t
at main 88 lines 3.0 kB view raw
1//! # AT Protocol Module 2//! 3//! Implementation of the AT Protocol (atproto) client and related functionality for decentralized social networking. 4//! 5//! This module provides a comprehensive implementation of the AT Protocol, enabling smokesignal to 6//! operate as a distributed application on the AT Protocol network. It handles authentication, 7//! record management, and communication with Personal Data Servers (PDS). 8//! 9//! ## Architecture 10//! 11//! The AT Protocol implementation is organized into several key components: 12//! 13//! ### Core Protocol 14//! - **[`client`]** - AT Protocol client implementation for PDS communication 15//! - **[`xrpc`]** - XRPC (Cross-Protocol RPC) implementation for AT Protocol calls 16//! - **[`auth`]** - AT Protocol authentication and session management 17//! - **[`uri`]** - AT URI parsing and validation for resource identification 18//! 19//! ### Data Structures 20//! - **[`lexicon`]** - AT Protocol lexicon definitions for event and RSVP records 21//! - **[`datetime`]** - Date and time handling compatible with AT Protocol standards 22//! - **[`errors`]** - AT Protocol specific error handling 23//! 24//! ## Features 25//! 26//! ### Decentralized Identity 27//! - DID (Decentralized Identifier) resolution and management 28//! - Handle verification and mapping 29//! - Cross-server identity validation 30//! 31//! ### Record Management 32//! - Event record creation and updates in AT Protocol format 33//! - RSVP record management with proper linking 34//! - Automatic record versioning and history 35//! 36//! ### Federated Communication 37//! - Cross-PDS event discovery and synchronization 38//! - Distributed RSVP aggregation 39//! - Real-time updates across the network 40//! 41//! ### Security and Privacy 42//! - Cryptographic verification of records 43//! - User-controlled data sovereignty 44//! - Privacy-preserving federation 45//! 46//! ## AT Protocol Integration 47//! 48//! Smokesignal implements several AT Protocol lexicons: 49//! - `events.smokesignal.calendar.event` - Event record schema 50//! - `events.smokesignal.calendar.rsvp` - RSVP record schema 51//! - `community.lexicon.location` - Location data schema 52//! 53//! ## Example Usage 54//! 55//! ```rust,no_run 56//! use smokesignal::atproto::client::AtprotoClient; 57//! use smokesignal::atproto::auth::Session; 58//! 59//! async fn create_event_record() -> anyhow::Result<()> { 60//! let client = AtprotoClient::new("https://bsky.social")?; 61//! let session = Session::authenticate(&client, "user.bsky.social", "password").await?; 62//! 63//! // Create an event record 64//! let event_record = client.create_record( 65//! &session, 66//! "events.smokesignal.calendar.event", 67//! event_data, 68//! ).await?; 69//! 70//! println!("Created event record: {}", event_record.uri); 71//! Ok(()) 72//! } 73//! ``` 74 75 76pub mod atrium_auth; // New atrium-based auth implementation 77pub mod auth; 78pub mod client; 79pub mod datetime; 80pub mod errors; 81pub mod lexicon; 82pub mod uri; 83 84#[cfg(test)] 85mod test_atrium_auth; 86 87#[cfg(test)] 88mod integration_tests;