Files
harmony/opnsense-config/Cargo.toml
Jean-Gabriel Gill-Couture a7f9b1037a
Some checks failed
Run Check Script / check (pull_request) Failing after 19s
refactor: push harmony_types enums all the way down to opnsense-api
Move vendor-neutral IaC enums to harmony_types::firewall. Add From impls
in opnsense-api::wire converting harmony_types to generated OPNsense
types. Add typed methods in opnsense-config that accept harmony_types
enums and handle wire conversion internally.

Score layer no longer builds serde_json::json!() bodies — it passes
harmony_types enums directly to opnsense-config typed methods:
  ensure_filter_rule(&FirewallAction, &Direction, &IpProtocol, ...)
  ensure_snat_rule_from(&IpProtocol, &NetworkProtocol, ...)
  ensure_dnat_rule(&IpProtocol, &NetworkProtocol, ...)
  ensure_vip_from(&VipMode, ...)
  ensure_lagg(..., &LaggProtocol, ...)

Type flow: harmony_types → Score → opnsense-config → From<> → generated → wire
No strings cross layer boundaries for typed fields.
2026-03-26 11:07:49 -04:00

35 lines
884 B
TOML

[package]
name = "opnsense-config"
edition = "2021"
version.workspace = true
readme.workspace = true
license.workspace = true
[dependencies]
serde = { version = "1.0.123", features = ["derive"] }
log = { workspace = true }
env_logger = { workspace = true }
russh = { workspace = true }
russh-keys = { workspace = true }
thiserror = "1.0"
async-trait = { workspace = true }
tokio = { workspace = true }
harmony_types = { path = "../harmony_types" }
opnsense-api = { path = "../opnsense-api" }
chrono = "0.4.38"
russh-sftp = "2.0.6"
serde_json = "1.0.133"
tokio-util = { version = "0.7.13", features = ["codec"] }
tokio-stream = "0.1.17"
uuid.workspace = true
sha2 = "0.10.9"
[dev-dependencies]
pretty_assertions.workspace = true
assertor.workspace = true
httptest = "0.16"
tokio-test.workspace = true
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(e2e_test)'] }