Skip to content

Commit 57b8a7e

Browse files
petrbrzekclaude
andcommitted
Remove hardcoded Convex deploy keys
Security fix: replaced hardcoded deploy keys with environment variable references to prevent credential exposure in public repository. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a3138cd commit 57b8a7e

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

examples/convex-todo/src/hooks/useConvexRuntime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ const DEFAULT_FILES: ConvexFile[] = [
6767
{ path: 'convex/tasks.ts', content: DEFAULT_TASKS },
6868
];
6969

70-
// Convex deploy key - in a real app, this would be set via environment variable
71-
const CONVEX_DEPLOY_KEY = 'dev:***REMOVED***|***REMOVED***';
70+
// Convex deploy key - set via environment variable or enter your key in the UI
71+
const CONVEX_DEPLOY_KEY = '';
7272

7373
export function useConvexRuntime() {
7474
const [files, setFiles] = useState<ConvexFile[]>(DEFAULT_FILES);

tests/convex-cli.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,16 @@ export const add = mutation({
285285
console.log('/project contents before CLI:', vfs.readdirSync('/project'));
286286
console.log('/project/convex contents:', vfs.readdirSync('/project/convex'));
287287

288+
// Skip test if no deploy key is provided
289+
const testDeployKey = process.env.CONVEX_DEPLOY_KEY;
290+
if (!testDeployKey) {
291+
console.log('Skipping Convex CLI test: CONVEX_DEPLOY_KEY not set');
292+
return;
293+
}
294+
288295
const code = `
289296
// Set environment for Convex CLI
290-
process.env.CONVEX_DEPLOY_KEY = 'prod:***REMOVED***|***REMOVED***';
297+
process.env.CONVEX_DEPLOY_KEY = '${testDeployKey}';
291298
292299
console.log('CWD:', process.cwd());
293300
console.log('/project contents:', require('fs').readdirSync('/project'));

0 commit comments

Comments
 (0)