Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 302a3c9a authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Many renamings in auth-related interfaces

parent 4b24fdb5
......@@ -33,7 +33,7 @@ module type CONFIG = sig
val server : string
end
module Make (C : CONFIG) (N : NAME) (S : AUTH_SERVICES) : AUTH_HANDLERS = struct
module Make (C : CONFIG) (N : NAME) (S : AUTH_SERVICES) : AUTH_INSTANCE_HANDLERS = struct
let scope = Eliom_common.default_session_scope
......@@ -142,7 +142,7 @@ let parse_config ~attributes =
let make {server} =
let module C = struct let server = server end in
(module Make (C) : AUTH_SERVICE)
(module Make (C) : AUTH_MAKE_INSTANCE)
type c = config
......
......@@ -32,7 +32,7 @@ let parse_config ~attributes =
| [] -> Some ()
| _ -> None
module Make (N : NAME) (S : AUTH_SERVICES) : AUTH_HANDLERS = struct
module Make (N : NAME) (S : AUTH_SERVICES) : AUTH_INSTANCE_HANDLERS = struct
module L = Web_auth.MakeLinks (N)
......@@ -73,7 +73,7 @@ module Make (N : NAME) (S : AUTH_SERVICES) : AUTH_HANDLERS = struct
end
let make () = (module Make : AUTH_SERVICE)
let make () = (module Make : AUTH_MAKE_INSTANCE)
module A : AUTH_SYSTEM = struct
type config = unit
......
......@@ -49,7 +49,7 @@ let load_db name file =
let ( / ) = Filename.concat
module Make (C : CONFIG) (N : NAME) (S : AUTH_SERVICES) : AUTH_HANDLERS = struct
module Make (C : CONFIG) (N : NAME) (S : AUTH_SERVICES) : AUTH_INSTANCE_HANDLERS = struct
module L = Web_auth.MakeLinks (N)
......@@ -147,7 +147,7 @@ end
let make {db} =
let module C = struct let db = db end in
(module Make (C) : AUTH_SERVICE)
(module Make (C) : AUTH_MAKE_INSTANCE)
type c = config
......
......@@ -41,7 +41,7 @@ let register_auth_system auth_system =
type logged_user = {
user_user : user;
user_handlers : (module AUTH_HANDLERS);
user_handlers : (module AUTH_INSTANCE_HANDLERS);
}
module MakeLinks (N : NAME) = struct
......@@ -85,7 +85,7 @@ module Make (N : NAME) = struct
Eliom_reference.set user (Some logged_user) >>
cont () ()
in
let module A = (val user_handlers : AUTH_HANDLERS) in
let module A = (val user_handlers : AUTH_INSTANCE_HANDLERS) in
A.login cont ()
with Not_found -> fail_http 404
......@@ -135,16 +135,16 @@ module Make (N : NAME) = struct
let path = N.path @ ["auth"; instance]
let kind = N.kind
end in
let module A = (val auth : AUTH_SERVICE) (N) (Services) in
let i = (module A : AUTH_HANDLERS) in
let module A = (val auth : AUTH_MAKE_INSTANCE) (N) (Services) in
let i = (module A : AUTH_INSTANCE_HANDLERS) in
Hashtbl.add auth_instances instance i;
auth_instance_names := instance :: !auth_instance_names
)
) xs
module Handlers : AUTH_HANDLERS_PUBLIC = struct
module Handlers : AUTH_HANDLERS = struct
let do_login service cont () =
let login service cont () =
let cont () () =
match service with
| Some name -> do_login_using name cont
......@@ -161,7 +161,7 @@ module Make (N : NAME) = struct
A.logout cont ()
| None -> cont () ()
let do_logout cont () =
let logout cont () =
match_lwt Eliom_reference.get user with
| Some u ->
security_log (fun () ->
......
......@@ -31,5 +31,5 @@ module MakeLinks (N : NAME) : AUTH_LINKS
module Make (C : NAME) : sig
val configure : auth_config list -> unit
module Services : AUTH_SERVICES
module Handlers : AUTH_HANDLERS_PUBLIC
module Handlers : AUTH_HANDLERS
end
......@@ -282,11 +282,11 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
let login service () =
lwt cont = Eliom_reference.get Web_services.cont in
Auth.Handlers.do_login service cont ()
Auth.Handlers.login service cont ()
let logout () () =
lwt cont = Eliom_reference.get Web_services.cont in
Auth.Handlers.do_logout cont ()
Auth.Handlers.logout cont ()
module T = Web_templates
......
......@@ -91,14 +91,14 @@ type service_handler = unit ->
type 'a service_cont = ('a -> service_handler) -> service_handler
module type AUTH_HANDLERS = sig
module type AUTH_INSTANCE_HANDLERS = sig
val login : string service_cont
val logout : unit service_cont
end
module type AUTH_HANDLERS_PUBLIC = sig
val do_login : string option -> unit service_cont
val do_logout : unit service_cont
module type AUTH_HANDLERS = sig
val login : string option -> unit service_cont
val logout : unit service_cont
end
module type WEB_BALLOT_BOX = sig
......@@ -153,10 +153,10 @@ module type NAME = sig
val kind : [ `Site | `Election of Uuidm.t * string ]
end
module type AUTH_SERVICE =
module type AUTH_MAKE_INSTANCE =
functor (N : NAME) ->
functor (S : AUTH_SERVICES) ->
AUTH_HANDLERS
AUTH_INSTANCE_HANDLERS
module type AUTH_SYSTEM = sig
type config
......@@ -167,5 +167,5 @@ module type AUTH_SYSTEM = sig
attributes:(string * string) list ->
config option
val make : config -> (module AUTH_SERVICE)
val make : config -> (module AUTH_MAKE_INSTANCE)
end
......@@ -34,11 +34,11 @@ open Web_services
let login service () =
lwt cont = Eliom_reference.get Web_services.cont in
A.Handlers.do_login service cont ()
A.Handlers.login service cont ()
let logout () () =
lwt cont = Eliom_reference.get Web_services.cont in
A.Handlers.do_logout cont ()
A.Handlers.logout cont ()
let () = Any.register ~service:site_login login
let () = Any.register ~service:site_logout logout
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