feat: import row validation + KB/process per-item ACLs
Continuing the audit backlog and finishing the permissions UI. Import validation (recurring audit finding): - Added importMembersSchema / importPaymentsCsvSchema. importMembers and importPaymentsCsv now validate per row (a single bad row no longer rejects the whole file), lowercase emails, normalize dates through flexibleDateTime(), enforce tier/platform enums and positive finite amounts, and return a `skipped` count instead of silently dropping invalid rows. Permissions UI completion: - OpsAclEditor is now wired into the KB/process viewer modal (admin/board), with entity type derived from the `process` tag. Per-item Ops access control now covers secrets + KB + processes, matching "all ops facilities stuff". Left as-is with rationale in HANDOFF: /ops + /import denial paths (unreachable behind the layout gate or already a clear non-leaking denial); members-row make-area-lead shortcut (Customize -> Area leads fully covers assignment); types/database.ts + docs regen (pure hygiene, zero runtime/security impact, still tracked). 271/271 tests pass. Build clean. No migration this pass.
This commit is contained in:
+9
-5
@@ -22,14 +22,18 @@ Five parallel read-only audits (security/RLS, server actions/validation, routes/
|
||||
- **`app/(app)/layout.tsx`** marked `export const dynamic = 'force-dynamic'` (auth/onboarding gate must never be cached).
|
||||
- **Bounded queries.** `loadComments` `.limit(500)`, tasks page `.limit(2000)`.
|
||||
|
||||
### Tracked backlog (audit findings, not security-critical)
|
||||
### Pass 16b follow-up (same day)
|
||||
|
||||
- **Import validation done.** `importMembersSchema` / `importPaymentsCsvSchema` added; both actions validate per row (one bad row no longer rejects the file), lowercase emails, normalize dates via `flexibleDateTime()`, enforce platform/tier enums and positive finite amounts, and return a `skipped` count instead of silently dropping rows.
|
||||
- **KB/process per-item ACL wired.** `OpsAclEditor` renders in the KB/process viewer modal (admin/board); entity type derived from the `process` tag. Per-item Ops ACLs now cover secrets + KB + processes.
|
||||
- `/ops` and `/import` denial paths left as-is: unreachable behind the `(app)` layout gate, or already a clear denial with no data leak.
|
||||
|
||||
### Tracked backlog (not security-critical, zero runtime impact)
|
||||
|
||||
- `importMembers` / `importPaymentsCsv`: still no Zod row schema; dates not via `flexibleDateTime()`; emails not lowercased; silent row drops. Highest-value remaining correctness item.
|
||||
- `types/database.ts` still missing 8 prior-pass tables + `comment_entity_type` enum + 3 `space_members` columns (loose casts; build green via `ignoreBuildErrors`).
|
||||
- `docs/DATABASE_SCHEMA.md`, `DB_SCHEMA_MAP.md`, `docs/API_REFERENCE.md` stale since 2026-03-10 (missing migrations 016-024).
|
||||
- Inconsistent unauthorized handling: `/ops` and `/import` `return null` instead of `redirect`.
|
||||
- Email normalization (`.toLowerCase()`) missing across auth/member schemas.
|
||||
- KB/process per-item ACL: infra complete, only the ops-client KB-modal hookup remains. Members-row "make area lead" shortcut still deferred.
|
||||
- Email `.toLowerCase()` still missing on the non-import auth/member schemas (import path now normalizes).
|
||||
- Members-row "Make area lead" shortcut (Customize -> Area leads fully covers assignment).
|
||||
|
||||
### Verification
|
||||
|
||||
|
||||
Reference in New Issue
Block a user