Skip to content

Delete the unused POST /api/email/send-generic route, or limit it to admin addresses #472

Open

Description

@HMarzban

Summary

POST /api/email/send-generic sends any mail to any address with the service-role key. Nothing in the repo calls it. Staging checks were its only use, and the admin Email setup page (#423) now sends the test email instead. Delete the route, or limit its recipients to admin addresses.

Filed from the closure checks of #418.

Where

  • apps/hocuspocus.server/src/api/email.ts:40 — the route.
  • apps/hocuspocus.server/src/modules/openapi/domain/paths/email.ts:45 — its OpenAPI entry.
  • Docs that name it: apps/hocuspocus.server/API.md (lines 39, 1145, 1147), apps/hocuspocus.server/Readme.md:15, docs/api/README.md:116.

Re-check with git grep -n "send-generic" -- ':!*CHANGELOG*' before you change anything.

Fix plan

  1. Delete the route, its request schema if nothing else uses it, and its OpenAPI path.
  2. Remove it from the three docs above. Add a CHANGELOG line in apps/hocuspocus.server/CHANGELOG.md.
  3. If a maintainer wants to keep it, limit to to the addresses in the admin list instead, and say so in its OpenAPI description.

Acceptance

  • git grep -n "send-generic" -- ':!*CHANGELOG*' finds nothing (or only the limited route and its docs).
  • bun run --filter @docs.plus/hocuspocus.server test passes, including the OpenAPI spec coverage test.
  • The Email setup page still sends its test email.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions