Skip to main content

cairn_mod/
lib.rs

1//! Cairn — lightweight Rust-native ATProto labeler.
2//!
3//! This crate is a library surface (`cairn_mod`) plus a binary
4//! (`cairn`) for running a standalone labeler. The library modules
5//! mirror the §10 architecture of the [design doc][cairn-design]:
6//! storage, writer (single-writer task pattern, §F5), signing
7//! (§6.2), auth (§5.2), HTTP routers (§F3/F4/F11/F12), and CLI.
8//!
9//! Start points:
10//! - [`server::router`] for the subscribeLabels + queryLabels
11//!   public surface.
12//! - [`admin_router`] for the `tools.cairn.admin.*` endpoints.
13//! - [`serve::run`] for the full binary lifecycle.
14//!
15//! [cairn-design]: https://github.com/skydeval/cairn-mod/blob/main/cairn-design.md
16
17#![forbid(unsafe_code)]
18#![warn(missing_docs)]
19
20pub mod auth;
21pub mod cli;
22pub mod config;
23pub mod credential_file;
24pub mod error;
25pub mod label;
26pub mod report;
27pub mod serve;
28pub mod server;
29pub mod service_record;
30pub mod signing;
31pub mod signing_key;
32pub mod storage;
33pub mod writer;
34
35pub use auth::{AuthConfig, AuthContext, AuthError, VerifiedCaller};
36pub use config::Config;
37pub use error::{Error, Result};
38pub use label::Label;
39pub use server::{
40    AdminConfig, CreateReportConfig, SubscribeConfig, admin_router, create_report_router,
41    did_document_router, router as subscribe_router, serve, wellknown_router,
42};
43pub use signing::{canonical_bytes, label_to_lex_value_with_sig, sign_label, verify_label};
44pub use signing_key::SigningKey;
45pub use writer::{
46    ApplyLabelRequest, LabelEvent, NegateLabelRequest, WriterHandle, spawn as spawn_writer,
47};