public async Task <IEnumerable <string> > GetConfigNamesAsync(Guid appKey, Guid servKey, Guid envKey, bool decrypt = true) { IEnumerable <SecretItem> secretItems = await GetSecretItemsAsync(appKey, servKey, envKey); return(decrypt ? secretItems.Select(item => ConfigNameResolver.DecryptConfigName(appKey, servKey, envKey, item.Identifier.Name)) : secretItems.Select(item => item.Identifier.Name)); }
private async Task <IEnumerable <SecretItem> > GetSecretItemsAsync(Guid appKey, Guid servKey, Guid envKey) { IEnumerable <SecretItem> secretItems = await GetSecretItemsAsync(); return(from item in secretItems let configName = ConfigNameResolver.DecryptConfigName(appKey, servKey, envKey, item.Identifier.Name) where configName != null select item); }
public async Task <IEnumerable <(string Name, string Value)> > GetConfigsAsync(Guid appKey, Guid servKey, Guid envKey) { IEnumerable <SecretItem> secretItems = await GetSecretItemsAsync(appKey, servKey, envKey); List <Task <(string Name, string Value)> > valueTasks = secretItems.Select(async item => ( ConfigNameResolver.DecryptConfigName(appKey, servKey, envKey, item.Identifier.Name), (await _client.GetSecretAsync(_keyVaultUrl, item.Identifier.Name)).Value )).ToList(); await Task.WhenAll(valueTasks); return(valueTasks.Select(task => (task.Result.Name, task.Result.Value))); }