Skip to main content

auths_id/
lib.rs

1// crate-level allow during curve-agnostic refactor.
2#![allow(clippy::disallowed_methods)]
3#![deny(
4    clippy::print_stdout,
5    clippy::print_stderr,
6    clippy::exit,
7    clippy::dbg_macro
8)]
9#![warn(clippy::too_many_lines, clippy::cognitive_complexity)]
10//! # auths-id
11//!
12//! Identity management and attestation logic for Auths.
13//!
14//! This crate provides:
15//! - **Identity creation** via `did:key` and `did:keri` derivation
16//! - **Attestation management** for device linking
17//! - **Git storage** for identity and attestation persistence
18//!
19//! ## Architecture
20//!
21//! ```text
22//! ┌─────────────┐     ┌──────────────┐     ┌─────────────┐
23//! │  Identity   │────▶│  Attestation │────▶│ Git Storage │
24//! │ (did:keri)  │     │   (signed)   │     │  (refs/*)   │
25//! └─────────────┘     └──────────────┘     └─────────────┘
26//! ```
27//!
28//! ## Usage
29//!
30//! ```rust,ignore
31//! use auths_id::identity::Identity;
32//! use auths_id::attestation::Attestation;
33//!
34//! // Create an identity from a public key
35//! let identity = Identity::from_public_key(&pubkey_bytes)?;
36//!
37//! // Create an attestation linking a device
38//! let attestation = Attestation::builder()
39//!     .issuer(&identity.did)
40//!     .subject("did:key:z6MkDevice...")
41//!     .capability(Capability::SignCommit)
42//!     .build()?;
43//! ```
44//!
45//! ## Git Storage Layout
46//!
47//! | Ref | Content |
48//! |-----|---------|
49//! | `refs/auths/identity` | Identity metadata |
50//! | `refs/auths/attestations/nodes/<did>` | Attestations keyed by subject DID |
51//! | `refs/auths/device-kel/<prefix>` | Per-device KEL state |
52//! | `refs/auths/shared-kel/<prefix>` | Shared identity KEL state |
53//! | `refs/did/keri/<prefix>/kel` | KERI Key Event Log |
54//! | `refs/did/keri/<prefix>/receipts/<said>` | Witness receipts |
55
56#[cfg(feature = "git-storage")]
57pub mod agent_identity;
58pub mod attestation;
59pub mod domain;
60pub mod domain_separation;
61pub mod error;
62pub mod freeze;
63pub mod identity;
64pub mod keri;
65pub mod policy;
66pub mod ports;
67pub mod storage;
68pub mod trailer;
69#[cfg(feature = "git-storage")]
70pub mod trust;
71#[cfg(feature = "git-storage")]
72pub mod witness;
73pub mod witness_config;
74
75/// Test utilities for auths-id consumers (behind `test-utils` feature).
76#[cfg(feature = "test-utils")]
77#[allow(clippy::unwrap_used, clippy::expect_used)]
78pub mod testing;