@sussudio/platform
Version:
Internal APIs for VS Code's service injection the base services.
46 lines (44 loc) • 2.02 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Event } from '@sussudio/base/common/event.mjs';
export declare const ICredentialsService: import('../../instantiation/common/instantiation.mjs').ServiceIdentifier<ICredentialsService>;
export interface ICredentialsProvider {
getPassword(service: string, account: string): Promise<string | null>;
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;
}>
>;
clear?(): Promise<void>;
}
export interface ICredentialsChangeEvent {
service: string;
account: string;
}
export interface ICredentialsService extends ICredentialsProvider {
readonly _serviceBrand: undefined;
readonly onDidChangePassword: Event<ICredentialsChangeEvent>;
getSecretStoragePrefix(): Promise<string>;
}
export declare const ICredentialsMainService: import('../../instantiation/common/instantiation.mjs').ServiceIdentifier<ICredentialsMainService>;
export interface ICredentialsMainService extends ICredentialsService {}
export declare class InMemoryCredentialsProvider implements ICredentialsProvider {
private secretVault;
getPassword(service: string, account: string): Promise<string | null>;
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;
}>
>;
clear(): Promise<void>;
}