diff --git a/backends/client.go b/backends/client.go index 1e1bff119..a598ed49e 100644 --- a/backends/client.go +++ b/backends/client.go @@ -47,6 +47,7 @@ func New(config Config) (StoreClient, error) { config.BasicAuth, config.Username, config.Password, + config.AuthToken, ) case "etcd": // Create the etcd client upfront and use it for the life of the process. diff --git a/backends/consul/client.go b/backends/consul/client.go index c6ed090a5..d926bbb73 100644 --- a/backends/consul/client.go +++ b/backends/consul/client.go @@ -13,7 +13,7 @@ type ConsulClient struct { } // NewConsulClient returns a new client to Consul for the given address -func New(nodes []string, scheme, cert, key, caCert string, basicAuth bool, username string, password string) (*ConsulClient, error) { +func New(nodes []string, scheme, cert, key, caCert string, basicAuth bool, username string, password string, authToken string) (*ConsulClient, error) { conf := api.DefaultConfig() conf.Scheme = scheme @@ -36,6 +36,9 @@ func New(nodes []string, scheme, cert, key, caCert string, basicAuth bool, usern if caCert != "" { conf.TLSConfig.CAFile = caCert } + if authToken != "" { + conf.Token = authToken + } client, err := api.NewClient(conf) if err != nil {