Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Nov 22, 2023
1 parent f2cc974 commit 6f0aa70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/dashboard/src/data/setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import * as SSHClasses from "@gitpod/public-api/lib/gitpod/v1/ssh_pb";
// This is used to version the cache
// If data we cache changes in a non-backwards compatible way, increment this version
// That will bust any previous cache versions a client may have stored
const CACHE_VERSION = "7";
const CACHE_VERSION = "8";

export function noPersistence(queryKey: QueryKey): QueryKey {
return [...queryKey, "no-persistence"];
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/service/json-rpc-ssh-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class JsonRpcSSHClient implements PromiseClient<typeof SSHService> {
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;
Expand Down
7 changes: 7 additions & 0 deletions components/server/src/api/ssh-service-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export class SSHServiceAPI implements ServiceImpl<typeof SSHServiceInterface> {
}

async createSSHPublicKey(req: CreateSSHPublicKeyRequest, _: HandlerContext): Promise<CreateSSHPublicKeyResponse> {
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(), {
Expand Down

0 comments on commit 6f0aa70

Please sign in to comment.