forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainThreadKeytar.ts
More file actions
41 lines (32 loc) · 1.65 KB
/
mainThreadKeytar.ts
File metadata and controls
41 lines (32 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers';
import { MainContext, MainThreadKeytarShape } from 'vs/workbench/api/common/extHost.protocol';
import { ICredentialsService } from 'vs/platform/credentials/common/credentials';
@extHostNamedCustomer(MainContext.MainThreadKeytar)
export class MainThreadKeytar implements MainThreadKeytarShape {
constructor(
_extHostContext: IExtHostContext,
@ICredentialsService private readonly _credentialsService: ICredentialsService,
) { }
async $getPassword(service: string, account: string): Promise<string | null> {
return this._credentialsService.getPassword(service, account);
}
async $setPassword(service: string, account: string, password: string): Promise<void> {
return this._credentialsService.setPassword(service, account, password);
}
async $deletePassword(service: string, account: string): Promise<boolean> {
return this._credentialsService.deletePassword(service, account);
}
async $findPassword(service: string): Promise<string | null> {
return this._credentialsService.findPassword(service);
}
async $findCredentials(service: string): Promise<Array<{ account: string; password: string }>> {
return this._credentialsService.findCredentials(service);
}
dispose(): void {
//
}
}