feat(security): migrate API keys to IndexedDB, fix silent catches, add snapshot validation#331
Merged
Merged
Conversation
…d snapshot validation - Create key-store.ts with AES-GCM encrypted IndexedDB storage for API keys - Migrate LLM config from localStorage to IndexedDB with auto-migration - Add ftp: to blocked URL schemes for SSRF prevention - Add Zod validation for graph snapshot data (validateSnapshotData) - Fix 11 silent catch blocks with proper logging across 7 files - Add 34 new tests: graph-schemas (15), editor extensions (12), keyboard nav (7) - Update config tests to mock IndexedDB key store
Contributor
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 13 high |
🟢 Metrics 82 complexity · 22 duplication
Metric Results Complexity 82 Duplication 22
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ftp:to blocked URL schemes for SSRF preventionChanges
src/lib/key-store.ts— IndexedDB-backed encrypted key store with localStorage migrationsrc/lib/llm/config.ts— Uses keyStore instead of localStorage, auto-migrates existing keyssrc/lib/llm/encryption.ts— Added logger for corrupted key recoverysrc/lib/resolver.ts— Addedftp:to blocked URL schemessrc/features/graph/graph-schemas.ts— AddedGraphSnapshotDataSchemaandvalidateSnapshotData()src/features/graph/GraphSnapshotManager.ts— Validates snapshot data before loadinggraph-schemas.test.ts(15),extensions.test.ts(12),GraphKeyboardNav.test.ts(7)config.test.ts— Mocks IndexedDB key store instead of localStorageVerification
pnpm run lint— 0 errorspnpm run typecheck— cleanpnpm run test— 445/445 passingpnpm run build— builds successfully