feat(api): expose file names + DEK-wrap triple on FileDto, level everywhere (#207) #210

Merged
amiryahaya merged 1 commit from feat/cls-file-dto-exposure into main 2026-11-16 16:22:06 +01:00
Owner

PR-S1 of the #207 align-then-adorn campaign (dev-plan 7.16 client UX; first increment of 7.1 golden-contract fixtures).

Server contract exposure for the desktop client:

  • BuildFileDto gains name, mime_type, size, encrypted_file_key, nonce, encryption_algorithm — parity with the root/contents projection so a listing can render rows and unwrap DEKs without a per-file second fetch.
  • GET /folders/root/contents: folder + files + subfolders now carry level; files gain nonce/encryption_algorithm.
  • Upload 201 carries the resolved Level (override OR inherited folder level).

CLS-06 listing filter (code-review pass-2 finding, landed in this PR as required): per-file raise-only overrides can put a file above its folder's level, and the folder-granularity gate did not cover rows — with names now on the DTO that was a filename read-up channel. ClassificationGates.FilterFilesShareVisibleAsync drops above-clearance rows from ListFiles + root/contents (owners and the container owner keep rows; batched: one clearance lookup + one ladder query, no N+1). FilterShareVisibleAsync (ListFolders) rewritten onto the same batched set — semantics identical.

Tests: new ContractPinningTests (9 tests) — exact serialized snake_case property sets for FileDto / root-contents envelope / upload-201 (rename breaks server test first), level=Internal vs null (flag off), E2EE-chunked null-triple shape, and the CLS-06 filter scenarios (recipient-hidden, owner-kept, container-owner-kept).

Review: dual-pass done — ponytail pass 1 clean; superpowers pass 2 found the CLS-06 gap (fixed above) + root-resolver ordering gap (pre-existing, tracked for follow-up in #207 comments).

Coverage: scripts/coverage-gate.sh Release — line coverage 87.69% ≥ 80%, zero failures (1082 tests).

Closes the server half of #207 prerequisites. Desktop alignment lands in PR-D1.

Related: #207, #158, #30 (§12 CLS rows).

PR-S1 of the #207 align-then-adorn campaign (dev-plan 7.16 client UX; first increment of 7.1 golden-contract fixtures). **Server contract exposure for the desktop client:** - `BuildFileDto` gains `name`, `mime_type`, `size`, `encrypted_file_key`, `nonce`, `encryption_algorithm` — parity with the root/contents projection so a listing can render rows and unwrap DEKs without a per-file second fetch. - `GET /folders/root/contents`: folder + files + subfolders now carry `level`; files gain `nonce`/`encryption_algorithm`. - Upload 201 carries the resolved `Level` (override OR inherited folder level). **CLS-06 listing filter (code-review pass-2 finding, landed in this PR as required):** per-file raise-only overrides can put a file above its folder's level, and the folder-granularity gate did not cover rows — with names now on the DTO that was a filename read-up channel. `ClassificationGates.FilterFilesShareVisibleAsync` drops above-clearance rows from `ListFiles` + root/contents (owners and the container owner keep rows; batched: one clearance lookup + one ladder query, no N+1). `FilterShareVisibleAsync` (ListFolders) rewritten onto the same batched set — semantics identical. **Tests:** new `ContractPinningTests` (9 tests) — exact serialized snake_case property sets for FileDto / root-contents envelope / upload-201 (rename breaks server test first), level=Internal vs null (flag off), E2EE-chunked null-triple shape, and the CLS-06 filter scenarios (recipient-hidden, owner-kept, container-owner-kept). **Review:** dual-pass done — ponytail pass 1 clean; superpowers pass 2 found the CLS-06 gap (fixed above) + root-resolver ordering gap (pre-existing, tracked for follow-up in #207 comments). **Coverage:** `scripts/coverage-gate.sh Release` — line coverage **87.69% ≥ 80%**, zero failures (1082 tests). Closes the server half of #207 prerequisites. Desktop alignment lands in PR-D1. Related: #207, #158, #30 (§12 CLS rows).
feat(api): expose file names + DEK-wrap triple on FileDto, level everywhere (#207)
All checks were successful
Security CI / security-scan (pull_request) Successful in 2m47s
API CI / migrations (pull_request) Successful in 2m2s
API CI / build-and-test (pull_request) Successful in 4m36s
16fcc29202
S1 of the #207 align-then-adorn campaign (dev-plan 7.1 golden-fixture
discipline, first increment):

- BuildFileDto gains name, mime_type, size, encrypted_file_key, nonce,
  encryption_algorithm — parity with the root/contents projection so a
  client listing can render rows and unwrap DEKs without a second fetch
  per file.
- GET /folders/root/contents: folder + files + subfolders now carry
  level (F-CLS3 badge data); files gain nonce/encryption_algorithm.
- Upload 201 carries the resolved Level (override OR inherited folder
  level) so clients badge a fresh upload without re-listing.
- ContractPinningTests: exact serialized property sets for FileDto,
  root-contents envelope, and upload-201 — snake_case-pinned; the
  desktop serde tests in PR-D1 use these shapes as their fixture text.

The transitional plaintext-name model is unchanged (E2EE metadata
rename stays with 7.13).
Sign in to join this conversation.
No description provided.