Commit 744ae2a8 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Add records service

parent 337309a5
......@@ -253,6 +253,25 @@ let () = Eliom_registration.Streamlist.register
)
)
let () = Eliom_registration.Streamlist.register
~service:Services.election_records
(if_eligible can_read
(fun uuid election user () ->
forbidden () >> (* FIXME *)
let module X = (val election : Web_common.WEB_ELECTION) in
(* TODO: streaming *)
lwt ballots = X.B.fold_records (fun (u, d) xs ->
let x = Printf.sprintf "%s %S\n"
(Serializable_builtin_j.string_of_datetime d) u
in return (x::xs)
) [] in
let s = List.map (fun b () ->
return (Ocsigen_stream.of_string b)
) ballots in
return (s, "text/plain")
)
)
let prng = Cryptokit.Random.(pseudo_rng (string secure_rng 16))
let () = Eliom_registration.String.register
......
......@@ -99,6 +99,11 @@ let election_ballots = service
~get_params:uuid
()
let election_records = service
~path:["election"; "records"]
~get_params:uuid
()
let election_cast_post = post_service
~fallback:election_cast
~post_params:(string "encrypted_vote")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment