Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Commit 4f187e8e authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Move authentication configuration out of Web_election

parent 5d2b4700
......@@ -41,26 +41,6 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
module Register (X : EMPTY) : WEB_ELECTION = struct
let uuid = Uuidm.to_string D.election.e_params.e_uuid
let base_path = ["elections"; uuid]
module N = struct
let name = uuid
let path = base_path
let kind = `Election (D.election.e_params.e_uuid, P.dir)
let auth_config =
match P.metadata.e_auth_config with
| None -> []
| Some xs -> xs
end
let configure_auth () =
let auth_config =
List.map (fun {auth_system; auth_instance; auth_config} ->
auth_instance, (auth_system, List.map snd auth_config)
) N.auth_config
in
Web_persist.set_auth_config uuid auth_config
include D
include P
......
......@@ -90,7 +90,6 @@ module type WEB_ELECTION = sig
include WEB_PARAMS
module E : ELECTION with type elt = G.t and type 'a m = 'a Lwt.t
module B : WEB_BALLOT_BOX
val configure_auth : unit -> unit Lwt.t
end
type election_files = {
......
......@@ -174,7 +174,17 @@ let import_election f =
)) >>
let election = do_register () in
let module W = (val election : WEB_ELECTION) in
W.configure_auth () >>
lwt () =
match W.metadata.e_auth_config with
| None -> return ()
| Some xs ->
let auth_config =
List.map (fun {auth_system; auth_instance; auth_config} ->
auth_instance, (auth_system, List.map snd auth_config)
) xs
in
Web_persist.set_auth_config uuid auth_config
in
let () =
Ocsigen_messages.debug (fun () ->
Printf.sprintf "Injecting credentials for %s" uuid
......@@ -212,7 +222,6 @@ lwt () =
let _, do_register = register_election params web_params in
let election = do_register () in
let module W = (val election : WEB_ELECTION) in
lwt () = W.configure_auth () in
assert (uuid = Uuidm.to_string W.election.e_params.e_uuid);
Ocsigen_messages.debug (fun () ->
Printf.sprintf "Initialized election %s from persistent store" uuid
......
Markdown is supported
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