Skip to content

add openvpn input validation #294

@cachebag

Description

@cachebag

part of #288.

changes

add validate_openvpn_config(config: &OpenVpnConfig) in util/validation.rs:

  • connection name validation (reuse validate_connection_name)
  • remote server non-empty
  • port range check if set
  • auth-type-specific required field checks (username for password, certs for tls)
  • cert paths are non-empty strings (don't check file existence — that's NM's job)
  • dns validation (reuse existing)
  • mtu range check (reuse existing)

refactor validate_vpn_credentials to dispatch on VpnType instead of assuming wireguard.

tests

unit tests for each validation path — missing fields, invalid ports, auth type mismatches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestnmrsChanges to nmrsvpnChanges to VPN surface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions