From 11bd75d0653a0ebcb64e6e5f00b11e27d28934e5 Mon Sep 17 00:00:00 2001 From: Jean Pierre Huaroto Date: Wed, 22 Nov 2023 07:09:41 +0000 Subject: [PATCH] :lipstick: --- components/dashboard/src/service/json-rpc-ssh-client.ts | 2 +- components/server/src/api/ssh-service-api.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/dashboard/src/service/json-rpc-ssh-client.ts b/components/dashboard/src/service/json-rpc-ssh-client.ts index d8034a395ddcb1..dc2f76018c2ed4 100644 --- a/components/dashboard/src/service/json-rpc-ssh-client.ts +++ b/components/dashboard/src/service/json-rpc-ssh-client.ts @@ -46,7 +46,7 @@ export class JsonRpcSSHClient implements PromiseClient { throw new ApplicationError(ErrorCodes.BAD_REQUEST, "sshKeyId is required"); } - await getGitpodService().server.deleteSSHPublicKey(eq.sshKeyId); + await getGitpodService().server.deleteSSHPublicKey(req.sshKeyId); const response = new DeleteSSHPublicKeyResponse(); return response; diff --git a/components/server/src/api/ssh-service-api.ts b/components/server/src/api/ssh-service-api.ts index c377dac13aef13..f7a84dfdeb5477 100644 --- a/components/server/src/api/ssh-service-api.ts +++ b/components/server/src/api/ssh-service-api.ts @@ -38,6 +38,13 @@ export class SSHServiceAPI implements ServiceImpl { } async createSSHPublicKey(req: CreateSSHPublicKeyRequest, _: HandlerContext): Promise { + if (!req.name) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "name is required"); + } + if (!req.key) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "key is required"); + } + const response = new CreateSSHPublicKeyResponse(); const result = await this.sshKeyService.addSSHPublicKey(ctxUserId(), ctxUserId(), {