USRSE / USRSE/usrse.github.io

feat(elections): admin voter roll CSV import and token generation

Open
#1,939 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
33
Forks
104
Avg merge
12h 3m
Merged PRs (30d)
10

Description

Summary

Let admins upload a voter roll CSV and generate one-time voting tokens for each voter.

Part of #1933.

Requirements

  • CSV upload UI on the election detail page (columns: email, name)
  • Validate CSV: unique emails, valid email format, row count limits
  • Preview imported rows before committing
  • Generate a cryptographically random token per voter, store only the salted hash
  • Provide a "regenerate token" per-voter action (invalidates the previous hash, records audit entry)
  • Provide a "revoke voter" action that invalidates the token without deletion (audit-preserving)
  • Support appending additional voters to an already-imported roll
  • Download a CSV of invited voters with status (invited/voted/revoked) — no tokens included
  • All voter-roll mutations write to the audit log

Context

  • Epic: #1933
  • Depends on the Convex schema issue and admin UI issue

Implementation notes

  • Tokens: 32 bytes of randomness, base64url-encoded → stored as sha256(salt + token) in `voterTokens.tokenHash`
  • Plaintext token is only ever in the email that gets sent and the URL the voter clicks; server stores the hash
  • Large imports should stream rows to avoid Convex mutation size limits

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.