refactor credentials service to main

ensure keytar is there and register service correctly

remove console log

remove extra line
This commit is contained in:
Tyler Leonhardt
2022-01-11 13:06:06 -08:00
parent 7f5007c9a4
commit 4d930765f3
21 changed files with 621 additions and 224 deletions

View File

@@ -34,6 +34,7 @@ import { isWeb } from 'vs/base/common/platform';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService';
import { UserDataSyncStoreTypeSynchronizer } from 'vs/platform/userDataSync/common/globalStateSync';
import { ICredentialsService } from 'vs/platform/credentials/common/credentials';
type UserAccountClassification = {
id: { classification: 'EndUserPseudonymizedInformation', purpose: 'BusinessInsight' };
@@ -106,6 +107,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
@IProductService private readonly productService: IProductService,
@IExtensionService private readonly extensionService: IExtensionService,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@ICredentialsService private readonly credentialsService: ICredentialsService,
@INotificationService private readonly notificationService: INotificationService,
@IProgressService private readonly progressService: IProgressService,
@IDialogService private readonly dialogService: IDialogService,
@@ -167,7 +169,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
}
private async initialize(): Promise<void> {
const authenticationSession = this.environmentService.options?.credentialsProvider ? await getCurrentAuthenticationSessionInfo(this.environmentService, this.productService) : undefined;
const authenticationSession = await getCurrentAuthenticationSessionInfo(this.credentialsService, this.productService);
if (this.currentSessionId === undefined && this.useWorkbenchSessionId && (authenticationSession?.id)) {
this.currentSessionId = authenticationSession?.id;
this.useWorkbenchSessionId = false;