Jonathan Kirkwood 3a4b7dfd8b 0.2.46: security hardening (external-fund scope, role guards, forced password rotation, headers)
Pre-release audit fixes:
- External Administrators can only act on investors already in their own funds
  (grant_access, create_statement, set_partner_exited, import match), closing a
  cross-fund account-takeover chain.
- Role and is_active changes are gated: no self-escalation, non-approvers cannot
  mint or alter approver accounts, and the Service Admin is protected.
- must_change_password is enforced server-side, not just in the client.
- Session cookie is Secure with a 12h max-age and SameSite; CSP and standard
  security headers on every response; the app refuses to boot on a known or short
  session secret; uvicorn runs with proxy-headers so login throttling keys on the
  real client IP behind the platform proxy.
- Import preview no longer confirms cross-fund investors; no-store on document
  downloads.
- Adds backend/tests/test_security_hardening.py (15 tests); full suite 76 passing.
- SECURITY-AUDIT.md records the swarm audit, findings, and remediation status.
2026-08-28 09:53:16 -05:00
2026-06-07 19:23:26 +00:00

Ten31Portal

Internal system of record for Ten31 entities, holdings, positions, and quarterly valuation sign-off.

Accounts and access

Two kinds of accounts:

  • Internal staff (approver, cfo, fund_admin, viewer) — the full back-office app (entities, holdings, valuations, import, audit). approver and cfo also get the admin screens below.
  • External accounts (investor, fund_administrator) — a separate, entity-scoped portal. An external account only sees the entities granted to it.
    • Investor — sees, per fund, their latest capital-account value and history, plus documents shared to the fund or addressed privately to them (e.g. their K-1).
    • Fund administrator — sees assigned entities and can upload documents for them (shared or addressed to a specific investor).

Admin screens (Users / Documents / Capital Accounts, visible to approver and cfo) let you create an account with a username and password, check off which entities it can view, upload documents, and enter each investor's capital-account figures.

Login accepts a username or an email. The first admin is created from the CLI:

ten31portal-cli create-user --name "You" --username admin --role cfo --password '...'
# --email is optional; external accounts are normally created from the Users screen.

Prerequisites

  • Python 3.11+
  • Node.js 20+

Backend

cd backend
python -m venv .venv
source .venv/bin/activate
pip install -e .
uvicorn ten31portal.main:app --reload --port 8000

Health check: GET http://localhost:8000/api/health

Frontend

cd frontend
npm install
npm run dev

Opens at http://localhost:5173. Proxies /api to the backend on port 8000.

Project structure

ten31portal/
  backend/
    ten31portal/       # FastAPI application
      main.py          # App object and health endpoint
      config.py        # Env-based configuration
    pyproject.toml
  frontend/
    src/
      App.tsx          # Main component
      main.tsx         # Entry point
    vite.config.ts
  deploy/              # StartOS packaging (Issue 17)
  SPEC.md              # v1 issue specs
S
Description
mirror of gitea.ten31.ai Ten31AI/Ten31-Portal
Readme MIT
662 KiB
Languages
Python 50.6%
TypeScript 47.1%
Makefile 0.8%
Shell 0.6%
JavaScript 0.4%
Other 0.5%