summaryrefslogtreecommitdiff
path: root/pkg/backend/webapi.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2021-03-23 17:10:45 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-05-04 14:58:39 +0200
commitb14d048e6089233f5c698426652e85bfa1d89488 (patch)
treeb1542d03377740f7335c9848a751ad16426632f0 /pkg/backend/webapi.go
parent8c4edf29112a32f267d19717637bf2104c28b969 (diff)
Don't expose the full gateway out of the vpn module
We just care about locations and fullness.
Diffstat (limited to 'pkg/backend/webapi.go')
-rw-r--r--pkg/backend/webapi.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/backend/webapi.go b/pkg/backend/webapi.go
index a19d933..3e4efd3 100644
--- a/pkg/backend/webapi.go
+++ b/pkg/backend/webapi.go
@@ -64,12 +64,11 @@ func webGatewaySet(w http.ResponseWriter, r *http.Request) {
}
func webGatewayList(w http.ResponseWriter, r *http.Request) {
- gws, err := ctx.bm.ListGatewaysByCity(ctx.Provider)
+ locationJson, err := json.Marshal(ctx.bm.ListLocationFullness("openvpn"))
if err != nil {
- fmt.Fprintf(w, "ListGatewaysByCity() err: %v", err)
+ fmt.Fprintf(w, "Error converting json: %v", err)
}
- gwJson, _ := json.Marshal(gws)
- fmt.Fprintf(w, string(gwJson))
+ fmt.Fprintf(w, string(locationJson))
}
// TODO