Proposed credentials API

This commit is contained in:
Christof Marti
2017-07-18 14:52:01 -07:00
parent 05e653d61e
commit a6a07a74e0
14 changed files with 309 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { MainContext, MainThreadCredentialsShape, ExtHostCredentialsShape } from 'vs/workbench/api/node/extHost.protocol';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
export class ExtHostCredentials extends ExtHostCredentialsShape {
private _proxy: MainThreadCredentialsShape;
constructor(threadService: IThreadService) {
super();
this._proxy = threadService.get(MainContext.MainThreadCredentials);
};
readSecret(service: string, account: string): Thenable<string | undefined> {
return this._proxy.$readSecret(service, account);
}
writeSecret(service: string, account: string, secret: string): Thenable<void> {
return this._proxy.$writeSecret(service, account, secret);
}
deleteSecret(service: string, account: string): Thenable<boolean> {
return this._proxy.$deleteSecret(service, account);
}
}