Skip to content

feat: secure secret handling, per-tool docs, CSV exports (closes #145, #146, #147) - #165

Merged
dotunv merged 3 commits into
Savitura:mainfrom
vrse-vrde:feat/145-146-147-secure-keys-docs-csv-export
Aug 31, 2026
Merged

feat: secure secret handling, per-tool docs, CSV exports (closes #145, #146, #147)#165
dotunv merged 3 commits into
Savitura:mainfrom
vrse-vrde:feat/145-146-147-secure-keys-docs-csv-export

Conversation

@vrse-vrde

Copy link
Copy Markdown
Contributor

Solves #145, #146, and #147 in one PR.

🔐 security: Zero wallet secret keys client-side after generation — closes #145

  • New apps/web/src/lib/secure-memory.ts: zeroBuffer, clearSecretString (handles UTF-8 and UTF-16 byte data), and randomBytes, with comments documenting why zeroing reduces XSS / memory-inspection exposure.
  • Wallet Sandbox now generates keypairs from a zeroable crypto.getRandomValues seed (Keypair.fromRawEd25519Seed), wipes the seed buffer immediately after deriving the keypair, clears the previous secret before storing a new one, and drops the secret reference on unmount — no module-scoped secret storage.
  • stellar-signer.ts wipes the keypair's raw Ed25519 seed right after signing.

📖 docs: Per-tool usage documentation for all 10 SaviTools — closes #146

  • New /docs index plus a static /docs/[tool] page for each of the 10 tools (Inspector, Sandbox, Composer, Simulator, Webhooks, Monitor, Playground, Contracts, SDK, Network).
  • Every page follows the same format: overview, prerequisites, setup, step-by-step usage, and troubleshooting — data-driven from lib/tool-docs.ts for a consistent tone.
  • Every tool UI page links to its docs page (via a new docsHref on ToolPageShell, plus links on the custom SDK/Network layouts). README docs table updated.

📊 feat: CSV export for inspector and ledger monitor results — closes #147

  • GET /api/v1/inspector/tx/:hash/export — transaction breakdown as CSV with UTF-8 BOM and column headers matching the UI.
  • GET /api/v1/monitor/search (new) — search watch events with watchId, eventType, q, from, to, pagination.
  • GET /api/v1/monitor/search/export — same filters, streamed in 1,000-row chunks up to a 10,000-row cap, UTF-8 BOM for Excel.
  • New shared RFC 4180 CSV helpers (apps/api/src/common/csv.ts).
  • Export CSV buttons in the Transaction Inspector and Ledger Monitor, plus a search box in the monitor feed that filters events and feeds the same query into the export.
  • 20 new unit tests covering CSV escaping, export format, filters, row limits, and chunked streaming.

Verification

  • tsc --noEmit clean in both apps/web and apps/api (only pre-existing composer.service.spec.ts errors remain, unrelated to this PR).
  • next lint clean; next build succeeds (all /docs/[tool] pages pre-rendered).
  • API test suite: 426 passing. The 3 failing suites (federation, orderbook, composer) also fail on clean main — pre-existing, not introduced here.

vrse-vrde and others added 3 commits August 31, 2026 12:30
…tura#145, Savitura#146, Savitura#147)

Savitura#145 — Zero wallet secret keys client-side after generation:
- Add lib/secure-memory.ts (zeroBuffer, clearSecretString, randomBytes) with
  security rationale comments covering UTF-8/UTF-16 string data
- Wallet Sandbox generates keypairs from a zeroable crypto.getRandomValues
  seed (Keypair.fromRawEd25519Seed) and wipes the seed buffer, clears prior
  secrets, and drops the secret reference on unmount
- stellar-signer.ts wipes the keypair raw secret after signing

Savitura#146 — Per-tool usage documentation for all 10 SaviTools:
- Add /docs index and /docs/[tool] pages for all 10 tools, each covering
  overview, prerequisites, setup, usage steps, and troubleshooting
- Link every tool UI page (inspector, sandbox, composer, simulator, webhooks,
  monitor, playground, contracts, sdk, network) to its docs page
- Add docs index entry to README and document export endpoints in the API
  reference

Savitura#147 — CSV export for inspector and ledger monitor results:
- Add GET /inspector/tx/:hash/export returning the transaction breakdown as
  CSV with UTF-8 BOM and column headers matching the UI
- Add GET /monitor/search (filters: watchId, eventType, q, from, to,
  pagination) and GET /monitor/search/export, which streams results in
  bounded chunks up to a 10,000-row limit with UTF-8 BOM
- Add shared csv helpers with RFC 4180 escaping
- Add Export CSV buttons to the Transaction Inspector and Ledger Monitor UI
  via a new downloadCsv() frontend helper
- Add unit tests for CSV escaping, inspector export format, and monitor
  search/streaming/filtering/limits

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Wire the new /monitor/search endpoint into the watch feed UI so users can
filter events by hash, account, or asset. The Export CSV button now forwards
the active search query, so exports match exactly what is on screen.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@vrse-vrde Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dotunv
dotunv merged commit b65d3d7 into Savitura:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants