No need to duplicate a well-written API.
- Offer convenience accessors in Configuration[Builder]
- Make Configuration init non-optional
Sanity checks are done in Builder with throws and decoded object
is always deemed valid.
In order to avoid chaos from multiple profiles, retain the
profile to be installed and remove all the other ones. Also,
make sure to do the removal AFTER install, as doing it
before would trigger the VPN permission alert again.
XXX: there is some weird behavior from NetworkExtension
occasionally sending notifications with a bogus NEVPNManager
object having a nil .localizedDescription and other properties set
to nonsensical values. Discard the notification when such an object
is identified.
Encapsulate extra NetworkExtension settings:
- passwordReference
- onDemandRules
- disconnectsOnSleep
Also:
- Only set on-demand if any rules are set
- Assume VPN is enabled even with on-demand disabled
- Use DataCount instead of raw Int pair
Attach useful information to VPN notifications:
- VPN isEnabled
- VPN status
- VPN command error
- Tunnel bundle identifier (if available)
Expose specific OpenVPN/WireGuard shared data via extensions in
UserDefaults/FileManager.
Finally, drop incomplete IKE support. No fit.
- Make Configuration Codable
- Expose WireGuard ConfigurationError
- Produce ConfigurationBuilder from Configuration
- Support multiple peers
- Make private key a requirement