summaryrefslogtreecommitdiff
path: root/internal/api/api_test.go
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 10:31:57 +0200
committerJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 13:25:48 +0200
commit6b939462fb1064abd42e8cb8316700ec844172ea (patch)
treeb572daecdf0f25e3beec9883a8b7bb2522628212 /internal/api/api_test.go
parent347b20fc91505584bc9efbeca89590a411b95e79 (diff)
All: Remove ProxyGuard integration
This should be done in WireGuard-go or in case of a linux a small daemon
Diffstat (limited to 'internal/api/api_test.go')
-rw-r--r--internal/api/api_test.go20
1 files changed, 1 insertions, 19 deletions
diff --git a/internal/api/api_test.go b/internal/api/api_test.go
index f611f07..6ad70f6 100644
--- a/internal/api/api_test.go
+++ b/internal/api/api_test.go
@@ -10,6 +10,7 @@ import (
"net/url"
"reflect"
"regexp"
+ "slices"
"strings"
"testing"
"time"
@@ -17,11 +18,9 @@ import (
"codeberg.org/eduVPN/eduvpn-common/internal/api/profiles"
httpw "codeberg.org/eduVPN/eduvpn-common/internal/http"
"codeberg.org/eduVPN/eduvpn-common/internal/test"
- "codeberg.org/eduVPN/eduvpn-common/internal/wireguard"
"codeberg.org/eduVPN/eduvpn-common/types/protocol"
"codeberg.org/eduVPN/eduvpn-common/types/server"
"github.com/jwijenbergh/eduoauth-go"
- "slices"
)
func tokenHandler(t *testing.T, gt []string) func(http.ResponseWriter, *http.Request) {
@@ -421,7 +420,6 @@ func TestAPIConnect(t *testing.T) {
Configuration: "openvpnconfig\nscript-security 0",
Protocol: protocol.OpenVPN,
Expires: time.Date(2000, time.January, 0, 0, 0, 0, 0, time.UTC),
- Proxy: nil,
},
protos: []protocol.Protocol{protocol.OpenVPN, protocol.WireGuard},
err: nil,
@@ -437,7 +435,6 @@ func TestAPIConnect(t *testing.T) {
PrivateKey = .*`,
Protocol: protocol.WireGuard,
Expires: time.Date(2000, time.January, 0, 0, 0, 0, 0, time.UTC),
- Proxy: nil,
},
protos: []protocol.Protocol{protocol.OpenVPN, protocol.WireGuard},
err: nil,
@@ -453,8 +450,6 @@ PrivateKey = .*`,
PrivateKey = .*`,
Protocol: protocol.WireGuardProxy,
Expires: time.Date(2000, time.January, 0, 0, 0, 0, 0, time.UTC),
- // proxy will be manually checked
- Proxy: &wireguard.Proxy{},
},
ptcp: true,
protos: []protocol.Protocol{protocol.OpenVPN, protocol.WireGuard},
@@ -490,19 +485,6 @@ PrivateKey = .*`,
// we have already checked the config using a regex
c.cd.Configuration = gcd.Configuration
- // check proxy manually
- if c.cd.Proxy != nil && gcd.Proxy != nil {
- if gcd.Proxy.Peer != "https://proxyendpoint" {
- t.Fatalf("config data proxy peer is no proxyendpoint with HTTPS scheme: %s", gcd.Proxy.Peer)
- }
- if gcd.Proxy.SourcePort <= 0 {
- t.Fatalf("got proxy source port is smaller or equal to 0: %v", gcd.Proxy.SourcePort)
- }
- if gcd.Proxy.ListenPort <= 0 {
- t.Fatalf("proxy listen port is smaller or equal to 0: %v", gcd.Proxy.ListenPort)
- }
- c.cd.Proxy = gcd.Proxy
- }
}
if !reflect.DeepEqual(gcd, c.cd) {
t.Fatalf("got connect data: %v, not equal to want: %v", gcd, c.cd)