feat: opnsense-config make sure file has not changed on remote since loading it before saving it, also fix group member Vec<u8> type was not able to deserialize when more than one member
Some checks failed
Run Check Script / check (pull_request) Failing after 30s

This commit is contained in:
2025-09-03 17:50:17 -04:00
parent a03327d7e4
commit f0d907d92f
9 changed files with 74 additions and 28 deletions

View File

@@ -51,6 +51,7 @@ pub struct OPNsense {
impl From<String> for OPNsense {
fn from(content: String) -> Self {
yaserde::de::from_str(&content)
.map_err(|e| println!("{}", e))
.expect("OPNSense received invalid string, should be full XML")
@@ -267,12 +268,12 @@ pub struct Bogons {
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
pub struct Group {
pub name: String,
pub description: String,
pub description: Option<String>,
pub scope: String,
pub gid: u32,
pub member: Vec<u32>,
pub member: String,
#[yaserde(rename = "priv")]
pub priv_field: String,
pub priv_field: Option<String>,
pub source_networks: Option<MaybeString>,
}