-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secrets API #112249
Labels
Milestone
Comments
I have moved this over to the extension context, it now looks like: export interface SecretState {
/**
* Retrieve a secret that was stored with key. Returns undefined if there
* is no password matching that key.
* @param key The key the password was stored under.
*/
get(key: string): Thenable<string | undefined>;
/**
* Store a secret under a given key.
* @param key The key to store the password under
* @param value The password
*/
set(key: string, value: string): Thenable<void>;
/**
* Remove a secret from storage.
* @param key The key the password was stored under.
*/
delete(key: string): Thenable<void>;
/**
* Fires when a secret is set or deleted.
*/
onDidChange: Event<void>;
}
export interface ExtensionContext {
secretState: SecretState;
} |
|
1. The secret is scoped to the extension that writes it.
2. The key only needs to be unique within an extension.
Good questions, I’ll update the API docs to make this clearer.
|
Thanks, is there any way to know which secret was set or deleted in |
@RMacfarlane So the event does not pass any argument so there does not looks like a way to get which key changed. Any chance to implementing this? |
Yes, this is something I plan to add today. Should look like export interface SecretStorageChangeEvent {
key: string
}
...
onDidChange: Event<SecretStorageChangeEvent> |
RMacfarlane
pushed a commit
that referenced
this issue
Jan 16, 2021
RMacfarlane
pushed a commit
that referenced
this issue
Jan 20, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A couple of months ago we introduced password related APIs that are currently being used by the built-in auth provider extensions. These APIs expose a first-class way for extensions to store sensitive information, instead of having to use a library like
keytar
themselves. The API currently looks like:Some suggestions that I plan to adopt are
The text was updated successfully, but these errors were encountered: