@@ -76,6 +76,7 @@ internal const string
7676 HighPrioritySocketThreads = "highPriorityThreads" ,
7777 KeepAlive = "keepAlive" ,
7878 ClientName = "name" ,
79+ User = "user" ,
7980 Password = "password" ,
8081 PreserveAsyncOrder = "preserveAsyncOrder" ,
8182 Proxy = "proxy" ,
@@ -104,6 +105,7 @@ internal const string
104105 DefaultDatabase ,
105106 HighPrioritySocketThreads ,
106107 KeepAlive ,
108+ User ,
107109 Password ,
108110 PreserveAsyncOrder ,
109111 Proxy ,
@@ -305,6 +307,11 @@ public int ConnectTimeout
305307 public int KeepAlive { get { return keepAlive . GetValueOrDefault ( - 1 ) ; } set { keepAlive = value ; } }
306308#pragma warning restore RCS1128 // Use coalesce expression.
307309
310+ /// <summary>
311+ /// The user to use to authenticate with the server.
312+ /// </summary>
313+ public string User { get ; set ; }
314+
308315 /// <summary>
309316 /// The password to use to authenticate with the server.
310317 /// </summary>
@@ -441,6 +448,7 @@ public ConfigurationOptions Clone()
441448 allowAdmin = allowAdmin ,
442449 defaultVersion = defaultVersion ,
443450 connectTimeout = connectTimeout ,
451+ User = User ,
444452 Password = Password ,
445453 tieBreaker = tieBreaker ,
446454 writeBuffer = writeBuffer ,
@@ -505,6 +513,7 @@ public string ToString(bool includePassword)
505513 Append ( sb , OptionKeys . AllowAdmin , allowAdmin ) ;
506514 Append ( sb , OptionKeys . Version , defaultVersion ) ;
507515 Append ( sb , OptionKeys . ConnectTimeout , connectTimeout ) ;
516+ Append ( sb , OptionKeys . User , User ) ;
508517 Append ( sb , OptionKeys . Password , ( includePassword || string . IsNullOrEmpty ( Password ) ) ? Password : "*****" ) ;
509518 Append ( sb , OptionKeys . TieBreaker , tieBreaker ) ;
510519 Append ( sb , OptionKeys . WriteBuffer , writeBuffer ) ;
@@ -597,9 +606,10 @@ private static void Append(StringBuilder sb, string prefix, object value)
597606
598607 private void Clear ( )
599608 {
600- ClientName = ServiceName = Password = tieBreaker = sslHost = configChannel = null ;
609+ ClientName = ServiceName = User = Password = tieBreaker = sslHost = configChannel = null ;
601610 keepAlive = syncTimeout = asyncTimeout = connectTimeout = writeBuffer = connectRetry = configCheckSeconds = DefaultDatabase = null ;
602611 allowAdmin = abortOnConnectFail = highPrioritySocketThreads = resolveDns = ssl = null ;
612+ SslProtocols = null ;
603613 defaultVersion = null ;
604614 EndPoints . Clear ( ) ;
605615 commandMap = null ;
@@ -686,6 +696,9 @@ private void DoParse(string configuration, bool ignoreUnknown)
686696 case OptionKeys . Version :
687697 DefaultVersion = OptionKeys . ParseVersion ( key , value ) ;
688698 break ;
699+ case OptionKeys . User :
700+ User = value ;
701+ break ;
689702 case OptionKeys . Password :
690703 Password = value ;
691704 break ;
0 commit comments