mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Feedback on secrets API #112249
This commit is contained in:
parent
64fa272029
commit
93ae815ba1
|
@ -34,7 +34,7 @@ export class Keychain {
|
|||
constructor(private context: vscode.ExtensionContext) { }
|
||||
async setToken(token: string): Promise<void> {
|
||||
try {
|
||||
return await this.context.secrets.set(SERVICE_ID, token);
|
||||
return await this.context.secrets.store(SERVICE_ID, token);
|
||||
} catch (e) {
|
||||
// Ignore
|
||||
Logger.error(`Setting token failed: ${e}`);
|
||||
|
|
|
@ -48,7 +48,7 @@ export class Keychain {
|
|||
async setToken(token: string): Promise<void> {
|
||||
|
||||
try {
|
||||
return await this.context.secrets.set(SERVICE_ID, token);
|
||||
return await this.context.secrets.store(SERVICE_ID, token);
|
||||
} catch (e) {
|
||||
Logger.error(`Setting token failed: ${e}`);
|
||||
|
||||
|
|
6
src/vs/vscode.proposed.d.ts
vendored
6
src/vs/vscode.proposed.d.ts
vendored
|
@ -2518,7 +2518,7 @@ declare module 'vscode' {
|
|||
/**
|
||||
* The key of the secret that has changed.
|
||||
*/
|
||||
key: string;
|
||||
readonly key: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2539,7 +2539,7 @@ declare module 'vscode' {
|
|||
* @param key The key to store the password under.
|
||||
* @param value The password.
|
||||
*/
|
||||
set(key: string, value: string): Thenable<void>;
|
||||
store(key: string, value: string): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Remove a secret from storage.
|
||||
|
@ -2554,7 +2554,7 @@ declare module 'vscode' {
|
|||
}
|
||||
|
||||
export interface ExtensionContext {
|
||||
secrets: SecretStorage;
|
||||
readonly secrets: SecretStorage;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
|
|
@ -25,7 +25,7 @@ export class ExtHostSecretState implements ExtHostSecretStateShape {
|
|||
return this._proxy.$getPassword(extensionId, key);
|
||||
}
|
||||
|
||||
set(extensionId: string, key: string, value: string): Promise<void> {
|
||||
store(extensionId: string, key: string, value: string): Promise<void> {
|
||||
return this._proxy.$setPassword(extensionId, key, value);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ export class ExtensionSecrets implements vscode.SecretStorage {
|
|||
return this._secretState.get(this._id, key);
|
||||
}
|
||||
|
||||
set(key: string, value: string): Promise<void> {
|
||||
return this._secretState.set(this._id, key, value);
|
||||
store(key: string, value: string): Promise<void> {
|
||||
return this._secretState.store(this._id, key, value);
|
||||
}
|
||||
|
||||
delete(key: string): Promise<void> {
|
||||
|
|
Loading…
Reference in a new issue