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 audit;
21pub mod auth;
22pub mod cli;
23pub mod config;
24pub mod credential_file;
25pub mod error;
26pub mod label;
27pub mod moderators;
28pub mod report;
29pub mod serve;
30pub mod server;
31pub mod service_record;
32pub mod signing;
33pub mod signing_key;
34pub mod storage;
35pub mod writer;
36
37pub use auth::{AuthConfig, AuthContext, AuthError, VerifiedCaller};
38pub use config::Config;
39pub use error::{Error, Result};
40pub use label::Label;
41pub use server::{
42    AdminConfig, CreateReportConfig, RetentionConfig, SubscribeConfig, admin_router,
43    create_report_router, current_retention_floor, did_document_router, health_router,
44    router as subscribe_router, serve, wellknown_router,
45};
46pub use signing::{canonical_bytes, label_to_lex_value_with_sig, sign_label, verify_label};
47pub use signing_key::SigningKey;
48pub use writer::{
49    ApplyLabelRequest, LabelEvent, NegateLabelRequest, SweepBatchResult, SweepRequest, SweepResult,
50    WriterHandle, spawn as spawn_writer,
51};