Client-Server communication protocol

First try for a client-server communication protocol.


The client sends requests to the server (including a request ID) and receives an answer (with the same ID). Each request is a JSON object, in fact a python dictionary  : {‘type’:’RequestType’, ‘data’:myParameters}

Request Types

List of possible client-server request types (first version) :

  1. ‘Auth’:user authentication
  2. ‘CreateUser’: create a new user
  3. ‘CreateScrutin’: creation a new poll,
  4. ‘GetScrutin’: get the data about a poll (date, questions…),
  5. ‘UpdateScrutin’: update the data of an existing poll,
  6. ‘GetVoteTemplate’: get poll data and the questions with possible answers to display a “vote” page,
  7. ‘CheckAndRegisterVote’: check if a vote is valid and register it,
  8. ‘GetResults’: get the results of a poll,
  9. ‘ListScrutins’: list all available polls for the current user (current, closed…),
  10. ‘UserGroupManagement’: Management of users and group rights

Parameters for each request type

– Auth :

data = {‘login’:login,  ‘pass’:password}

WARNING : a salt must be used during a new user registration; login, salt, and the SHA/MD5 hash of the combination (password + salt) must be saved in the database.

This entry was posted in Development. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *