DELETE /api/pastes/{id} now requires the create-time deletion token via the Authorization header (Bearer/Token/bare) or ?token= query param, matched with constant-time store.DeletionTokenEqual; 403 otherwise.
Creator-browser deletes via the /mine button (matching vwr cookie, #37) still work; unrelated browsers and plain API clients get 403.
Regression tests in internal/api/delete_auth_test.go cover: no token, wrong token (header+query), correct token (header+query), creator-cookie path, token extraction.
Based on #58 branch for the SoftDelete (bool, error) signature.
Closes #63.
- DELETE /api/pastes/{id} now requires the create-time deletion token via the `Authorization` header (Bearer/Token/bare) or `?token=` query param, matched with constant-time `store.DeletionTokenEqual`; 403 otherwise.
- Creator-browser deletes via the /mine button (matching vwr cookie, #37) still work; unrelated browsers and plain API clients get 403.
- Regression tests in internal/api/delete_auth_test.go cover: no token, wrong token (header+query), correct token (header+query), creator-cookie path, token extraction.
- Based on #58 branch for the SoftDelete (bool, error) signature.
SoftDelete now reports whether it performed the delete (conditional
UPDATE ... WHERE deleted_at IS NULL checked via RowsAffected).
RegisterRead returns an admitted flag: legacy burn pastes admit exactly
one reader (the atomic soft-delete winner), and burn-after-N pastes
increment reads_used via a conditional UPDATE guarded on
reads_used < reads_limit, so concurrent readers cannot both consume the
final read. API, HTML, and raw read paths return 404 when the reader
loses the burn claim; content is never served twice.
OpenStore pins the SQLite pool to one connection: concurrent writes on
separate pooled connections surfaced SQLITE_BUSY as spurious 500s
instead of serializing.
Adds concurrency regression tests: 24 parallel readers of a burn paste
(exactly one receives content, none of the others leak it) and 30
parallel readers vs a 3-read budget (exactly 3 admitted, then 404).
- DELETE now demands the create-time deletion token (Authorization
header: Bearer/Token/bare, or ?token= query param), compared with
the constant-time store.DeletionTokenEqual. 403 otherwise.
- Creator-browser deletes via the /mine button (matching vwr cookie,
#37) remain allowed; other browsers and plain API clients get 403.
- Regression tests: no token, wrong token (header+query), correct
token (header+query), creator-cookie path, token extraction.
- Adapted TestSoftDelete to pass the deletion token.
- docs/API.md delete section updated.
- Based on #58's SoftDelete (bool, error) signature.
poslop
merged commit 556d0fa2e1 into main2026-09-09 14:25:40 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #63.
Authorizationheader (Bearer/Token/bare) or?token=query param, matched with constant-timestore.DeletionTokenEqual; 403 otherwise.