1#![cfg_attr(test, allow(clippy::indexing_slicing))]
17
18#[cfg(all(
19 feature = "keystore-backend",
20 not(any(feature = "db-keystore", feature = "onepassword"))
21))]
22compile_error!("feature `keystore-backend` requires feature `db-keystore`, `onepassword`, or both");
23
24pub const DEFAULT_SOCKET_PATH: &str = "/tmp/basil-agent.sock";
26
27pub(crate) fn ensure_crypto_provider() {
38 use std::sync::Once;
39 static INSTALL: Once = Once::new();
40 INSTALL.call_once(|| {
41 let _ = rustls::crypto::ring::default_provider().install_default();
42 });
43}
44
45pub mod agent_cli;
46pub mod bundle_cli;
47pub mod core;
48pub mod doctor;
49pub mod init;
50pub mod service;
51pub mod transport;
52pub mod unlock;
53
54#[cfg(feature = "tpm2")]
55pub use core::identity;
56pub use core::ml_dsa_sign;
57pub use core::{
58 actor, audit, backend, capability, catalog, decision, ed25519_sign, event, manager, minter,
59 ml_kem_envelope, peer, reconcile, reload, revocation, seal, state, x25519_seal,
60};
61pub use service::broker as grpc;
62#[cfg(feature = "http")]
63pub use service::jwks;
64pub use service::sds;
65pub use service::spiffe;
66pub use transport::grpc_server;
67
68pub use audit::{AuditLog, ReloadActor};
69#[cfg(feature = "keystore-backend")]
70pub use backend::keystore::KeystoreBackend;
71pub use backend::spiffe::{SpiffeConfig, SpiffeVaultBackend};
72pub use backend::vault::VaultBackend;
73pub use backend::{Backend, BackendError, NewKey};
74pub use capability::{
75 CapabilityError, CapabilityGap, CapabilityPolicy, CapabilitySummary, enforce_capabilities,
76};
77pub use catalog::{
78 BackendKind, Capability, Catalog, Config, LoadError, LoadWarning, MissingPolicy,
79 ResolvedPolicy, load,
80};
81pub use decision::{DecisionRecord, Outcome};
82pub use event::{BrokerEvent, BrokerEventKind, EventSource};
83pub use grpc_server::{DEFAULT_SOCKET_MODE, ServerConfig, run as run_grpc};
84pub use manager::{BackendManager, ManagerError};
85pub use peer::PeerInfo;
86pub use reconcile::{CheckReport, KeyCheck, KeyStatus, ReconcileError, ReconcileSummary};
87pub use reload::{ReloadError, ReloadInputs, ReloadOutcome, check_reload, reload_generation};
88pub use revocation::JwtRevocationStore;
89pub use seal::{
90 BackendCred, CredBundle, MasterKek, MethodKind, MethodRegistry, ParsedBundle, SealError,
91 SlotSpec, UnlockError, UnlockMethod,
92};
93pub use state::{
94 BrokerLimits, BrokerState, DEFAULT_MAX_ENCRYPT_SIZE, DEFAULT_MAX_PAYLOAD_SIZE,
95 DEFAULT_ROTATION_GRACE_VERSIONS, DEFAULT_SVID_TTL_SECS, Generation, INITIAL_GENERATION_ID,
96};