feat: add local authenticated Console control API - #183
Conversation
📝 WalkthroughWalkthroughAdds an explicitly launched, loopback-only Console control API with typed application services, OAuth connection operations, browser-session security, auditing, CLI support, documentation, and integration and contract tests. ChangesConsole control plane
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Operator
participant ConsoleCLI
participant ConsoleServer
participant ApplicationService
Operator->>ConsoleCLI: Launch miftah console
ConsoleCLI->>ConsoleServer: Start loopback listener
Operator->>ConsoleServer: Exchange one-use bootstrap credential
ConsoleServer->>ApplicationService: Invoke authenticated API operation
ApplicationService->>ConsoleServer: Return metadata, status, audit, or mutation result
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/console-api.md`:
- Around line 15-20: Update the Console API documentation for POST
/api/v1/sessions and every /connections/:ref/(connect|reauth|credential) action,
including DELETE, to specify the required application/json Content-Type and
accepted JSON payload (such as {} where appropriate), matching the unconditional
parsing and validation behavior in the console server.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bae34bb8-9eb6-4716-af19-1f53b05f2728
📒 Files selected for processing (18)
CHANGELOG.mdREADME.mddocs/architecture.mddocs/cli.mddocs/console-api.mddocs/oauth-console-threat-model.mddocs/oauth-support.mddocs/security.mddocs/threat-model.mdsrc/cli/main.tssrc/cli/parse.tssrc/console/console-application-service.tssrc/console/console-server.tstests/cli-parse.test.tstests/console-application-service.test.tstests/console-server.test.tstests/oauth-console-threat-model-docs-contract.test.tstests/package-contract.test.ts
The sole actionable thread was fixed in 255ded2 with a focused failing-then-passing documentation contract test and is resolved. CodeRabbit current-head status is green but explicitly rate-limited, so this stale CHANGES_REQUESTED decision is dismissed under the documented maintainer exception.
Closes #85
What changed
miftah consolecontrol process bound only to literal127.0.0.1/api/v1endpoints for redacted health/config/profile/connection metadata, atomic connection creation, OAuth connect/reauth/disconnect, and allowlisted Console audit recordsTDD and security evidence
Focused regressions were observed failing before their fixes for the missing server/routes, bootstrap expiry, rate limits, backup-path redaction, inherited
__proto__connection lookup, and audit-health filesystem-path disclosure.Validated on Node 22.22.3:
npm run test:core: 404 passed, 23 platform skipsnpm run typechecknpm run lintnpm run buildnpm run smoke:clinpm run check:packnpm run test:package: 18 passed, including packed-binary Console startup/shutdownThe full local
npm testrun still reproduces the existing workstation-only upstream startup timeout cascade tracked separately; no Console test failed. Current-head CI remains the clean-host release gate.Summary by CodeRabbit
miftah console.