You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(string.IsNullOrEmpty(userName))thrownewArgumentException("Value cannot be null or empty.",nameof(userName));
24
33
if(string.IsNullOrEmpty(password))thrownewArgumentException("Value cannot be null or empty.",nameof(password));
25
34
26
35
UserName=userName;
27
36
Password=password;
37
+
UserNameSource=userNameSource;
38
+
PasswordSource=passwordSource;
39
+
Information=information;
28
40
}
29
41
42
+
/// <summary>
43
+
/// Gets the source of the user name.
44
+
/// </summary>
45
+
publicCredentialsSourceUserNameSource{get;}
46
+
47
+
/// <summary>
48
+
/// Gets the source of the password.
49
+
/// </summary>
50
+
publicCredentialsSourcePasswordSource{get;}
51
+
30
52
/// <summary>
31
53
/// Gets the name of the user.
32
54
/// </summary>
@@ -42,4 +64,158 @@ public Credentials(string userName, string password)
42
64
/// The password.
43
65
/// </value>
44
66
publicstringPassword{get;}
67
+
68
+
/// <summary>
69
+
/// Gets the information about the credentials.
70
+
/// </summary>
71
+
publicstring?Information{get;privateset;}
72
+
73
+
/// <summary>
74
+
/// Gets the string representation of the credentials.
75
+
/// </summary>
76
+
overridepublicstringToString()=>Information??"etcd code based credentials";
77
+
78
+
/// <summary>
79
+
/// Creates a new credentials instance overriding values from environment variables if they are exists.
80
+
/// </summary>
81
+
/// <param name="userName">The user name.</param>
82
+
/// <param name="password">The password.</param>
83
+
/// <param name="userNameEnvironmentVariableName">The name of the user name environment variable.</param>
84
+
/// <param name="passwordEnvironmentVariableName">The name of the password environment variable.</param>
85
+
/// <exception cref="EtcdException">The etcd user name or password are not provided via code and not found in the environment variable `{userNameEnvironmentVariableName}`.</exception>
/// Creates a new credentials instance overriding values from environment variables if they are exists.
128
+
/// </summary>
129
+
/// <param name="userName">The user name.</param>
130
+
/// <param name="password">The password.</param>
131
+
/// <param name="passwordEnvironmentVariableName">The name of the password environment variable.</param>
132
+
/// <exception cref="EtcdException">The etcd user name or password are not provided via code and not found in the environment variable `{userNameEnvironmentVariableName}`.</exception>
/// Creates a new credentials instance from environment variables.
167
+
/// </summary>
168
+
/// <param name="userNameEnvironmentVariableName">The name of the user name environment variable.</param>
169
+
/// <param name="passwordEnvironmentVariableName">The name of the password environment variable.</param>
170
+
/// <exception cref="EtcdException">The etcd user name or password are not provided via code and not found in the environment variable `{userNameEnvironmentVariableName}`.</exception>
Copy file name to clipboardExpand all lines: tests/Integration/Etcd.Microsoft.Extensions.Configuration.IntegrationTests.Core/ConfigurationBuilderTests.cs
0 commit comments