Add secure guest ballot creation API - #81
Merged
Merged
Conversation
DavidMoritz
approved these changes
Sep 6, 2026
DavidMoritz
left a comment
Owner
There was a problem hiding this comment.
This is seriously impressive backend work. The security model is rock-solid — 256-bit server-generated token, SHA-256 digest storage, unpredictable native owner markers masked from public reads, and Cache-Control: no-store on the response. The input validation is thorough (UTF-8 checks, control characters, dedup), and the transaction handling pragmatically accounts for MyISAM's limitations. Six comprehensive PHPUnit tests covering the happy path, validation edge cases, and legacy mutation blocking. Top-notch engineering. Thank you for all this effort!
DavidMoritz
force-pushed
the
codex/guest-ballot-api
branch
from
September 6, 2026 23:10
93790cb to
ad5c5d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/v2/ballots.phpcontract for name-and-candidates guest creationCache-Control: no-storeVerification
npm test: 191 Vitest tests; 231 PHPUnit tests / 587 assertionsgit diff --checkDeployment note
Apply
src/api/migrations/2026-09-06-ballot-management-tokens.sqlbefore deploying this endpoint and its legacy mutation guards.Stack
This PR stacks on #80, which records the corresponding maintainer guidance in the RFC.