Cache access tokens in local cache file to prevent MSAL throttling (#22763)

This commit is contained in:
Cheena Malhotra
2023-04-20 13:55:30 -07:00
committed by GitHub
parent 0bdb35d9ab
commit 8613176817
16 changed files with 309 additions and 156 deletions

View File

@@ -136,10 +136,29 @@ export function getResourceTypeDisplayName(type: string): string {
}
return type;
}
function getHttpConfiguration(): vscode.WorkspaceConfiguration {
return vscode.workspace.getConfiguration(constants.httpConfigSectionName);
}
/**
* Gets tenants to be ignored.
* @returns Tenants configured in ignore list
*/
export function getTenantIgnoreList(): string[] {
const configuration = vscode.workspace.getConfiguration(constants.AzureTenantConfigSection);
return configuration.get(constants.Filter) ?? [];
}
/**
* Updates tenant ignore list in global settings.
* @param tenantIgnoreList Tenants to be configured in ignore list
*/
export async function updateTenantIgnoreList(tenantIgnoreList: string[]): Promise<void> {
const configuration = vscode.workspace.getConfiguration(constants.AzureTenantConfigSection);
await configuration.update(constants.Filter, tenantIgnoreList, vscode.ConfigurationTarget.Global);
}
export function getResourceTypeIcon(appContext: AppContext, type: string): string {
switch (type) {
case azureResource.AzureResourceType.sqlServer: