the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support alternate sandbox id when updating SSH keys

+10 -4
+10 -4
apps/api/src/xrpc/io/pocketenv/sandbox/putSshKeys.ts
··· 1 1 import { XRPCError, type HandlerAuth } from "@atproto/xrpc-server"; 2 2 import type { Context } from "context"; 3 - import { and, eq } from "drizzle-orm"; 3 + import { and, eq, or } from "drizzle-orm"; 4 4 import type { Server } from "lexicon"; 5 5 import type { InputSchema } from "lexicon/types/io/pocketenv/sandbox/putSshKeys"; 6 6 import sandboxes from "schema/sandboxes"; ··· 19 19 .from(sandboxes) 20 20 .leftJoin(users, eq(sandboxes.userId, users.id)) 21 21 .where( 22 - and(eq(sandboxes.id, input.id), eq(users.did, auth.credentials.did)), 22 + and( 23 + or(eq(sandboxes.id, input.id), eq(sandboxes.sandboxId, input.id)), 24 + eq(users.did, auth.credentials.did), 25 + ), 23 26 ) 24 27 .execute(); 25 28 if (sandbox.length === 0) { 26 29 throw new XRPCError(404, "Sandbox not found"); 27 30 } 28 - await tx.delete(sshKeys).where(eq(sshKeys.sandboxId, input.id)).execute(); 31 + await tx 32 + .delete(sshKeys) 33 + .where(eq(sshKeys.sandboxId, sandbox[0]!.sandboxes.id)) 34 + .execute(); 29 35 await tx 30 36 .insert(sshKeys) 31 37 .values({ 32 38 publicKey: input.publicKey, 33 39 privateKey: input.privateKey, 34 40 redacted: input.redacted, 35 - sandboxId: input.id, 41 + sandboxId: sandbox[0]!.sandboxes.id, 36 42 }) 37 43 .execute(); 38 44 });