feat(providers): add AirVPN support (#1145)

This commit is contained in:
Quentin McGaw
2022-10-17 02:54:56 -04:00
committed by GitHub
parent f70609c464
commit f15dde6502
22 changed files with 18722 additions and 10 deletions

View File

@@ -54,6 +54,12 @@ func (w Wireguard) validate(vpnProvider string) (err error) {
return fmt.Errorf("private key is not valid: %w", err)
}
if vpnProvider == providers.Airvpn {
if *w.PreSharedKey == "" {
return fmt.Errorf("%w", ErrWireguardPreSharedKeyNotSet)
}
}
// Validate PreSharedKey
if *w.PreSharedKey != "" { // Note: this is optional
_, err = wgtypes.ParseKey(*w.PreSharedKey)