Repository navigation
Commit d1e2841
fix(plugin-sharing): an email-audience share link's refusal does the same work whatever email and password are presented (#23506)
Fixes #23474
Clause-②: no
## Summary
An `email`-audience share link's refusal now does the same work whatever
email and password are presented, as its answer bytes already did after
PR #23471 (#23372). A reachability measurement on both resolve mounts
found the difference observable before this change and within noise
after it; the full readings are held by the owning seat under this
lane's disclosure rule.
## The change
`packages/plugins/plugin-sharing/src/share-link-service.ts`,
`resolveToken`: for a live row whose audience is `email`, the audience
verdict and the password verdict are combined at the end, so the refusal
path is the same whatever the caller presents. The legacy-hash upgrade
stays on the fully-passed path only. This is the landing point the card
named, the gate both resolve mounts share, so no other package changes.
## Scope
- **Answer bytes unchanged.** The refusal and the served response are
byte-for-byte what PR #23471 pinned. The refusal-order table
(`packages/runtime/src/domains/share-links-refusal-order.test.ts`)
passes untouched, 60 of 60.
- **Scoped to the `email` audience.** The `signed_in` early return is
kept. It reveals only whether the caller is signed in, which the caller
already knows, so it says nothing about a server-side secret. No reason
to widen the change was measured.
- **Not a goal: hiding whether a token exists.** An unknown token stays
a fast miss, and tokens are unguessable.
## Tests
Local verification at `0088cf19`:
- New pin
`packages/plugins/plugin-sharing/src/share-link-service.email-refusal-cost.pin.test.ts`.
On an `email`+password link it counts the refusal's work per request,
for an off-list and an allowlisted email, once with a wrong password and
once with none: the counts must be equal. Timing is flaky in CI, the
counts are not. A control checks that an allowlisted email with the
correct password still serves the record.
- The pin was red on the pre-fix `resolveToken` (2 of 3 failed, the
control passed) and is green after the fix.
- Ablation at `0088cf19`, run through `scripts/ablation-replace.mjs`:
putting the pre-fix ordering back turns both pair tests red on unequal
work counts; the file is then restored, its blob equals HEAD and `git
diff HEAD` is empty.
- `@objectstack/plugin-sharing`: `test` 46 files / 1061 tests passed;
`typecheck` exit 0, and the new pin is in the test-layer program.
- `@objectstack/runtime`: `share-links-refusal-order.test.ts` 60 / 60,
against a rebuilt plugin-sharing `dist`.
- Gates: the 65 families `dispatch-gates.mjs --commands` derives at
`0088cf19`, every one exit 0; `--ran` reconciliation: 65 derived, 65
run, 0 NOT-MEASURED. The full farm is CI's.
The branch is based at `87315102`. The four commits `main` has gained
since touch none of the paths here.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LxHPTb1LxL7a6WkQbALKnD)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3f7cb1b commit d1e2841
3 files changed
Lines changed: 196 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 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 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
799 | 803 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
805 | 817 | | |
806 | 818 | | |
807 | 819 | | |
| |||
817 | 829 | | |
818 | 830 | | |
819 | 831 | | |
| 832 | + | |
820 | 833 | | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
826 | 844 | | |
827 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
828 | 849 | | |
829 | 850 | | |
830 | 851 | | |
| |||
0 commit comments