feat(api): M8 7.15 slice 2 — share lattice + read-time re-check + group shares (CLS-05/06) #204
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!204
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/m8-715-classification-core-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second enforcement slice of the CLS lattice (#158). Design decision (as proposed and unobjected): group shares are SNAPSHOT semantics — see below.
CLS-05 grant-time lattice
classification_insufficient+share_denied_classificationauditPOST /api/shares/group: lattice vs the group FLOOR, then snapshot materialization — the sharer's client encrypts the resource key per member (zero-knowledge forces per-recipient ciphertext); the server resolves CURRENT membership itself and requires the item list to cover exactly it (missing/non-member → 400); one Share row per member, taggedShareTargetGroupId. Members joining later do not retroactively hold keys for pre-existing shares — stated honestly here, in the endpoint docs, and as the documented trade-off of snapshot semantics (owner can re-share to cover new members; CLS-06 still gates every row by the holder's clearance).CLS-06 read-time re-check
Share-granted access re-checks the recipient's clearance on EVERY access: GetFolder, ListFiles, DownloadFile (per-request = per-chunk per §12 CLS-T5), GetFolderKey (the decryption oracle), ListFolders (below-clearance items hidden). Owners keep inherent access to their own content (downgrades don't brick owners out of their own vaults; re-classification is the remedy) — documented residual.
Verification
8 new tests: user-share denial+audit, at/below success, floor gate, snapshot materialization + idempotent re-share (0 new rows), coverage validation, late-joiner-has-no-row, downgrade-bites-on-next-access across all share-granted paths with grant rows untouched, owner-inherent access. Full suite 1070/0/40 locally.
Schema:
shares.ShareTargetGroupId(nullable FK, SET NULL on group delete) — migrationAddShareTargetGroupexercised by the #196 migrations CI leg.Fix ride-along: test fixture mirrors the CLS-02 joiner default (Internal clearance on classified tenants).