Skip to content

fix: bearer token auth for task-api-server + JSON resilience in database + documentation updation - #378

Open
09Rumaisa wants to merge 3 commits into
peakflo:mainfrom
09Rumaisa:fix/task-api-auth-and-db-resilience
Open

fix: bearer token auth for task-api-server + JSON resilience in database + documentation updation#378
09Rumaisa wants to merge 3 commits into
peakflo:mainfrom
09Rumaisa:fix/task-api-auth-and-db-resilience

Conversation

@09Rumaisa

Copy link
Copy Markdown

Summary

Adds authentication to the local task API server and improves database resilience against malformed JSON data.

Related Issue

Fixes #309 (item 2) — Local task API has no authentication

Changes

Security

  • src/main/task-api-server.ts — Added bearer token auth using randomUUID() + timingSafeEqual (prevents timing attacks)
  • src/main/agent-manager.ts — Pass TASK_API_TOKEN env var to all three agent child process launch points

Resilience

  • src/main/database.ts — Wrapped parseJsonArray in try-catch so one corrupt JSON column can't crash all task reads
  • src/main/database.test.ts — 4 new tests (53 total, all passing)

Documentation

  • AGENTS.md — Removed "not yet implemented" — architecture is fully built
  • docs/task-lifecycle.md — Fixed find_similar_tasks description (FTS5 + BM25, not SQL LIKE)
  • docs/mobile-api-spec.md — Fixed skills schema + added 7 undocumented endpoints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hardening] Potential improvements in task, agent, IPC, and local API flows

1 participant