mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add versioning for accounts (#11497)
* Add versioning for accounts * deletion value
This commit is contained in:
@@ -29,6 +29,7 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
|
||||
export abstract class AzureAuth implements vscode.Disposable {
|
||||
public static ACCOUNT_VERSION = '2.0';
|
||||
protected readonly memdb = new MemoryDatabase<string>();
|
||||
|
||||
protected readonly WorkSchoolAccountType: string = 'work_school';
|
||||
@@ -110,6 +111,11 @@ export abstract class AzureAuth implements vscode.Disposable {
|
||||
}
|
||||
|
||||
public async refreshAccess(account: AzureAccount): Promise<AzureAccount> {
|
||||
// Deprecated account - delete it.
|
||||
if (account.key.accountVersion !== AzureAuth.ACCOUNT_VERSION) {
|
||||
account.delete = true;
|
||||
return account;
|
||||
}
|
||||
try {
|
||||
const tenant = this.getHomeTenant(account);
|
||||
const tokenResult = await this.getAccountSecurityToken(account, tenant.id, azdata.AzureResource.MicrosoftResourceManagement);
|
||||
@@ -505,7 +511,8 @@ export abstract class AzureAuth implements vscode.Disposable {
|
||||
const account = {
|
||||
key: {
|
||||
providerId: this.metadata.id,
|
||||
accountId: key
|
||||
accountId: key,
|
||||
accountVersion: AzureAuth.ACCOUNT_VERSION,
|
||||
},
|
||||
name: displayName,
|
||||
displayInfo: {
|
||||
|
||||
Reference in New Issue
Block a user