fix(security): remove unsafe ledger append endpoint#266
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe API router removes the ledger route and ledger module, then registers tenant, tenant migration, and session routes while preserving subsequent API routes. ChangesAPI routing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
chittyconnect | f5d4870 | Jul 25 2026, 01:02 AM |
There was a problem hiding this comment.
Pull request overview
Removes the unsafe POST /api/v1/ledger/append route surface from the ChittyConnect API router to prevent authenticated callers from appending arbitrary events into the immutable context_ledger table without certificate validation.
Changes:
- Deleted the
src/api/routes/ledger.jsroute implementation (including/append). - Removed the
ledgerRoutesimport and/api/v1/ledgermount fromsrc/api/router.js.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/api/router.js | Removes the /api/v1/ledger route mount and associated import to eliminate the endpoint from the public API surface. |
| src/api/routes/ledger.js | Deletes the unsafe ledger append implementation that lacked enforced certificate validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Finding
POST /api/v1/ledger/appendwas mounted insrc/api/router.jsdespite earlier reporting that the route was dead. The global API-key guard blocks anonymous callers, but the route only checked that a sovereignty header existed; certificate validation was commented out and any authenticated caller could supply an arbitrarysigner_idbefore an immutablecontext_ledgerinsert.Change
ledgerRoutesimport and/api/v1/ledgermount.src/api/routes/ledger.js.[SPEC] /api/v1/ledger/emitcontract untouched. A replacement must be built against the actual ChittyCert contract, mounted explicitly, and covered by authorization tests.Deployment
No deployment performed. Draft PR for CI and review.
Summary by CodeRabbit
New Features
Removed