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
Guard.NotNull(configurationProvider,nameof(configurationProvider),"Requires a command line configuration provider instance to load the command arguments as secrets");
Guard.NotNullOrWhitespace(secretsDirectoryPath,nameof(secretsDirectoryPath),"Requires a directory path inside the Docker container where the secrets are located");
Guard.NotNull(builder,nameof(builder),"Requires a secret store builder to add the Docker secrets to");
27
-
Guard.NotNullOrWhitespace(directoryPath,nameof(directoryPath),"Requires a non-blank directory path inside the Docker container to locate the secrets");
28
-
Guard.For(()=>!Path.IsPathRooted(directoryPath),
29
-
newArgumentException("Requires an absolute directory path inside the Docker container to located the secrets",nameof(directoryPath)));
30
-
31
-
if(!Directory.Exists(directoryPath))
32
-
{
33
-
thrownewDirectoryNotFoundException($"The directory {directoryPath} which is configured as secretsDirectoryPath does not exist.");
@@ -52,10 +41,20 @@ public static SecretStoreBuilder AddDockerSecrets(
52
41
stringname,
53
42
Func<string,string>mutateSecretName)
54
43
{
55
-
Guard.NotNull(builder,nameof(builder),"Requires a secret store builder to add the Docker secrets to");
56
-
Guard.NotNullOrWhitespace(directoryPath,nameof(directoryPath),"Requires a non-blank directory path inside the Docker container to locate the secrets");
57
-
Guard.For(()=>!Path.IsPathRooted(directoryPath),
58
-
newArgumentException("Requires an absolute directory path inside the Docker container to located the secrets",nameof(directoryPath)));
44
+
if(builderisnull)
45
+
{
46
+
thrownewArgumentNullException(nameof(builder));
47
+
}
48
+
49
+
if(string.IsNullOrWhiteSpace(directoryPath))
50
+
{
51
+
thrownewArgumentException("Requires a non-blank directory path inside the Docker container to locate the secrets",nameof(directoryPath));
52
+
}
53
+
54
+
if(!Path.IsPathRooted(directoryPath))
55
+
{
56
+
thrownewArgumentException("Requires an absolute directory path inside the Docker container to located the secrets",nameof(directoryPath));
@@ -21,7 +20,11 @@ public string KeyValueMountPoint
21
20
get=>_keyValueMountPoint;
22
21
set
23
22
{
24
-
Guard.NotNullOrWhitespace(value,nameof(value),"Requires a non-blank point where the KeyVault secret engine is mounted");
23
+
if(string.IsNullOrWhiteSpace(value))
24
+
{
25
+
thrownewArgumentException("Requires a non-blank point where the KeyVault secret engine is mounted",nameof(value));
26
+
}
27
+
25
28
_keyValueMountPoint=value;
26
29
}
27
30
}
@@ -35,7 +38,11 @@ public VaultKeyValueSecretEngineVersion KeyValueVersion
35
38
get=>_engineVersion;
36
39
set
37
40
{
38
-
Guard.For<ArgumentOutOfRangeException>(()=>!Enum.IsDefined(typeof(VaultKeyValueSecretEngineVersion),value),"Requires the client API version to be either V1 or V2");
0 commit comments