About
This class is a convenient class for making communication regarding grid company clients easier.
The main purpose of the class is to ensure that the correct post-fixes according to grid company information is always given.
How it works
When invoking a method in the GridCompanyCredsClient, it invokes a method in the KeyVaultClient, always using that path to the data.
This makes sure that the cache functionality is always used.
Keys
When communicating to theis client, one only gives the GridCompanyNumber as an identifyer.
This is because, the class itself will provide the needed postfixes for the system to work.
This is done in this way to prevent mistakes and typeos along the way.
How to use it
All methods int he client is static, hence it is not nessesary to instantiate it, however prior to using it, one must ensure that the keyvaultclient is initialized.
Please look in the documentation for the KeyVaultClient to see how.
Functionality
In the GridCompanyCredsClient, the following methods are available:
- async Task<GridCompanyCreds> GetGridCompanyCreds(string gridCompanyIdentifier, bool maskPassword = true)
Return grid company creds as an object. The object is in the shared project for reference.
OBS IT IS IMPORTANT THAT THE PASSWORD IS ALWAYS MASKED WHEN RETURNIONG DATA TO THE UI. - async Task<string> SetGridCompanyCreds(GridCompanyCreds gridCompanyCreds)
Set all grid company creds in one go
async Task<bool> SetGridCompanyEndpoint(string gridCompanyIdentifier, string endpoint)
Set grid company endpoint - async Task<bool> SetGridCompanyUsername(string gridCompanyIdentifier, string username)
Set grid company username - async Task<bool> SetGridCompanyPassword(string gridCompanyIdentifier, string password)
Set grid company password - async Task<bool> SetGridCompanySecret(string key, string secret)
Set a secret in the keyvault - async Task<string> CreateGridCompanyCreds(string gridCompanyIdentifier, string endpoint, string username, string password)
When invoking this method, a new set of secrets are created in teh KeyVault with the information regarding connections to the grid company client.