Image upload endpoint + posta.link/v1 wire wrapping #22
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
posta/server!22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wire-link-v1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
POST /api/v1/uploads(10 MiB cap,image/jpeg+image/png, magic-byte sniffed) backed by a newinternal/uploadstorethat stores files content-addressed at/upload-<sha>.<ext>.{\"image\":{\"url\":…, \"mediaType\":…, \"name\":…, \"alt\":…, \"size\":…}}wraps toposta.link/v1on the wire (SPEC §13.3) before signing; inboundposta.link/v1unwraps back in the DTO.Out of scope (deferred):
Test plan
go test ./...POST /messageswith{\"image\":{…}}produces a queued payload of{\"kind\":\"posta.link/v1\",\"url\":…,…}.posta.link/v1envelope surfaces as{\"image\":{…}}inGET /messagesDTO.internal/payload.🤖 Generated with Claude Code
Adds POST /api/v1/uploads (10 MiB cap, image/jpeg + image/png, magic-byte sniffed) backed by a new internal/uploadstore that stores files content-addressed at /upload-<sha>.<ext>. Public GET mirrors the avatar handler: immutable cache, ETag, no auth. The client API ergonomic shape is {"image":{"url":…, …}}; the server wraps to posta.link/v1 on the wire (SPEC §13.3) and unwraps in the DTO. Required field is url; optional advisory fields (mediaType, name, alt, size) are echoed through verbatim when present and omitted from the signed bytes when absent. GC of unreferenced uploads and the future resize/compress pipeline are explicitly out of scope here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>aeb52c8127to486f416eeb