web_persist.mli 2.86 KB
Newer Older
Stephane Glondu's avatar
Stephane Glondu committed
1 2 3
(**************************************************************************)
(*                                BELENIOS                                *)
(*                                                                        *)
Stephane Glondu's avatar
Stephane Glondu committed
4
(*  Copyright © 2012-2016 Inria                                           *)
Stephane Glondu's avatar
Stephane Glondu committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
(*                                                                        *)
(*  This program is free software: you can redistribute it and/or modify  *)
(*  it under the terms of the GNU Affero General Public License as        *)
(*  published by the Free Software Foundation, either version 3 of the    *)
(*  License, or (at your option) any later version, with the additional   *)
(*  exemption that compiling, linking, and/or using OpenSSL is allowed.   *)
(*                                                                        *)
(*  This program is distributed in the hope that it will be useful, but   *)
(*  WITHOUT ANY WARRANTY; without even the implied warranty of            *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *)
(*  Affero General Public License for more details.                       *)
(*                                                                        *)
(*  You should have received a copy of the GNU Affero General Public      *)
(*  License along with this program.  If not, see                         *)
(*  <http://www.gnu.org/licenses/>.                                       *)
(**************************************************************************)

22
open Serializable_t
23
open Common
24
open Web_serializable_t
25

26 27 28
type election_state =
  [ `Open
  | `Closed
29
  | `EncryptedTally of int * int * string
30
  | `Tallied of plaintext
Stephane Glondu's avatar
Stephane Glondu committed
31
  | `Archived
32
  ]
33 34
val get_election_state : uuid -> election_state Lwt.t
val set_election_state : uuid -> election_state -> unit Lwt.t
35

36 37
val get_election_date : uuid -> datetime Lwt.t
val set_election_date : uuid -> datetime -> unit Lwt.t
38

39 40
val get_partial_decryptions : uuid -> (int * string) list Lwt.t
val set_partial_decryptions : uuid -> (int * string) list -> unit Lwt.t
Stephane Glondu's avatar
Stephane Glondu committed
41

42 43
val get_auth_config : uuid option -> (string * (string * string list)) list Lwt.t
val set_auth_config : uuid option -> (string * (string * string list)) list -> unit Lwt.t
44

45 46 47
val get_raw_election : uuid -> string option Lwt.t
val get_election_metadata : uuid -> metadata Lwt.t
val get_election_result : uuid -> Yojson.Safe.json result option Lwt.t
Stephane Glondu's avatar
Stephane Glondu committed
48

49
val get_elections_by_owner : user -> uuid list Lwt.t
50

51 52 53
val get_voters : uuid -> string list option Lwt.t
val get_passwords : uuid -> (string * string) SMap.t option Lwt.t
val get_public_keys : uuid -> string list option Lwt.t
54
val get_private_key : uuid -> number option Lwt.t
55 56
val get_private_keys : uuid -> string list option Lwt.t
val get_threshold : uuid -> string option Lwt.t
57

58 59
val get_ballot_hashes : uuid -> string list Lwt.t
val get_ballot_by_hash : uuid -> string -> string option Lwt.t