Skip to content

Commit a9adf17

Browse files
committed
chore: the vouched-reference census gate leaves this change for its own
The census script, its root alias, the core repo pin, the Test Core input wiring and the lint workflow step move to a separate change. The attach on upload completion, the one-shot vouch and their pins stay. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
1 parent 9fe4c83 commit a9adf17

8 files changed

Lines changed: 4 additions & 344 deletions

File tree

‎.changeset/sec-r17-attach-on-upload-complete.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A signed-in member who may attach files, and holds no read of `sys_file`, can at
1616

1717
The rule now: the upload-complete door (`POST /api/v1/storage/upload/complete`) takes an optional `attachTo: { parentObject, parentId }`. With it, the door runs every gate it already asked — the session, the upload ownership rule, the starting organization, the held bytes — and then hands the upload to the file-attachments service's `attachUploadAs`, which runs as the caller. That verb vouches for one `sys_file` only: a `pending` upload in the `attachments` scope that the caller uploaded, that no record holds yet, in the caller's write reach and in the parent's organization. It asks the attach authorization first (the permission to create an attachment, the parent-edit attach rule, `enable.files`), then writes the `sys_attachment` row and commits the file as one unit. The answer is the committed file with its new `attachmentId`. Another user's upload id, an id that names no file, a committed or already attached upload, and a record the caller may not attach to are refused, and the upload stays `pending`.
1818

19-
The vouch is spent on that one write: a hook that runs under it — as the user or as the system — writes without the mark (`withoutVouchedReferences`, `@objectstack/core`), so a hook naming the same `file_id` is judged through the caller's read door. A repo gate (`check:vouch-for-reference-callers`) pins the code that sets the mark to an allowlist of the file-attachments service.
19+
The vouch is spent on that one write: a hook that runs under it — as the user or as the system — writes without the mark (`withoutVouchedReferences`, `@objectstack/core`), so a hook naming the same `file_id` is judged through the caller's read door.
2020

2121
Unchanged: no caller gains a read of `sys_file` or of anything else. The generic data door keeps its rule — a `sys_attachment` create through `POST /api/v1/data/sys_attachment` naming a `sys_file` the caller cannot read is still refused `reference_not_found`. A completion without `attachTo` commits exactly as before. A mount with no file-attachments service bound refuses `attachTo` with `501 NOT_IMPLEMENTED`.
2222

‎.github/workflows/lint.yml‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,20 +2550,10 @@ jobs:
25502550
# @objectstack/core). Guards against a duplicate resolver copy drifting on a
25512551
# security path (the REST-vs-dispatcher sys_user_role drift) and against an
25522552
# entry point silently dropping the delegation.
2553-
#
2554-
# The second command is the same kind of guard on the write-time reference
2555-
# check: the code that may set the vouched-reference mark (a service verb
2556-
# vouching, on its own write, for the one record it proved) is pinned to an
2557-
# allowlist, so a new caller is a reviewed edit and never a quiet one. Its
2558-
# alias runs the census's `--self-test` first, which is what
2559-
# `check:self-test-wired` requires. Folded into this step rather than a step
2560-
# of its own: no new check context and no new required-status entry.
25612553
- name: Single authz resolver guard
25622554
id: single-authz-resolver-guard
25632555
continue-on-error: true
2564-
run: |
2565-
pnpm check:authz-resolver
2566-
pnpm check:vouch-for-reference-callers
2556+
run: pnpm check:authz-resolver
25672557

25682558
# #11352. Product code may not read a test-RUNNER variable (`TEST`,
25692559
# `VITEST*`, `JEST_WORKER_ID`). Runner variables are INHERITED by every

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@
206206
"check:stall-guard-headroom": "node scripts/measure-stall-guard-headroom.mjs --self-test",
207207
"check:swallow-census-controls": "node scripts/measure-durability-swallow-family.mjs --self-test=gated",
208208
"check:system-context-census": "node scripts/check-system-context-census.mjs --self-test && node scripts/check-system-context-census.mjs",
209-
"check:vouch-for-reference-callers": "node scripts/check-vouch-for-reference-callers.mjs --self-test && node scripts/check-vouch-for-reference-callers.mjs",
210209
"gen:platform-object-tenancy-census": "node scripts/platform-object-tenancy-census.mjs --write",
211210
"check:platform-object-tenancy-census": "node scripts/check-platform-object-tenancy-census.mjs --self-test && node scripts/check-platform-object-tenancy-census.mjs"
212211
},

‎packages/core/src/security/vouched-reference-callers.pin.test.ts‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎packages/core/vitest.repo-tests.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"src/security/operation-private-keys.pin.test.ts",
55
"src/security/row-serving-door-exposure.pin.test.ts",
66
"src/security/second-object-read-exposure.pin.test.ts",
7-
"src/security/vouched-reference-callers.pin.test.ts",
87
"src/utils/import-runner-sandbox-fault-row.test.ts"
98
]

0 commit comments

Comments
 (0)