Skip to content

fix: remove unused public write routes - #952

Merged
danieltruong merged 2 commits into
developfrom
fix-public-doc-attach
Oct 14, 2026
Merged

danieltruong merged 2 commits into
developfrom
fix-public-doc-attach

Conversation

@danieltruong

Copy link
Copy Markdown
Collaborator

Removes two public write routes that no client uses, and adds input validation to the remaining public and staff write paths.

  • Remove POST /api/public/document and POST /api/public/comment. No client has called them since 2024-02-29. The public site is read-only since v2.7.37, and comments now arrive through other systems. Public GET and HEAD routes are unchanged.
  • Public CAC sign-up and remove-member routes: the email must be a plain address string and the project id a 24-hex string. Email addresses are no longer written to the log.
  • Staff document upload: ids must be 24-hex strings. The temp file is always removed. If the document is not saved, the stored file is removed by its exact key.

Tests cover the removed routes, the new validation and the upload clean-up.

- Remove POST /api/public/document and POST /api/public/comment. No
  client has called them since 2024-02-29: the public site is
  read-only since v2.7.37 and comments arrive through other systems.
  GET and HEAD public routes are unchanged.
- Add input validation to the public CAC sign-up and remove-member
  routes: email must be a plain address string and the project id a
  24-hex string. Stop logging email addresses.
- Staff upload: require 24-hex string ids, always remove the temp
  file, and roll back the stored file by its exact key only when the
  document was not saved.
@danieltruong
danieltruong merged commit 3723e8c into develop Oct 14, 2026
4 checks passed
@danieltruong
danieltruong deleted the fix-public-doc-attach branch October 14, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant