Fixes Patches Creation & More

Working with files / Paths fixed

Websocket PingPongs (There is no data behind this just PingPong)

Storing User Profiles correctly

Added necessary dependencies and initial code support for: - X.509
certificate handling via x509/pkcs8 crates - Key generation and crypto
operations via x448/sha2 - Structured hex encoding and base64 encoding
This commit is contained in:
Alex Emmet 2025-09-23 20:26:48 +00:00
commit 0d07ddf851
23 changed files with 887 additions and 266 deletions

View file

@ -1,9 +1,13 @@
use crate::util::file_util::{load_file, save_file};
use json::JsonValue;
use once_cell::sync::Lazy;
use std::fs::{self, File};
use std::path::Path;
use std::sync::Mutex;
use uuid::Uuid;
pub static CONFIG: Lazy<Mutex<ConfigUtil>> = Lazy::new(|| Mutex::new(ConfigUtil::new()));
pub struct ConfigUtil {
pub config: JsonValue,
pub unique: bool,
@ -24,6 +28,14 @@ impl ConfigUtil {
}
}
pub fn get_iota_id(&self) -> Uuid {
self.config["iota_id"]
.as_str()
.unwrap_or_default()
.parse()
.unwrap_or_default()
}
pub fn change(&mut self, key: &str, value: Uuid) {
self.config[key] = JsonValue::String(value.to_string());
self.unique = true;