AUTH-2694 added destination header support to config file

This commit is contained in:
Dalton 2020-06-12 11:57:21 -05:00
parent 55acf7283c
commit 1a6403b2fd
2 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,10 @@ func StartForwarder(forwarder config.Forwarder, shutdown <-chan struct{}, logger
headers.Set(h2mux.CFAccessClientSecretHeader, forwarder.TokenSecret)
}
if forwarder.Destination != "" {
headers.Add(h2mux.CFJumpDestinationHeader, forwarder.Destination)
}
options := &carrier.StartOptions{
OriginURL: forwarder.URL,
Headers: headers, //TODO: TUN-2688 support custom headers from config file

View File

@ -13,6 +13,7 @@ type Forwarder struct {
Listener string `json:"listener"`
TokenClientID string `json:"service_token_id" yaml:"serviceTokenID"`
TokenSecret string `json:"secret_token_id" yaml:"serviceTokenSecret"`
Destination string `json:"destination"`
}
// Tunnel represents a tunnel that should be started
@ -50,6 +51,7 @@ func (f *Forwarder) Hash() string {
io.WriteString(h, f.Listener)
io.WriteString(h, f.TokenClientID)
io.WriteString(h, f.TokenSecret)
io.WriteString(h, f.Destination)
return fmt.Sprintf("%x", h.Sum(nil))
}