提交 abea60da 编写于 作者: C Christof Marti

Remove proposed credentials API (#31131)

上级 b29bd1e6
......@@ -55,40 +55,6 @@ declare module 'vscode' {
export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable;
}
/**
* Namespace for handling credentials.
*/
export namespace credentials {
/**
* Read a previously stored secret from the credential store.
*
* @param service The service of the credential.
* @param account The account of the credential.
* @return A promise for the secret of the credential.
*/
export function readSecret(service: string, account: string): Thenable<string | undefined>;
/**
* Write a secret to the credential store.
*
* @param service The service of the credential.
* @param account The account of the credential.
* @param secret The secret of the credential to write to the credential store.
* @return A promise indicating completion of the operation.
*/
export function writeSecret(service: string, account: string, secret: string): Thenable<void>;
/**
* Delete a previously stored secret from the credential store.
*
* @param service The service of the credential.
* @param account The account of the credential.
* @return A promise resolving to true if there was a secret for that service and account.
*/
export function deleteSecret(service: string, account: string): Thenable<boolean>;
}
/**
* Represents a color in RGBA space.
*/
......
......@@ -506,7 +506,7 @@ export function createApiFactory(
};
// namespace: credentials
const credentials: typeof vscode.credentials = {
const credentials = {
readSecret(service: string, account: string): Thenable<string | undefined> {
return extHostCredentials.readSecret(service, account);
},
......@@ -530,7 +530,6 @@ export function createApiFactory(
workspace,
scm,
debug,
credentials,
// types
CancellationTokenSource: CancellationTokenSource,
CodeLens: extHostTypes.CodeLens,
......@@ -584,8 +583,8 @@ export function createApiFactory(
Task: extHostTypes.Task,
ConfigurationTarget: extHostTypes.ConfigurationTarget
};
if (!extension.enableProposedApi) {
delete api.credentials; // Instead of error to avoid #31854
if (extension.enableProposedApi && extension.isBuiltin) {
api['credentials'] = credentials;
}
return api;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册