atproto_identity/
lib.rs

1//! # AT Protocol Identity Management Library
2//!
3//! Comprehensive Rust library for AT Protocol identity operations including DID resolution,
4//! handle resolution, and cryptographic key management. This is the core identity management
5//! library for building AT Protocol applications and services.
6//!
7//! ## Key Features
8//!
9//! - **Multi-Method DID Resolution**: Support for `did:plc`, `did:web`, and `did:key` methods
10//! - **Handle Resolution**: DNS and HTTP-based handle-to-DID resolution with conflict detection
11//! - **Cryptographic Key Operations**: P-256, P-384, and K-256 key generation, signing, and validation
12//! - **DID Document Management**: Parsing, validation, and caching of DID documents
13//! - **Storage Abstraction**: Pluggable storage with LRU cache implementation
14//! - **Configuration Management**: Environment-based configuration with validation
15//! - **Error Handling**: Structured error types with descriptive messages
16//!
17//! ## Architecture
18//!
19//! The library is organized into focused modules that can be used independently or together:
20//!
21//! - **`resolve`**: Core identity resolution logic for handles and DIDs
22//! - **`plc`**: PLC directory client for `did:plc` resolution
23//! - **`web`**: Web DID client for `did:web` resolution and URL conversion
24//! - **`key`**: Cryptographic operations including signature validation and key identification
25//! - **`model`**: Data structures for DID documents and AT Protocol entities
26//! - **`validation`**: Input validation for handles and DIDs
27//! - **`storage`**: Storage abstraction for DID document caching
28//! - **`config`**: Configuration management and environment variable handling
29//!
30//! ## Command-Line Tools
31//!
32//! When built with the `clap` feature, provides comprehensive CLI tools:
33//!
34//! - **`atproto-identity-resolve`**: Resolve AT Protocol handles and DIDs to canonical identifiers
35//! - **`atproto-identity-key`**: Generate and manage cryptographic keys (P-256, P-384, K-256)  
36//! - **`atproto-identity-sign`**: Create cryptographic signatures of JSON data
37//! - **`atproto-identity-validate`**: Validate cryptographic signatures
38
39#![forbid(unsafe_code)]
40#![warn(missing_docs)]
41
42pub mod config;
43pub mod errors;
44pub mod key;
45pub mod model;
46pub mod plc;
47pub mod resolve;
48pub mod storage;
49#[cfg(feature = "lru")]
50pub mod storage_lru;
51pub mod validation;
52pub mod web;
53
54#[cfg(feature = "axum")]
55pub mod axum;