Skip to content

Identify online voters#7777

Merged
mrcasals merged 21 commits intodevelopfrom
feat/identify-online-voter
Apr 13, 2021
Merged

Identify online voters#7777
mrcasals merged 21 commits intodevelopfrom
feat/identify-online-voter

Conversation

@leio10
Copy link
Copy Markdown
Contributor

@leio10 leio10 commented Mar 31, 2021

🎩 What? Why?

This PR allows voter to be identified using census data. This should be possible without being logged, so it has several implications:

  • The elections should support both modes: using the current user when being outside a Voting, and using the census data when are included in a Votings space.
  • Nothing should depend on the existence of a logged user. This includes the access to the voting booth, the storage of the vote hash, the notification of the accepted ballot nor the feedback survey that can be filled after the voting process.

To implement this feature, this PR defines a VoteFlow class to isolate the common behaviors for the two options, and CurrentUserVoteFlow and CensusLoginFlow to implement the different parts.

After login the user (with the census data or the current user), the system generates a temporary voter_token to allow the user to vote in the next X minutes (a configurable value, 120 by default). It also generates a deterministic voter_id that will not change for the same election and voter. These values are included in the voting booth to be sent together with the encrypted vote to server to cast the vote.

This means that there wont be a session with that token, so in the case of the census login, the voter will need to enter their credentials every time they want to access to the voting booth. On the other side, this increases the security of the system and it's usability when used by several voters.

📌 Related Issues

Testing

Describe the best way to test or validate your PR.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing

Grabacion.de.pantalla.2021-03-31.a.las.11.39.30.mov

♥️ Thank you!

@leio10 leio10 changed the base branch from develop to feat/admin_voting_census March 31, 2021 15:21
@leio10 leio10 self-assigned this Mar 31, 2021
@leio10 leio10 added project: e-voting Barcelona City Council contract module: elections labels Mar 31, 2021
@leio10 leio10 requested a review from beagleknight March 31, 2021 15:24
@leio10 leio10 force-pushed the feat/identify-online-voter branch from 34fa41d to 31588f9 Compare March 31, 2021 15:42
@leio10 leio10 changed the title Feat identify online voters Identify online voters Apr 1, 2021
@leio10 leio10 force-pushed the feat/identify-online-voter branch from 31588f9 to aa1cd97 Compare April 1, 2021 09:14
@leio10 leio10 changed the base branch from feat/admin_voting_census to feature/check_census_data April 1, 2021 09:15
@leio10 leio10 force-pushed the feat/identify-online-voter branch 5 times, most recently from fe1951d to 48b1564 Compare April 1, 2021 16:25
Copy link
Copy Markdown
Contributor

@beagleknight beagleknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @leio10 ! I just left some comments 😄

valid_token?
end

def allow_unregistered?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be hardcoded or are we gonna create a setting for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is hardcoded to allow unregistered voters to fill the survey

@leio10 leio10 force-pushed the feat/identify-online-voter branch from fca5942 to e07726e Compare April 2, 2021 17:43
@slickepinne slickepinne force-pushed the feature/check_census_data branch from db64b70 to 69123bc Compare April 5, 2021 13:14
@leio10 leio10 force-pushed the feat/identify-online-voter branch 2 times, most recently from fddd415 to 384e232 Compare April 5, 2021 14:40
@leio10 leio10 marked this pull request as ready for review April 5, 2021 15:34
@leio10 leio10 force-pushed the feat/identify-online-voter branch from b0f90b5 to e4f625f Compare April 5, 2021 15:57
Base automatically changed from feature/check_census_data to feat/generate_access_codes April 5, 2021 15:58
@leio10 leio10 force-pushed the feat/identify-online-voter branch 6 times, most recently from 6ad549d to 2c94f56 Compare April 5, 2021 17:56
@orlera orlera force-pushed the feat/generate_access_codes branch from 7a0e752 to 85cc8cd Compare April 6, 2021 07:08
@mrcasals mrcasals dismissed stale reviews from agustibr and slickepinne April 13, 2021 10:11

The base branch was changed.

@leio10 leio10 force-pushed the feat/identify-online-voter branch from 04137a3 to 31fff16 Compare April 13, 2021 10:13
@leio10 leio10 marked this pull request as ready for review April 13, 2021 11:57
@mrcasals mrcasals merged commit 54feea8 into develop Apr 13, 2021
@mrcasals mrcasals deleted the feat/identify-online-voter branch April 13, 2021 11:59
entantoencuanto added a commit that referenced this pull request Apr 13, 2021
* develop:
  Let admins disable participatory space filters (#7819)
  Identify online voters (#7777)
  Restore vote tests in the elections module using the real bulletin board (#7802)
  Show initiative image in homepage (#7824)
  Let admins filter participatory space private users (#7817)
  Add Ballot Style to Census Datum (#7788)
  Show missing election component callout also for in-person votings (#7809)
  Fix canceling scope select doesnt open reveal (#7805)
  Fix: Reported users are displayed in all tenants (#7628)
  Evote - onboarding workflow (#7758)
  Add copy to clipboard feature to share links (#7697)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: elections project: e-voting Barcelona City Council contract

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Identify me with my document and an access code

6 participants