gaia_client/lib.rs
1//! # Gaia Client Library
2//!
3//! A Rust client library for interacting with the Gaia secret management daemon.
4//!
5//! ## Features
6//!
7//! - Secure mTLS communication with the Gaia daemon
8//! - Read secrets from your application's namespaces
9//! - Access common secrets shared across clients
10//! - Asynchronous API using Tokio
11//!
12//! ## Example
13//!
14//! ```no_run
15//! use gaia_client::{GaiaClient, GaiaClientConfig};
16//!
17//! #[tokio::main]
18//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
19//! let config = GaiaClientConfig::new(
20//! "localhost:50051",
21//! "/etc/gaia/certs/ca.crt",
22//! "/etc/gaia/certs/client.crt",
23//! "/etc/gaia/certs/client.key",
24//! );
25//!
26//! let mut client = GaiaClient::connect(config).await?;
27//!
28//! let secret = client.get_secret("production", "database_url").await?;
29//! println!("Secret value: {}", secret.value);
30//!
31//! Ok(())
32//! }
33//! ```
34
35// Use pre-generated protobuf code (checked into src/proto.rs)
36// This eliminates the need for protoc at build time
37#[allow(clippy::all)]
38#[allow(warnings)]
39pub mod proto {
40 include!("proto.rs");
41}
42
43mod client;
44mod config;
45mod error;
46mod tls;
47
48pub use client::{GaiaClient, LoadEnvOptions};
49pub use config::GaiaClientConfig;
50pub use error::{GaiaError, Result};
51pub use proto::{
52 gaia_client_client::GaiaClientClient, GetSecretRequest, Namespace, Secret,
53};