Session_manager.Make
Make
is a functor for creating modules of middlewares for various entities matching Auth
.MODEL
module M : Auth_sign.MODEL
module V : Auth_sign.VARIABLES with type entity = M.t
type entity = M.t
type entity
is a type of authenticatable entity equal to MODEL
.t
auth_setup
is a middleware which controlls session, setups field
variables and helper functions for downstream handlers
auth_setup
tries to extract auth
string from session and determine the status of authentication. If there is no auth
, then there were no authentication. If auth
exisits, than set_helpers
checks it and manages authentication status. If something is wrong with a session, Error Error.t
is returned, and in this case session is invalidated, error is logged and 401 is sent. If session is ok, Ok request
is recived, and that requested is passed on.