From de6d771bc25a14b7c7ad18ef03b8d94c4c0b6506 Mon Sep 17 00:00:00 2001 From: Tristan Colgate Date: Tue, 28 Mar 2017 16:54:48 +0100 Subject: [PATCH] Add libkv Username and Password --- docs/toml.md | 7 +++++++ provider/kv/kv.go | 4 ++++ traefik.sample.toml | 8 +++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/toml.md b/docs/toml.md index 206b81bbd6..375cebe669 100644 --- a/docs/toml.md +++ b/docs/toml.md @@ -1305,6 +1305,13 @@ prefix = "/traefik" # # filename = "etcd.tmpl" +# Use etcd user/pass authentication +# +# Optional +# +# username = foo +# password = bar + # Enable etcd TLS connection # # Optional diff --git a/provider/kv/kv.go b/provider/kv/kv.go index ee511e9019..fc234fa4b5 100644 --- a/provider/kv/kv.go +++ b/provider/kv/kv.go @@ -24,6 +24,8 @@ type Provider struct { Endpoint string `description:"Comma separated server endpoints"` Prefix string `description:"Prefix used for KV store"` TLS *provider.ClientTLS `description:"Enable TLS support"` + Username string `description:"KV Username"` + Password string `description:"KV Password"` StoreType store.Backend Kvclient store.Store } @@ -33,6 +35,8 @@ func (p *Provider) CreateStore() (store.Store, error) { storeConfig := &store.Config{ ConnectionTimeout: 30 * time.Second, Bucket: "traefik", + Username: p.Username, + Password: p.Password, } if p.TLS != nil { diff --git a/traefik.sample.toml b/traefik.sample.toml index 12c4a0f1e8..928478ce3b 100644 --- a/traefik.sample.toml +++ b/traefik.sample.toml @@ -855,6 +855,13 @@ # # filename = "etcd.tmpl" +# Use etcd user/pass authentication +# +# Optional +# +# username = foo +# password = bar + # Enable etcd TLS connection # # Optional @@ -865,7 +872,6 @@ # key = "/etc/ssl/etcd.key" # insecureskipverify = true - ################################################################ # Zookeeper configuration backend ################################################################