Skip to main content

auths_id/
lib.rs

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