mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
extensions - fully provide keytar API
This commit is contained in:
@@ -31,6 +31,10 @@ export class MainThreadKeytar implements MainThreadKeytarShape {
|
||||
return this._credentialsService.findPassword(service);
|
||||
}
|
||||
|
||||
async $findCredentials(service: string): Promise<Array<{ account: string, password: string }>> {
|
||||
return this._credentialsService.findCredentials(service);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -263,6 +263,7 @@ export interface MainThreadKeytarShape extends IDisposable {
|
||||
$setPassword(service: string, account: string, password: string): Promise<void>;
|
||||
$deletePassword(service: string, account: string): Promise<boolean>;
|
||||
$findPassword(service: string): Promise<string | null>;
|
||||
$findCredentials(service: string): Promise<Array<{ account: string, password: string }>>;
|
||||
}
|
||||
|
||||
export interface IRegExpDto {
|
||||
|
||||
@@ -129,6 +129,7 @@ interface IKeytarModule {
|
||||
setPassword(service: string, account: string, password: string): Promise<void>;
|
||||
deletePassword(service: string, account: string): Promise<boolean>;
|
||||
findPassword(service: string): Promise<string | null>;
|
||||
findCredentials(service: string): Promise<Array<{ account: string, password: string }>>;
|
||||
}
|
||||
|
||||
class KeytarNodeModuleFactory implements INodeModuleFactory {
|
||||
@@ -169,6 +170,9 @@ class KeytarNodeModuleFactory implements INodeModuleFactory {
|
||||
},
|
||||
findPassword: (service: string): Promise<string | null> => {
|
||||
return mainThreadKeytar.$findPassword(service);
|
||||
},
|
||||
findCredentials(service: string): Promise<Array<{ account: string, password: string }>> {
|
||||
return mainThreadKeytar.$findCredentials(service);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user