1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-09 04:30:31 +08:00

AUTH-2785 service token flag fix and logger fix

This commit is contained in:
Dalton
2020-06-08 17:01:48 -05:00
parent f8638839c0
commit 0d87279b2f
6 changed files with 35 additions and 9 deletions

View File

@@ -9,8 +9,10 @@ import (
// Forwarder represents a client side listener to forward traffic to the edge
type Forwarder struct {
URL string `json:"url"`
Listener string `json:"listener"`
URL string `json:"url"`
Listener string `json:"listener"`
TokenClientID string `json:"service_token_id" yaml:"serviceTokenID"`
TokenSecret string `json:"secret_token_id" yaml:"serviceTokenSecret"`
}
// Tunnel represents a tunnel that should be started
@@ -46,6 +48,8 @@ func (f *Forwarder) Hash() string {
h := md5.New()
io.WriteString(h, f.URL)
io.WriteString(h, f.Listener)
io.WriteString(h, f.TokenClientID)
io.WriteString(h, f.TokenSecret)
return fmt.Sprintf("%x", h.Sum(nil))
}