forked from mtusi2026/mtusi2026lab2
The zone owns the Attachment aggregate, which is staged as pending with a server-assigned object key and becomes ready only when stored, the Filename value that refuses empty, blank, overlong names and names with a path separator or a control character, and the declared image type. UploadAttachment checks membership first through the ChatMembership port, then the name and the declared type, reads the body stream only up to the limit while hashing it, inspects the image through a port, commits the pending row, writes the object through the ObjectStorage port and commits the ready row. GetAttachment and OpenAttachment answer 404 to strangers and to a ready row whose object is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>