Crate helvetia_client[][src]

Helvetia Client

This library contains an HTTP client for the Helvetia API. It follows the v0 API spec.


There are three main operations that this client supports: create a secret, get its data/metadata, delete a secret. Here’s an example of all three:

use url;
use helvetia_client::{Data,Meta,HelvetiaClient};

let owner_token = "owner_token";
let meta_token = "meta_token";
let secret_name = "secret";
let data = "The cake is a lie";
let meta = "Aperture";

// Create a client.
let server_url = url::Url::parse("")?;
let client = HelvetiaClient::from_url(server_url)?;

// Create a secret.
let data_req = Data::new(owner_token, data);
let meta_req = Meta::new(meta_token, meta);
let res = client.create_secret(secret_name, data_req, Some(meta_req)).await?;
assert_eq!(res, ());

// Get the data of a secret.
let res = client.get_secret_data(secret_name, owner_token).await?;
assert_eq!(&res, data);

// Get the metadata of a secret.
let res = client.get_secret_meta(secret_name, meta_token).await?;
assert_eq!(&res, meta);

// Delete a secret.
let res = client.delete_secret(secret_name, owner_token).await?;
assert_eq!(res, ());



The required data for creating a Helvetia secret.


The HTTP client for the Helvetia API.


The optional metadata for a Helvetia secret.



Errors for every problem that the Helvetia client may encounter.

Type Definitions


Alias for a Helvetia client result.