From 0934799ccd94ec7ebedd06322ab4fad080bdff8e Mon Sep 17 00:00:00 2001 From: Anders Pitman Date: Tue, 21 Dec 2021 13:57:56 -0700 Subject: [PATCH] Clean up Tunnel struct a bit Removed unused CssId and moved members that should eventually be removed from the API surface (ie internal values) to be together so they're easier to identify later. --- database.go | 14 ++++++++------ ui_handler.go | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/database.go b/database.go index 416b8f5..4de430e 100644 --- a/database.go +++ b/database.go @@ -41,7 +41,6 @@ type DNSRecord struct { } type Tunnel struct { - Owner string `json:"owner"` Domain string `json:"domain"` ServerAddress string `json:"server_address"` ServerPort int `json:"server_port"` @@ -49,14 +48,17 @@ type Tunnel struct { Username string `json:"username"` TunnelPort int `json:"tunnel_port"` TunnelPrivateKey string `json:"tunnel_private_key"` - ClientName string `json:"client_name"` ClientAddress string `json:"client_address"` ClientPort int `json:"client_port"` AllowExternalTcp bool `json:"allow_external_tcp"` - AuthUsername string `json:"auth_username"` - AuthPassword string `json:"auth_password"` - CssId string `json:"css_id"` - TlsTermination string `json:"tls_termination"` + + // TODO: These are not used by clients and shouldn't be returned in + // API calls. + Owner string `json:"owner"` + ClientName string `json:"client_name"` + AuthUsername string `json:"auth_username"` + AuthPassword string `json:"auth_password"` + TlsTermination string `json:"tls_termination"` } func NewDatabase() (*Database, error) { diff --git a/ui_handler.go b/ui_handler.go index 1fb66d7..2c4f4c0 100644 --- a/ui_handler.go +++ b/ui_handler.go @@ -96,8 +96,6 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request tunnels := h.api.GetTunnels(tokenData) for domain, tun := range tunnels { - // TODO: might yield non-unique names - tun.CssId = strings.ReplaceAll(domain, ".", "-") tunnels[domain] = tun }