public EtcdConfigurationRepository(EtcdOptions etcdOptions) { if (string.IsNullOrEmpty(etcdOptions.ConnectionString)) { throw new ArgumentNullException($"{nameof(etcdOptions.ConnectionString)} can't be null"); } if (etcdOptions.PrefixKeys == null || !etcdOptions.PrefixKeys.Any()) { throw new ArgumentNullException($"{nameof(etcdOptions.PrefixKeys)} can't be null"); } _etcdOptions = etcdOptions; _etcdClient = new EtcdClient(etcdOptions.ConnectionString, caCert: _etcdOptions.CaCert, clientCert: _etcdOptions.ClientCert, clientKey: _etcdOptions.ClientKey, publicRootCa: _etcdOptions.PublicRootCa); if (!string.IsNullOrEmpty(_etcdOptions.Username) && !string.IsNullOrEmpty(_etcdOptions.Password)) { var authRes = _etcdClient.Authenticate(new AuthenticateRequest { Name = _etcdOptions.Username, Password = _etcdOptions.Password }); _headers = new Metadata { { "Authorization", authRes.Token } }; } }