Skip to content

Commit

Permalink
Added a method to reset Vault token manually (#44)
Browse files Browse the repository at this point in the history
* Added a method to reset Vault token manually

* Fixed linter
  • Loading branch information
MrZoidberg authored Jan 28, 2024
1 parent 9bf66d5 commit 1e67d16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public VaultChangeWatcher(IConfiguration configuration, ILogger? logger = null)
}

this._logger = logger;

this._configProviders = configurationRoot.Providers.OfType<VaultConfigurationProvider>().Where(p => p.ConfigurationSource.Options.ReloadOnChange).ToList() !;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ public override void Load()
}
}

/// <summary>
/// This will fetch the vault token again before the new operation.
/// Use IConfiguration object: configurationRoot.Providers.OfType&lt;VaultConfigurationProvider&lt;().FirstOrDefault().ResetToken();
/// See https://github.com/rajanadar/VaultSharp/blob/34ab400c2a295f4a81d97fc5d65f38509c7e0f05/README.md?plain=1#L92
/// </summary>
public void ResetToken() => this.vaultClient?.V1.Auth.ResetVaultToken();

private async Task<bool> LoadVaultDataAsync(IVaultClient vaultClient)
{
var hasChanges = false;
Expand Down

0 comments on commit 1e67d16

Please sign in to comment.