Refine WireGuard client routing and authentication UI
This commit is contained in:
1 parent
eabb3e4472
commit
41fb9d5631
33 files changed
+1709
-469
No files matched your search
@@ -0,0 +1,16 @@
|
||||
package api
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRoutingModeReflectsOnlyAuthorizedDefaultRoute(t *testing.T) {
|
||||
for _, tc := range []struct{ allowed, want string }{
|
||||
{"10.88.0.0/24", "split"},
|
||||
{"10.88.0.0/24, 0.0.0.0/0", "global_ipv4"},
|
||||
{"0.0.0.0/00", "split"},
|
||||
{"", "split"},
|
||||
} {
|
||||
if got := routingModeForAllowedIPs(tc.allowed); got != tc.want {
|
||||
t.Errorf("%q: got %q, want %q", tc.allowed, got, tc.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user