sagikazarmark / crypt

Store and retrieve encrypted configs from etcd or consul
MIT License
10 stars 15 forks source link

Support input etcd username and password #305

Open ahuigo opened 2 weeks ago

ahuigo commented 2 weeks ago

In order to maintain compatibility, how about start a new method like this?

func NewV3(machines []string) (*ClientV3, error) 

func NewV3Raw(config goetcdv3.Config) (*ClientV3, error) 
....

So I can pass username and password in viper like this:

cm, err = crypt.NewStandardEtcdV3ConfigManagerRaw(goetcdv3.Config{
    Endpoints: []string(rp.Endpoint()),
    Username: "my",
    Password: "pass",
})