Skip to content

Commit

Permalink
Remove proposed credentials API (#31131)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Aug 18, 2017
1 parent b29bd1e commit abea60d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 38 deletions.
34 changes: 0 additions & 34 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
7 changes: 3 additions & 4 deletions src/vs/workbench/api/node/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand All @@ -530,7 +530,6 @@ export function createApiFactory(
workspace,
scm,
debug,
credentials,
// types
CancellationTokenSource: CancellationTokenSource,
CodeLens: extHostTypes.CodeLens,
Expand Down Expand Up @@ -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;

This comment has been minimized.

Copy link
@jrieken

jrieken Aug 21, 2017

Member

what is this?

This comment has been minimized.

Copy link
@chrmarti

chrmarti Aug 29, 2017

Author Contributor

We are surfacing the same API in the azure-account extension for now. This allows us to make progress with out committing to an API in the core.

The way I have done this is to allow the now built-in azure-account extension to use the existing implementation without surfacing it in the proposed API anymore. This preserves the nice application name in the native confirmation dialogs on Mac.

}
return api;
};
Expand Down

0 comments on commit abea60d

Please sign in to comment.