fix: WAN network support was broken

This commit is contained in:
Mateusz Filipowicz
2025-02-06 23:30:34 +01:00
parent 4be261d2a8
commit c393dcbe71
8 changed files with 13 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"
"github.com/paultyng/go-unifi/unifi"
"github.com/filipowm/go-unifi/unifi"
"github.com/tj/assert"
)

View File

@@ -231,7 +231,7 @@ type Network struct {
WANSmartqUpRate int `json:"wan_smartq_up_rate,omitempty"` // [0-9]{1,6}|1000000
WANType string `json:"wan_type,omitempty"` // disabled|dhcp|static|pppoe|dslite
WANTypeV6 string `json:"wan_type_v6,omitempty"` // disabled|slaac|dhcpv6|static
WANUsername string `json:"wan_username"` // [^"' ]+|^$
WANUsername string `json:"wan_username,omitempty"` // [^"' ]+|^$
WANVLAN int `json:"wan_vlan,omitempty"` // [0-9]|[1-9][0-9]{1,2}|[1-3][0-9]{3}|40[0-8][0-9]|409[0-4]|^$
WANVLANEnabled bool `json:"wan_vlan_enabled"`
WireguardClientConfigurationFile string `json:"wireguard_client_configuration_file,omitempty"`
@@ -257,7 +257,7 @@ type Network struct {
XServerKey string `json:"x_server_key,omitempty"`
XSharedClientCrt string `json:"x_shared_client_crt,omitempty"`
XSharedClientKey string `json:"x_shared_client_key,omitempty"`
XWANPassword string `json:"x_wan_password"` // [^"' ]+|^$
XWANPassword string `json:"x_wan_password,omitempty"` // [^"' ]+|^$
XWireguardPrivateKey string `json:"x_wireguard_private_key,omitempty"`
}

View File

@@ -5,7 +5,7 @@ import (
"reflect"
"testing"
"github.com/paultyng/go-unifi/unifi"
"github.com/filipowm/go-unifi/unifi"
)
func TestNetworkUnmarshalJSON(t *testing.T) {

View File

@@ -2,4 +2,4 @@
package unifi
const UnifiVersion = "9.0.108"
const UnifiVersion = "9.0.114"