cipherstash-client 0.28.0

The official CipherStash SDK
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use lazy_static::lazy_static;
use std::env::consts::{ARCH, OS};

const VERSION: &str = env!("CARGO_PKG_VERSION");
const SECONDARY_AGENT: Option<&str> = option_env!("CIPHERSTASH_CLIENT_SECONDARY_USER_AGENT");

pub fn get_user_agent() -> &'static str {
    lazy_static! {
        static ref USER_AGENT: String = format!(
            "cipherstash-client/{VERSION} ({OS} {ARCH}{})",
            SECONDARY_AGENT.map(|x| format!(" {x}")).unwrap_or_default()
        );
    }

    &USER_AGENT
}