Owner decision 2026-10-16: remove the half-integrated cans feature entirely (zero prod usage) and fix two related security nits from the audit.
Cans removal (feature gone, not stubbed):
Deleted internal/api/cans.go, templates/can.html, and all can routes: POST /api/pastes/can, GET/DELETE /api/cans/{id}, GET /api/cans/{id}/items/{item}, GET/POST /can/{id}
Removed is_can from /api/mine and /api/public; store layer simplified (no more paste_cans UNION in listings/counters); cans sweep rule dropped; 'can'/'cans' released from reserved slugs
Removed can CSS (.can-page/.can-item*), is_can badges in history.js/mine.js, dead helpers (expiryStringIfValid, templateEsc) and the #4-only web exports
Schema migration: paste_cans is dropped only when empty (non-empty table is kept and logged — dev has test cans to clean up first); pastes.can_id column dropped (prod verified clean 2026-10-16: 13 pastes, zero can_id set). New TestMigrateDropsCansSchema covers empty-table drop, non-empty keep, and fresh-DB cases.
Security hardening: pw_${id} (web.go unlock) and tok_${id} (server.go create + web.go re-set) cookies now carry Secure: true alongside HttpOnly + SameSite=Lax (all deployments HTTPS-only).
Verification: go vet ./... clean, go test ./... all pass, full-tree grep shows no can references outside the migration itself and the inert pre-implementation design sketches under sketches/.
Note: sketches/can-demo is a pre-implementation HTML mockup with no code paths; left untouched as design history.
Owner decision 2026-10-16: remove the half-integrated cans feature entirely (zero prod usage) and fix two related security nits from the audit.
**Cans removal (feature gone, not stubbed):**
- Deleted internal/api/cans.go, templates/can.html, and all can routes: POST /api/pastes/can, GET/DELETE /api/cans/{id}, GET /api/cans/{id}/items/{item}, GET/POST /can/{id}
- Removed is_can from /api/mine and /api/public; store layer simplified (no more paste_cans UNION in listings/counters); cans sweep rule dropped; 'can'/'cans' released from reserved slugs
- Removed can CSS (.can-page/.can-item*), is_can badges in history.js/mine.js, dead helpers (expiryStringIfValid, templateEsc) and the #4-only web exports
- Docs updated: docs/api.md cans section removed; README, LICENSE, docker-compose mentions cleaned
- Tests: cans_test.go / cans_flow_test.go / cans_expiry_test.go / TestErrorCodeCanValidation removed; cookie_set_test now asserts Secure
**Schema migration:** paste_cans is dropped only when empty (non-empty table is kept and logged — dev has test cans to clean up first); pastes.can_id column dropped (prod verified clean 2026-10-16: 13 pastes, zero can_id set). New TestMigrateDropsCansSchema covers empty-table drop, non-empty keep, and fresh-DB cases.
**Security hardening:** pw_${id} (web.go unlock) and tok_${id} (server.go create + web.go re-set) cookies now carry Secure: true alongside HttpOnly + SameSite=Lax (all deployments HTTPS-only).
**Verification:** go vet ./... clean, go test ./... all pass, full-tree grep shows no can references outside the migration itself and the inert pre-implementation design sketches under sketches/.
Note: sketches/can-demo is a pre-implementation HTML mockup with no code paths; left untouched as design history.
Owner decision 2026-10-16: the cans feature (bundles of pastes, #4) was
half-integrated and has zero prod usage; removing it eliminates four audit
findings by deletion.
Removed:
- internal/api/cans.go and all can routes (/api/pastes/can, /api/cans/*,
/can/{id}) plus handleCanPage/renderCan
- is_can from /api/mine and /api/public responses
- store layer: CanRow, can store funcs, paste_cans UNION in listings,
cans sweep; reserved slugs 'can'/'cans' released
- templates/can.html, can CSS, is_can badges in history.js/mine.js
- cans tests (cans_test.go, cans_flow_test.go, cans_expiry_test.go,
TestErrorCodeCanValidation)
- docs/api.md cans section, README/LICENSE/docker-compose mentions
Store migration: drops paste_cans only when empty (non-empty table is
kept and logged; prod verified clean 2026-10-16) and drops the dormant
pastes.can_id column. Covered by new TestMigrateDropsCansSchema.
Security hardening (audit findings): pw_<id> (unlock) and tok_<id>
(deletion-token) cookies now carry Secure: true in addition to
HttpOnly + SameSite=Lax; all deployments are HTTPS-only. cookie_set_test
now asserts Secure.
go vet ./... and go test ./... pass.
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.
Owner decision 2026-10-16: remove the half-integrated cans feature entirely (zero prod usage) and fix two related security nits from the audit.
Cans removal (feature gone, not stubbed):
Schema migration: paste_cans is dropped only when empty (non-empty table is kept and logged — dev has test cans to clean up first); pastes.can_id column dropped (prod verified clean 2026-10-16: 13 pastes, zero can_id set). New TestMigrateDropsCansSchema covers empty-table drop, non-empty keep, and fresh-DB cases.
Security hardening: pw_${id} (web.go unlock) and tok_${id} (server.go create + web.go re-set) cookies now carry Secure: true alongside HttpOnly + SameSite=Lax (all deployments HTTPS-only).
Verification: go vet ./... clean, go test ./... all pass, full-tree grep shows no can references outside the migration itself and the inert pre-implementation design sketches under sketches/.
Note: sketches/can-demo is a pre-implementation HTML mockup with no code paths; left untouched as design history.