Skip to content

Commit 2b3a072

Browse files
authored
Adding namespace to VaultOptions (#20)
1 parent 3e583a4 commit 2b3a072

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Source/VaultSharp.Extensions.Configuration/VaultConfigurationProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public override void Load()
7070
var vaultClientSettings = new VaultClientSettings(this._source.Options.VaultAddress, authMethod)
7171
{
7272
UseVaultTokenHeaderInsteadOfAuthorizationHeader = true,
73+
Namespace = this._source.Options.Namespace,
7374
};
7475
this._vaultClient = new VaultClient(vaultClientSettings);
7576
}

Source/VaultSharp.Extensions.Configuration/VaultOptions.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class VaultOptions
1919
/// <param name="reloadCheckIntervalSeconds">Interval in seconds to check Vault for any changes.</param>
2020
/// <param name="omitVaultKeyName">Omit Vault Key Name in Configuration Keys.</param>
2121
/// <param name="additionalCharactersForConfigurationPath">Additional characters for the Configuration path.</param>
22+
/// <param name="namespace">Vault namespace.</param>
2223
public VaultOptions(
2324
string vaultAddress,
2425
string? vaultToken,
@@ -27,7 +28,8 @@ public VaultOptions(
2728
bool reloadOnChange = false,
2829
int reloadCheckIntervalSeconds = 300,
2930
bool omitVaultKeyName = false,
30-
IEnumerable<char>? additionalCharactersForConfigurationPath = null)
31+
IEnumerable<char>? additionalCharactersForConfigurationPath = null,
32+
string? @namespace = null)
3133
{
3234
this.VaultAddress = vaultAddress;
3335
this.VaultToken = vaultToken;
@@ -37,6 +39,7 @@ public VaultOptions(
3739
this.ReloadCheckIntervalSeconds = reloadCheckIntervalSeconds;
3840
this.OmitVaultKeyName = omitVaultKeyName;
3941
this.AdditionalCharactersForConfigurationPath = additionalCharactersForConfigurationPath ?? Array.Empty<char>();
42+
this.Namespace = @namespace;
4043
}
4144

4245
/// <summary>
@@ -79,5 +82,10 @@ public VaultOptions(
7982
/// Gets an array of characters that will be used as a path to form the Configuration.
8083
/// </summary>
8184
public IEnumerable<char> AdditionalCharactersForConfigurationPath { get; }
85+
86+
/// <summary>
87+
/// Gets Vault namespace.
88+
/// </summary>
89+
public string? Namespace { get; }
8290
}
8391
}

0 commit comments

Comments
 (0)