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.

Preserve newlines when masking SSH private keys

+12 -4
+12 -4
apps/web/src/pages/settings/sshkeys/SshKeys.tsx
··· 119 119 const body = values.privateKey 120 120 .slice(headerIndex + header.length, footerIndex) 121 121 .trim(); 122 + const chars = body.split(""); 123 + const nonNewlineIndices = chars 124 + .map((c, i) => (c !== "\n" ? i : -1)) 125 + .filter((i) => i !== -1); 122 126 const maskedBody = 123 - body.length > 15 124 - ? body.slice(0, 10) + 125 - "*".repeat(body.length - 15) + 126 - body.slice(-5) 127 + nonNewlineIndices.length > 15 128 + ? (() => { 129 + const middleIndices = nonNewlineIndices.slice(10, -5); 130 + middleIndices.forEach((i) => { 131 + chars[i] = "*"; 132 + }); 133 + return chars.join(""); 134 + })() 127 135 : body; 128 136 return `${header}\n${maskedBody}\n${footer}`; 129 137 })(),