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 moderation;
28pub mod moderators;
29pub mod report;
30pub mod serve;
31pub mod server;
32pub mod service_record;
33pub mod signing;
34pub mod signing_key;
35pub mod storage;
36pub mod writer;
37
38pub use auth::{AuthConfig, AuthContext, AuthError, VerifiedCaller};
39pub use config::Config;
40pub use error::{Error, Result};
41pub use label::Label;
42pub use moderation::policy::StrikePolicy;
43pub use moderation::reasons::ReasonVocabulary;
44pub use server::{
45    AdminConfig, CreateReportConfig, RetentionConfig, SubscribeConfig, admin_router,
46    create_report_router, current_retention_floor, did_document_router, health_router,
47    public_router, router as subscribe_router, serve, wellknown_router,
48};
49pub use signing::{canonical_bytes, label_to_lex_value_with_sig, sign_label, verify_label};
50pub use signing_key::SigningKey;
51pub use writer::{
52    ApplyLabelRequest, LabelEvent, NegateLabelRequest, RecordActionRequest, RecordedAction,
53    RevokeActionRequest, RevokedAction, SweepBatchResult, SweepRequest, SweepResult, WriterHandle,
54    spawn as spawn_writer,
55};