S4: Drop avatar field from PATCH /api/v1/identity #17
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
posta/server#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Parent
posta/server#15 — Operator-uploaded avatar served from the identity's URL
What to build
Remove the
avatarfield from the accepted body shape ofPATCH /api/v1/identity. After this slice the only way to set or clearan identity's avatar is via the new
PUT/DELETE /api/v1/identity/avatarendpoints (S1, S2) — guaranteeing the
identity.avatarcolumn alwayspoints at a real file the daemon hosts under a content-addressed URL.
End-to-end behaviour after this slice:
PATCH /api/v1/identitywith{"avatar": "..."}is rejected with400 unsupported-field(or silently ignores the field — implementationchoice at build; pick whichever matches existing PATCH behaviour for
unknown fields).
PATCH /api/v1/identitywith{"name": "...", "about": "..."}continues to work unchanged.
avatarcolumn is only ever mutated by the newupload/delete handlers (or by
identity add --name=...at bootstrap,if that path touches it — which it doesn't today).
Acceptance criteria
internal/api/identity.go(or wherever PATCH lives) no longeraccepts an
avatarfield in the request body. Either the fieldis rejected explicitly with
400and a clear error message, orit's silently dropped on parse — match the existing pattern that
handler uses for other unknown fields.
PATCH {"name": "Arne", "avatar": "x"}eitherrejects the request or sets only
name(no avatar update).name/aboutround-trip continue to pass.updated to drop the
avatarfield from the accepted set, witha one-line pointer to
PUT /api/v1/identity/avatar(S1).go build ./...andgo test ./...pass.Blocked by
None — independent of the upload-path slices. No client uses
PATCH /api/v1/identityto set the avatar field today (per #15problem statement), so this can ship in any order relative to S1–S3.
Independent contract-hygiene slice. Drops the
avatarfield fromPATCH /api/v1/identity's accepted body shape so the new upload path (#16) is the only way to mutate the avatar URL. No client uses PATCH for avatars today, so this can ship in any order relative to S1–S3.Acceptance criteria above already function as an agent brief.
Category: enhancement
State: ready-for-agent