cipherstash-client 0.12.5

The official CipherStash SDK
Documentation
#![doc(html_no_source)]
#![doc(html_favicon_url = "https://cipherstash.com/favicon.ico")]

//! ## CipherStash SDK
//!
//! The CipherStash SDK is the main way of interacting with CipherStash services. It includes
//! clients for talking to ZeroKMS, CipherStash Token Service (CTS) and the services used to power Audit.
//!
//! It also contains all the indexing and encryption logic used in CipherStash products.
//!
//! ## Getting Started
//!
//! ### Creating a ZeroKMS Client
//!
//! Use the [`ZeroKMSConfig`] to create a new [`ZeroKMS`] client. With this you can:
//!
//! - Manage datasets, config and clients
//! - Encrypt and decrypt data
//!
//! ```no_run
//! use cipherstash_client::ZeroKMSConfig;
//!
//! #[tokio::main]
//! async fn main() {
//!   let client = ZeroKMSConfig::builder()
//!     .with_env()
//!     .build()
//!     .expect("failed to build config")
//!     .create_client();
//!
//!   let dataset = client.create_dataset("users", "A dataset used to encrypt my users' information")
//!     .await
//!     .expect("failed to create dataset");
//! }
//! ```
//!
//! ### Creating a CTS Client
//!
//! Use the [`CtsConfig`] struct to create a new [`CTSClient`]. With this you can:
//!
//! - Manage access keys and identity tokens
//!
//! ```no_run
//! use cipherstash_client::{ CtsConfig, ConsoleConfig, CTSClient };
//!
//! #[tokio::main]
//! async fn main() {
//!   let console_config = ConsoleConfig::builder()
//!     .with_env()
//!     .build()
//!     .expect("failed to build config");
//!
//!   let cts_config = CtsConfig::builder()
//!     .with_env()
//!     .build()
//!     .expect("failed to build config");
//!
//!   let client = CTSClient::new(cts_config.base_url(), console_config.credentials());
//!
//!   let access_key = client.create_access_key("Test Access Key", "WORKSPACE-A")
//!     .await
//!     .expect("failed to create access key");
//! }
//! ```

pub mod config;
pub mod console;
pub mod credentials;
pub mod cts_client;
pub mod encryption;
pub mod logger_client;
pub mod management;
pub mod reqwest_client;
mod sleep;
mod user_agent;
pub mod zerokms;

// Re-export
pub use zerokms_protocol::cipherstash_config as schema;

pub use config::{ConsoleConfig, CtsConfig, ZeroKMSConfig};
pub use cts_client::CTSClient;
pub use zerokms::ZeroKMS;