Skip to content

Disclose backend hardening and route changes#131

Open
hoogvliets wants to merge 1 commit into
willchen96:mainfrom
hoogvliets:disclose/backend-hardening
Open

Disclose backend hardening and route changes#131
hoogvliets wants to merge 1 commit into
willchen96:mainfrom
hoogvliets:disclose/backend-hardening

Conversation

@hoogvliets
Copy link
Copy Markdown

@hoogvliets hoogvliets commented May 14, 2026

Part of the downstream AGPL disclosure. This PR isolates backend hardening and route changes for easier review.

Scope

  • Backend source changes for app bootstrapping, auth-aware APIs, storage, uploads, LLM routing, chat tools, account lifecycle, logging, and validation.
  • Full disclosure PR: Disclose downstream AGPL changes #127.

App and Configuration

  • Adds backend/src/app.ts to separate Express app construction from server startup.
  • Adds typed environment handling in backend/src/env.ts.
  • Updates backend package dependencies, scripts, lockfiles, TypeScript settings, and deployment config.

Auth, Access, and User Lifecycle

  • Hardens auth middleware and Supabase access helpers.
  • Adds encrypted user model key handling through user settings and model routes.
  • Adds account deletion, restore token, and deletion worker support.
  • Adds validation helpers used by route inputs.

Chat, LLM, and Tools

  • Splits the previous large chat tools module into focused modules under backend/src/lib/chatTools/.
  • Adds structured tool schemas, tool runner behavior, document context loading, citation handling, workflow store helpers, streaming support, and individual tools.
  • Updates Anthropic and Gemini integration behavior and removes the old OpenAI-specific module path.
  • Adds model availability routing through a backend models endpoint.

Storage, Uploads, and Documents

  • Updates storage, upload, download token, and document route behavior.
  • Adds PDF queue and structure tree helpers.
  • Improves document upload, project document, tabular, workflow, and download API behavior.

Operations and Safety

  • Adds Pino request logging support.
  • Adds LLM request rate limiting.
  • Adds helper code for restore tokens, crypto, and safer route validation.

Review Note

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.

2 participants