Skip to main content

appcore_security/
lib.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: lib.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/05/29 20:47:35 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/08/02 00:04:12 by dnettoRaw
8//      ###########      S: 1.0.1-rc.8
9// =============================================================================
10
11//! Security contracts for auth, policy, token trust, and secret boundaries.
12
13#![deny(missing_docs)]
14
15pub mod auth;
16pub mod dnt;
17pub mod filesystem;
18pub mod hashtoken;
19pub mod policy;
20pub mod redaction;
21mod request_hash;
22pub mod secret;
23mod secret_file;
24mod secret_keyring;
25#[cfg(windows)]
26mod secret_keyring_windows;
27pub mod token;
28#[cfg(windows)]
29mod update_ancestor_acl;
30pub mod vault;
31
32pub use auth::{AuthContext, AuthDecision, Authenticator};
33pub use dnt::{DntSecretKeyProvider, DntSecretRefPolicy};
34#[cfg(windows)]
35pub use filesystem::create_update_private_directory;
36pub use filesystem::{create_private_directory, open_private_directory, PrivateDirectoryGuard};
37pub use hashtoken::HashTokenProvider;
38pub use policy::{PolicyCheck, PolicyDecision};
39pub use redaction::redact_text;
40pub use secret::{
41    format_secret_material, new_rotated_secret, parse_secret_material, EnvSecretResolver,
42    PeerCredential, PeerCredentialProvider, SecretBytes, SecretFormatError, SecretResolver,
43    SecretStore, SecuritySecretMaterial, SecuritySecretMetadata, SecuritySecretRef,
44    SecuritySecretStatus, StaticPeerCredentialProvider, StaticSecretResolver,
45};
46pub use secret_file::FileSecretResolver;
47#[cfg(windows)]
48pub use secret_keyring::WINDOWS_DPAPI_USER_SECRET_KEYRING_FORMAT;
49pub use secret_keyring::{
50    FileSecretKeyring, SecretAccessError, SecretAccessResult, FILE_SECRET_KEYRING_FORMAT,
51};
52#[cfg(windows)]
53pub use secret_keyring_windows::WindowsDpapiSecretKeyring;
54pub use token::{
55    compute_borrowed_request_hash, compute_request_hash, CommandTokenError, CommandTokenFactory,
56    CommandTokenValidator, RequestPayloadRef, RequestValidationDetails,
57    RequestValidationDetailsRef, RuntimeTokenClaims, SecurityError, SecurityResult, TokenClaims,
58    TokenProvider, DEFAULT_RUNTIME_TOKEN_TTL_MS, LOCAL_ADMIN_SUBJECT,
59    MAX_RUNTIME_TOKEN_CLOCK_SKEW_MS,
60};
61pub use vault::{Vault, VaultState};