Commit graph

13 commits

Author SHA1 Message Date
6afd419dd3 test(roadmap): reschedule auditing and role scoping 2026-09-17 07:19:54 +02:00
8a2fb46788 test(intake): server-decided fields and project scoping 2026-09-16 18:07:16 +02:00
0c25a3e6a1 test(intake): cap enforcement, brief whitelist, project scoping 2026-09-16 17:56:37 +02:00
de8ae83dcb test(narrative): no invention, and raw-subject fallback 2026-09-16 16:26:29 +02:00
aea000f654 test(ai): merge exclusion, graceful degradation, summary persistence 2026-09-16 16:18:40 +02:00
2401dbd68f test(ai): settings page never exposes the API key
Three tests cover the storage and access boundary:

- A client manager cannot list the settings collection at all (rules are
  superuser-only — verified by the rejection, not by silent skip).
- The settings page HTML returned to the owner does not contain the key
  value, even when the key is freshly set to a unique sentinel.
- A client manager gets 404 on /admin/settings (admin layout gates on
  role, not on session presence).

helpers.ts gained ownerEmail / ownerPassword — needed by the settings test
and reusable for any owner-only integration test going forward.
2026-09-16 15:59:49 +02:00
cd0984595c test(metrics): cached figures agree with stored commits + vitest stubs
The integration project now aliases server-only to a tiny empty stub
so tests can import modules that carry 'import "server-only"' without
the throwing real implementation firing during prepare. Unit tests do
NOT get the alias — a pure module with a server import is exactly the
kind of leak the unit project's missing condition is meant to surface.
2026-09-16 15:19:32 +02:00
7fc87042f6 test(linking): idempotency, manual precedence and date bounding
Vitest config: integration project now resolves with the 'react-server'
condition, so server-only modules can be imported directly from tests.
The unit project deliberately does NOT set it: a unit test pulling in a
server-only module must fail loudly, because a pure module with a server
import is exactly the kind of leak that should not reach production.
2026-09-16 13:34:53 +02:00
cd9c8df031 test(ingest): webhook and cron endpoint protection 2026-09-16 11:50:20 +02:00
4b316063dc test(admin): board invariants, owner-only writes, deactivation 2026-09-16 11:31:38 +02:00
2a8d6f2505 fix(security): lock the users collection against privilege escalation
The users collection kept PocketBase's defaults because the Plan 1a rules
migration covered eight collections and missed this one:

  createRule ""                      -> anyone could sign up
  updateRule "id = @request.auth.id"  -> anyone could edit their own record

`role` is an ordinary field here, so both were escalations. Verified
exploitable against the live instance: an anonymous request created an
account with role "owner", and a client manager promoted themselves to
owner by patching their own record. Either route yields read and write
access to every client's board.

Create, update and delete are now superuser-only; list and view are
owner-or-self. Adds four integration tests so a regression fails loudly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 11:18:13 +02:00
c966d7dcc9 test(actions): cover audit-log immunity and request flags 2026-09-16 11:06:38 +02:00
5494f14f60 test(permissions): integration coverage for the client write boundary 2026-09-16 09:46:58 +02:00