package ez_api

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

User storage located in the memory of the server.

Parameters

module S : EzSession.TYPES.SessionArg with type user_id = string

Signature

val create_user : ?pwhash:Stdlib.Digest.t -> ?password:string -> ?kind:string -> login:string -> S.user_info -> unit

Creates user and adds it to users. If kind is specified, than creates user without password (foreign user). User id corresponds to login. Hash password if pwhash is not specified. Raises UserAlreadyDefined if a user with the same login already exists. Raises NoPasswordProvided if no pwhash or password was specified for a local (non foreign) user.

val remove_user : login:string -> unit

Removes user with the given login from the storage

val find_user : login:string -> (string option * S.user_id * S.user_info) option Lwt.t

Searches for user with given login and returns its password, if defined, its id and its information.

val check_foreign : origin:string -> token:string -> (string, int * string option) Stdlib.result Lwt.t

Checks for foreign user with the login origin-token. If exists, returns its login. Otherwise returns an error number with an error message.

val register_foreign : origin:string -> token:string -> (S.user_id * S.user_info option, int * string option) Stdlib.result Lwt.t

See default_register_foreign (not implemented yet).

See EzSession.TYPES.SessionArg

OCaml

Innovation. Community. Security.