Commit 20293d6
fix(sharing): gate the share-link route probe on
* fix(sharing): gate the share-link route probe on publicSharing.enabled at both sites
The route-level probe above `resolveToken` answered from the token row with no
knowledge of the object's standing `publicSharing.enabled` policy, so a
real-but-switched-off link carrying a `password_hash` still drew
`401 NEEDS_PASSWORD` / `WRONG_PASSWORD` and one with `audience: 'signed_in'`
still drew `401 SIGN_IN_REQUIRED` — the existence oracle `share-link-service`
states in prose that it closes, re-opened one layer up.
Both probe sites read the policy before answering from the row, and every arm
(the 410 included) falls through to the generic `404 INVALID_OR_EXPIRED` that
unknown, revoked, expired and ineligible tokens already give.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* test(sharing): pin the gated probe at both sites, both shapes, byte-equal to unknown
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* chore(sharing): changeset + re-anchor the system-context census page
The census page's line anchors into `share-link-service.ts` moved by exactly
the 20 lines this branch inserted above `getPolicy`; repaired with the gate's
own `--fix`, which rewrote 5 anchors and nothing else.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* test(sharing): declare the fixture's publicSharing block in the envelope conformance double
The envelope conformance harness stubs `SharingEngine` without `getSchema`, so
under the gated probe every one of its four row arms (`NEEDS_PASSWORD`,
`WRONG_PASSWORD`, `SIGN_IN_REQUIRED`, `EXPIRED_OR_REVOKED`) fell through to the
generic 404 — correctly, and fail-closed, but the refusals whose ENVELOPE this
module exists to pin were then unreachable. The double now declares the block
for the object its probe rows name, and those rows name it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* docs(runtime): cite the real test file in the share-link mirror docblock
The mirror's docblock told the next reader that the two spellings of
`isPublicSharingEnabled` are held equal by pins in
`share-links-probe-policy-gate.test.ts`. `git ls-tree -r` has zero entries
for that name anywhere in the repo — the pins are in
`share-links-enforcement-context.test.ts`, in this same directory.
This lands on the change's own thesis: a security property stated in a
comment is worth having only if the next reader can follow the comment to
the thing that holds it. A citation to a file that does not exist is the
same defect class the gate itself closes, one layer up.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* test(sharing,runtime): pin the 410 arm's EXPIRED half, at both sites
The gated 410 arm is reached by two predicates, not one:
row.revoked_at || (row.expires_at && Date.parse(row.expires_at) <= Date.now())
Both sites pinned only the revoked half. A pin on that half alone leaves
the expired half free to keep answering `410 EXPIRED_OR_REVOKED` on a
switched-off object — the same existence oracle, reached by the other
predicate, and invisible to every assertion in the file.
Both new cases carry the same reverse check the siblings do (with the
block ON an expired link is still 410) and the same
`expectIndistinguishable` byte-equality assertion against the
unknown-token answer. Expiry is stamped on the stored row rather than
minted: `createLink` refuses a past `expiresAt` outright with
`422 EXPIRY_IN_PAST`, so back-dating the row is the only way to reach an
already-expired link — which is what the passage of time does to a live
one, and the stamp the file's existing #13608 pins already use.
The changeset's "Consumer impact" paragraph named only the password-prompt
consequence. The 410 shift is equally consumer-visible — a different
sentence in the objectui console, which branches on the refusal STATUS and
never on the body's error code — so it is now named too, with the measured
consumer and its line range.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>publicSharing.enabled, at both probe sites (#14905)1 parent 2fd3f1c commit 20293d6
8 files changed
Lines changed: 716 additions & 20 deletions
File tree
- .changeset
- content/docs/permissions
- packages
- plugins/plugin-sharing/src
- runtime/src/domains
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
0 commit comments