-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
nmrsChanges to nmrsChanges to nmrsrefactorChange or improve codeChange or improve codevpnChanges to VPN surfaceChanges to VPN surface
Description
part of #288
current VpnCredentials has wireguard-specific fields baked in. introduce a trait-based abstraction so openvpn (and future protocols) don't bloat the same struct.
changes
add VpnConfig trait in api/models/vpn.rs:
pub trait VpnConfig: Send + Sync + std::fmt::Debug {
fn vpn_type(&self) -> VpnType;
fn name(&self) -> &str;
fn gateway(&self) -> &str;
fn dns(&self) -> Option<&[String]>;
fn mtu(&self) -> Option<u32>;
fn uuid(&self) -> Option<uuid::Uuid>;
}add WireGuardConfig struct as the new preferred wireguard config type, implementing VpnConfig.
impl VpnConfig for VpnCredentials for backward compat — deprecate VpnCredentials with a note pointing to WireGuardConfig.
change connect_vpn(&self, config: impl VpnConfig) in network_manager.rs. non-breaking since VpnCredentials implements the trait and callers use type inference.
files
api/models/vpn.rs— trait,WireGuardConfig, deprecationapi/network_manager.rs— signature changelib.rs— re-exports
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
nmrsChanges to nmrsChanges to nmrsrefactorChange or improve codeChange or improve codevpnChanges to VPN surfaceChanges to VPN surface