signstar_common/
common.rs

1//! Common data for all Signstar functionalities.
2//!
3//! # Examples
4//!
5//! ```
6//! use signstar_common::common::get_data_home;
7//!
8//! // Get the directory below which all Signstar related data is stored.
9//! println!("{:?}", get_data_home());
10//! ```
11
12use std::path::PathBuf;
13
14/// The directory below which o store all Signstar related data.
15const DATA_HOME: &str = "/var/lib/signstar/";
16
17/// The file mode of directories containing credentials.
18pub const CREDENTIALS_DIR_MODE: u32 = 0o100700;
19
20/// The file mode of secret files.
21pub const SECRET_FILE_MODE: u32 = 0o100600;
22
23/// Get the directory below which all Signstar related data is stored.
24pub fn get_data_home() -> PathBuf {
25    PathBuf::from(DATA_HOME)
26}