web_signatures.mli 2.87 KB
Newer Older
1 2 3
(**************************************************************************)
(*                                BELENIOS                                *)
(*                                                                        *)
Stephane Glondu's avatar
Stephane Glondu committed
4
(*  Copyright © 2012-2018 Inria                                           *)
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 Web_serializable_t
23

24 25
module type AUTH_SERVICES = sig

26
  val get_auth_systems : unit -> string list Lwt.t
27 28
  val get_user : unit -> user option Lwt.t

29 30 31 32
end

module type AUTH_LINKS = sig

33
  val login :
34 35
    string option ->
    (unit, unit,
36 37 38
     [< Eliom_service.service_method > `Get ],
     [< Eliom_service.attached > `Attached ],
     [< Eliom_service.service_kind > `Service ],
39 40
     [ `WithoutSuffix ], unit, unit,
     [< Eliom_service.registrable > `Unregistrable ],
Stephane Glondu's avatar
Stephane Glondu committed
41
     [> Eliom_service.http_service ])
42 43 44 45
    Eliom_service.service

  val logout :
    (unit, unit,
46 47 48
     [< Eliom_service.service_method > `Get ],
     [< Eliom_service.attached > `Attached ],
     [< Eliom_service.service_kind > `Service ],
49
     [ `WithoutSuffix ], unit, unit,
50
     [< Eliom_service.registrable > `Unregistrable ],
Stephane Glondu's avatar
Stephane Glondu committed
51
     [> Eliom_service.http_service ])
52 53 54 55
    Eliom_service.service

end

56 57 58
type content =
    Eliom_registration.browser_content Eliom_registration.kind Lwt.t

59
module type WEB_BALLOT_BOX = sig
60
  val cast : string -> user * datetime -> string Lwt.t
61
  val inject_cred : string -> unit Lwt.t
62
  val update_files : unit -> unit Lwt.t
63
  val update_cred : old:string -> new_:string -> unit Lwt.t
64

65
  val compute_encrypted_tally : unit -> (int * string * string) Lwt.t
66 67
  (** Computes and writes to disk the encrypted tally. Returns the
      number of ballots and the hash of the encrypted tally. *)
68
end