Skip to main content

joy_core/auth/
mod.rs

1// Copyright (c) 2026 Joydev GmbH (joydev.com)
2// SPDX-License-Identifier: MIT
3
4//! Cryptographic identity for Joy's Trust Model.
5//!
6//! Auth provides passphrase-derived Ed25519 identity keys using Argon2id
7//! for key derivation. This is the Trustship pillar of AI Governance:
8//! it answers "who is this?" with cryptographic proof rather than
9//! self-declaration.
10//!
11//! Key hierarchy:
12//! ```text
13//! Passphrase + Salt --[Argon2id]--> DerivedKey --[Ed25519]--> IdentityKeypair
14//! ```
15
16pub mod delegation;
17pub mod derive;
18pub mod session;
19pub mod sign;
20pub mod token;
21
22/// Cross-module test lock: modules in this tree mutate process-global
23/// `XDG_STATE_HOME` in their unit tests. Cargo runs tests in parallel, so
24/// without one shared mutex the modules would trample each other's
25/// per-test tempdir overrides.
26#[cfg(test)]
27pub(super) static STATE_ENV_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());