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 89fb82cc authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Port to Eliom 4

parent 86b59f11
......@@ -37,25 +37,25 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
let scope = Eliom_common.default_session_scope
let cas_login = Eliom_service.external_service
let cas_login = Eliom_service.Http.external_service
~prefix:C.server
~path:["login"]
~get_params:Eliom_parameter.(string "service" ** opt (bool "renew"))
()
let cas_logout = Eliom_service.external_service
let cas_logout = Eliom_service.Http.external_service
~prefix:C.server
~path:["logout"]
~get_params:Eliom_parameter.(string "service")
()
let cas_validate = Eliom_service.external_service
let cas_validate = Eliom_service.Http.external_service
~prefix:C.server
~path:["validate"]
~get_params:Eliom_parameter.(string "service" ** string "ticket")
()
let login_cas = Eliom_service.service
let login_cas = Eliom_service.Http.service
~path:N.path
~get_params:Eliom_parameter.(opt (string "ticket"))
()
......
......@@ -39,7 +39,7 @@ module Make (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = struct
let scope = Eliom_common.default_session_scope
let service = Eliom_service.service
let service = Eliom_service.Http.service
~path:N.path
~get_params:Eliom_parameter.unit
()
......@@ -49,7 +49,7 @@ module Make (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = struct
let () = Eliom_registration.Html5.register ~service
(fun () () ->
let post_params = Eliom_parameter.(string "username") in
let service = Eliom_service.post_coservice
let service = Eliom_service.Http.post_coservice
~csrf_safe:true
~csrf_scope:scope
~fallback:service
......
......@@ -56,7 +56,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
let scope = Eliom_common.default_session_scope
let service = Eliom_service.service
let service = Eliom_service.Http.service
~path:N.path
~get_params:Eliom_parameter.unit
()
......@@ -79,7 +79,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
let post_params = Eliom_parameter.(
string "username" ** string "password"
) in
let service = Eliom_service.post_coservice
let service = Eliom_service.Http.post_coservice
~csrf_safe:true
~csrf_scope:scope
~fallback:service
......@@ -104,7 +104,7 @@ module Make (C : CONFIG) (N : NAME) (T : LOGIN_TEMPLATES) : AUTH_HANDLERS = stru
let bootstrap_service_handler () =
let post_params = Eliom_parameter.file "password_db" in
let upload_service = Eliom_service.post_coservice
let upload_service = Eliom_service.Http.post_coservice
~csrf_safe:true
~csrf_scope:scope
~fallback:service
......
......@@ -93,12 +93,12 @@ module Make (N : CONFIG) = struct
| Some u -> return (Some u.user_user)
| None -> return None
let login = Eliom_service.service
let login = Eliom_service.Http.service
~path:(N.path @ ["login"])
~get_params:Eliom_parameter.(opt (string "service"))
()
let logout = Eliom_service.service
let logout = Eliom_service.Http.service
~path:(N.path @ ["logout"])
~get_params:Eliom_parameter.unit
()
......
......@@ -274,6 +274,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
module S : ELECTION_SERVICES = struct
include Auth.Services
open Eliom_service.Http
let make_path x = base_path @ x
let root = make_path [""]
......@@ -376,7 +377,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
let post_params = Eliom_parameter.(
bool "featured"
) in
let set_featured = Eliom_service.post_coservice
let set_featured = Eliom_service.Http.post_coservice
~csrf_safe:true
~csrf_scope:scope
~fallback:W.S.admin
......@@ -493,7 +494,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
let ballot_received user =
let confirm () =
let service = Eliom_service.post_coservice
let service = Eliom_service.Http.post_coservice
~csrf_safe:true
~csrf_scope:scope
~fallback:W.S.election_cast
......
......@@ -39,7 +39,8 @@ module type AUTH_SERVICES = sig
Eliom_service.a_s ],
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val logout :
......@@ -48,7 +49,8 @@ module type AUTH_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
end
......@@ -61,7 +63,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val admin :
......@@ -70,7 +73,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val source_code :
......@@ -79,7 +83,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val get_randomness :
......@@ -88,7 +93,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val new_election :
......@@ -97,7 +103,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val new_election_post :
......@@ -113,7 +120,8 @@ module type CORE_SERVICES = sig
([ `One of Eliom_lib.file_info ] Eliom_parameter.param_name *
([ `One of Eliom_lib.file_info ] Eliom_parameter.param_name *
[ `One of Eliom_lib.file_info ] Eliom_parameter.param_name)),
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val tool :
......@@ -122,7 +130,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Unregistrable ], 'a)
[< Eliom_service.registrable > `Unregistrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_index :
......@@ -131,7 +140,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_new :
......@@ -140,7 +150,8 @@ module type CORE_SERVICES = sig
([> `Internal of [> `Coservice ] ], [> `Post ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup :
......@@ -150,7 +161,8 @@ module type CORE_SERVICES = sig
Eliom_service.a_s ],
[ `WithoutSuffix ],
[ `One of Uuidm.t ] Eliom_parameter.param_name, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_group :
......@@ -161,7 +173,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of Uuidm.t ] Eliom_parameter.param_name,
[ `One of string ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_metadata :
......@@ -172,7 +185,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of Uuidm.t ] Eliom_parameter.param_name,
[ `One of string ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_questions :
......@@ -183,7 +197,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of Uuidm.t ] Eliom_parameter.param_name,
[ `One of string ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_trustee_add :
......@@ -194,7 +209,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of Uuidm.t ] Eliom_parameter.param_name,
unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_credentials :
......@@ -204,7 +220,8 @@ module type CORE_SERVICES = sig
Eliom_service.a_s ],
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_credentials_download :
......@@ -214,7 +231,8 @@ module type CORE_SERVICES = sig
Eliom_service.a_s ],
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_credentials_post :
......@@ -225,7 +243,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name,
[ `One of string ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_credentials_post_file :
......@@ -236,7 +255,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name,
[ `One of Eliom_lib.file_info ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_trustee :
......@@ -246,7 +266,8 @@ module type CORE_SERVICES = sig
Eliom_service.a_s ],
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_trustee_post :
......@@ -257,7 +278,8 @@ module type CORE_SERVICES = sig
[ `WithoutSuffix ],
[ `One of string ] Eliom_parameter.param_name,
[ `One of string ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_setup_create :
......@@ -267,7 +289,8 @@ module type CORE_SERVICES = sig
Eliom_service.a_s ],
[ `WithoutSuffix ],
[ `One of Uuidm.t ] Eliom_parameter.param_name, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
end
......@@ -281,7 +304,8 @@ module type ELECTION_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val admin :
......@@ -290,7 +314,8 @@ module type ELECTION_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_dir :
......@@ -300,7 +325,8 @@ module type ELECTION_SERVICES = sig
Eliom_service.a_s ],
[ `WithSuffix ],
[ `One of Web_common.election_file ] Eliom_parameter.param_name,
unit, [< Eliom_service.registrable > `Registrable ], 'a)
unit, [< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val booth :
......@@ -309,7 +335,8 @@ module type ELECTION_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Unregistrable ], 'a)
[< Eliom_service.registrable > `Unregistrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_update_credential :
......@@ -318,7 +345,8 @@ module type ELECTION_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit, unit,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_update_credential_post :
......@@ -329,7 +357,8 @@ module type ELECTION_SERVICES = sig
[ `WithoutSuffix ], unit,
[ `One of string ] Eliom_parameter.param_name *
[ `One of string ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_vote :
......@@ -338,7 +367,8 @@ module type ELECTION_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit,
unit, [< Eliom_service.registrable > `Registrable ], 'a)
unit, [< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_cast :
......@@ -347,7 +377,8 @@ module type ELECTION_SERVICES = sig
([> `Internal of [> `Service ] ], [> `Get ])
Eliom_service.a_s ],
[ `WithoutSuffix ], unit,
unit, [< Eliom_service.registrable > `Registrable ], 'a)
unit, [< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
val election_cast_post :
......@@ -358,15 +389,14 @@ module type ELECTION_SERVICES = sig
[ `WithoutSuffix ], unit,
[ `One of string ] Eliom_parameter.param_name *
[ `One of Eliom_lib.file_info ] Eliom_parameter.param_name,
[< Eliom_service.registrable > `Registrable ], 'a)
[< Eliom_service.registrable > `Registrable ],
[> Eliom_service.http_service ])
Eliom_service.service
end
type service_handler = unit ->
(Eliom_registration.browser_content,
Eliom_registration.http_service
) Eliom_registration.kind Lwt.t
Eliom_registration.browser_content Eliom_registration.kind Lwt.t
type 'a service_cont = ('a -> service_handler) -> service_handler
......@@ -405,7 +435,8 @@ module type ELECTION_TEMPLATES = sig
set_featured:(unit, 'a, [< Eliom_service.post_service_kind ],
[< Eliom_service.suff ], 'b,
[ `One of bool ] Eliom_parameter.param_name,
[< Eliom_service.registrable ], 'c)
[< Eliom_service.registrable ],
[< Eliom_service.non_ocaml_service ])
Eliom_service.service ->
is_featured:bool ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
......@@ -421,7 +452,8 @@ module type ELECTION_TEMPLATES = sig
(unit, 'b,
[< Eliom_service.post_service_kind ],
[< Eliom_service.suff ], 'c, unit,
[< Eliom_service.registrable ], 'd)
[< Eliom_service.registrable ],
[< Eliom_service.non_ocaml_service ])
Eliom_service.service) ->
can_vote:bool ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
......@@ -487,7 +519,8 @@ module type LOGIN_TEMPLATES = sig
[< Eliom_service.suff ], 'b,
[< string Eliom_parameter.setoneradio ]
Eliom_parameter.param_name,
[< Eliom_service.registrable ], 'c)
[< Eliom_service.registrable ],
[< Eliom_service.non_ocaml_service ])
Eliom_service.service ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
......@@ -498,7 +531,8 @@ module type LOGIN_TEMPLATES = sig
Eliom_parameter.param_name *
[< string Eliom_parameter.setoneradio ]
Eliom_parameter.param_name,
[< Eliom_service.registrable ], 'c)
[< Eliom_service.registrable ],
[< Eliom_service.non_ocaml_service ])
Eliom_service.service ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
......@@ -507,7 +541,8 @@ module type LOGIN_TEMPLATES = sig
[< Eliom_service.suff ], 'b,
[< Eliom_lib.file_info Eliom_parameter.setoneradio ]
Eliom_parameter.param_name,
[< Eliom_service.registrable ], 'c)
[< Eliom_service.registrable ],
[< Eliom_service.non_ocaml_service ])
Eliom_service.service ->
unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
......
......@@ -105,6 +105,7 @@ module Make (C : CONFIG) : SITE = struct
include Auth.Services
include Auth.Handlers
open Eliom_parameter
open Eliom_service.Http
let scope = Eliom_common.default_session_scope
......
......@@ -260,7 +260,7 @@ module Make (S : SITE_SERVICES) : TEMPLATES = struct
let make_button ~service contents =
let uri = Eliom_uri.make_string_uri ~service () in
Printf.ksprintf unsafe_data (* FIXME: unsafe *)
Printf.ksprintf Unsafe.data (* FIXME: unsafe *)
"<button onclick=\"location.href='%s';\">%s</button>"
uri
contents
......
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