Crates.io | etoml |
lib.rs | etoml |
version | 0.2.1 |
source | src |
created_at | 2023-09-08 15:27:01.480219 |
updated_at | 2023-09-08 23:30:15.818309 |
description | A command line utility for managing secrets in encrypted TOML files |
homepage | |
repository | https://github.com/axelerator/etoml |
max_upload_size | |
id | 967243 |
size | 1,948,474 |
A tool to create and manage application secrets securely protected in encrypted (with ChaCha) toml files.
This is basically a Rust/Toml port of ejson.
secrets.etoml
in your repository/opt/etoml/keys
(on your server)secrets.etoml
are encrypted via the CLI toolThe main difference to ejson is that it gives you a function to decrypt your secrets directly
into a struct
in your application.
cargo install etoml
To create/manage secret files you use the command line interface:
Usage: etoml-write <COMMAND>
Commands:
init Create a new encrypted TOML file
encrypt (Re-)encrypt unencrypted values in an existinf etoml file
decrypt decrypt unencrypted values in an existinf etoml file
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
In you app you can define a struct with the matching fields to decode your secrets into:
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct AppSecrets {
github: String
}
fn main() -> Result<(), etoml::EtomlError> {
let secrets = etoml::decrypt_default::<AppSecrets>()?;
println!("Github key: {}", secrets.github);
Ok(())
}