Repository navigation
✨ Voting portal: public "Locate your ballot" check without login (release/10.1) - #4707
Draft
xalsina-sequent wants to merge 1 commit into
Draft
xalsina-sequent wants to merge 1 commit into
xalsina-sequent wants to merge 1 commit into
Conversation
Parent issue: sequentech/meta#15623 Anyone who holds a Ballot ID can check, without logging in, that the ballot is recorded in the ballot box. The answer is found or not found. An election event allows it with the new public_ballot_lookup_policy, disabled by default. - sequent-core: PublicBallotLookupPolicy in the event presentation, skipped in Borsh. - hasura: index on cast_vote (election_event_id, election_id, ballot_id). - harvest: POST /api/public/locate-ballot, exact match, no credentials. - windmill: the receipt links to the public page when the policy is on. - voting portal: public page outside the login gate, Ballot ID in the URL fragment; the confirmation link and QR point to it. - admin portal: the policy in the event settings. - docs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
|
This branch has not been deployed
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.
Parent issue: https://github.com/sequentech/meta/issues/15623
Summary
A voter's receipt carries a Ballot ID, but "Locate your ballot" only works after logging in. In events where voters sign in only through an external identity provider, the voter can't come back later, so the receipt can't be checked.
This adds a public check: anyone who holds a Ballot ID can confirm, without logging in and while the election is running, that the ballot is recorded in the ballot box. The answer is found or not found, nothing else. An election event allows it with a new policy, off by default.
Changes
public_ballot_lookup_policy(disabledby default,enabled). Skipped in the Borsh encoding, so signed ballot bytes do not change; an unknown value reads as no policy.cast_vote (election_event_id, election_id, ballot_id). Building it locks the table against writes, so apply it while no election is open.POST /api/public/locate-ballot, no credentials. It takes the full 64-character Ballot ID (no prefix, no pattern) and answers{"status": "found"}or{"status": "not-found"}. Policy off, unknown event and wrong election are allnot-found. Adiscardedballot is not found;validandin-progressare found, so a re-vote stays private. The Ballot ID is not logged./tenant/…/event/…/election/…/public-ballot-locator#<ballot id>, outside the login gate. It starts no login and makes no Hasura request, and uses the event's logo, CSS and languages. The Ballot ID travels in the URL fragment and the request body, never in a path. The confirmation screen's link and QR point to it when the policy is on.HARVEST_URL: the public address of harvest. Without it the page says the check is not available and receipts keep the logged-in link.The logged-in locator is unchanged.
Notes for reviewers
Access-Control-Allow-Origin: *): it takes no credentials and gives everyone the same answer.HARVEST_URL, and add rate limiting at the gateway.Testing
sequent-core(policy, lenient read, unchanged Borsh bytes),harvest(input validation, response shape),windmill(receipt link), and jest for the lookup service, URL builder, public page and the login-gate exemption. Voting portal, ui-core and admin portal suites, typecheck, lint and prettier pass.Ports to
mainwill follow.🤖 Generated with Claude Code