mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 23:03:32 +00:00
Fix ssh generation and import not being available when agent feature-flag is disabled (#12741)
This commit is contained in:
@@ -24,7 +24,23 @@ export class MainSshAgentService {
|
|||||||
constructor(
|
constructor(
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private messagingService: MessagingService,
|
private messagingService: MessagingService,
|
||||||
) {}
|
) {
|
||||||
|
ipcMain.handle(
|
||||||
|
"sshagent.generatekey",
|
||||||
|
async (event: any, { keyAlgorithm }: { keyAlgorithm: string }): Promise<sshagent.SshKey> => {
|
||||||
|
return await sshagent.generateKeypair(keyAlgorithm);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
ipcMain.handle(
|
||||||
|
"sshagent.importkey",
|
||||||
|
async (
|
||||||
|
event: any,
|
||||||
|
{ privateKey, password }: { privateKey: string; password?: string },
|
||||||
|
): Promise<sshagent.SshKeyImportResult> => {
|
||||||
|
return sshagent.importKey(privateKey, password);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
// handle sign request passing to UI
|
// handle sign request passing to UI
|
||||||
@@ -94,21 +110,6 @@ export class MainSshAgentService {
|
|||||||
this.requestResponses.push({ requestId, accepted, timestamp: new Date() });
|
this.requestResponses.push({ requestId, accepted, timestamp: new Date() });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
ipcMain.handle(
|
|
||||||
"sshagent.generatekey",
|
|
||||||
async (event: any, { keyAlgorithm }: { keyAlgorithm: string }): Promise<sshagent.SshKey> => {
|
|
||||||
return await sshagent.generateKeypair(keyAlgorithm);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
ipcMain.handle(
|
|
||||||
"sshagent.importkey",
|
|
||||||
async (
|
|
||||||
event: any,
|
|
||||||
{ privateKey, password }: { privateKey: string; password?: string },
|
|
||||||
): Promise<sshagent.SshKeyImportResult> => {
|
|
||||||
return sshagent.importKey(privateKey, password);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
ipcMain.handle("sshagent.lock", async (event: any) => {
|
ipcMain.handle("sshagent.lock", async (event: any) => {
|
||||||
if (this.agentState != null && (await sshagent.isRunning(this.agentState))) {
|
if (this.agentState != null && (await sshagent.isRunning(this.agentState))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user