package sihl

  1. Overview
  2. Docs
The modular functional web framework

Install

Dune Dependency

Authors

Maintainers

Sources

sihl-queue-0.1.10.tbz
sha256=b264f357c2a65dbed00c3459be76cdd9b21275aeb9d0289634a2050161665211
sha512=b22fa96a3c7fa607df04848b40a0f54890f4f63c519d10ff7fcef8ccf09341731b42ff4decccb4a7e858e138a803c849ee0c5226c514938cdcded2fd80cae4cb

doc/sihl.middleware/Sihl_middleware/Csrf/Make/argument-1-TokenService/index.html

Parameter Make.TokenService

val create : kind:string -> ?data:string -> ?expires_in:Sihl_utils.Time.duration -> ?length:int -> unit -> Sihl_token__.Model.t Lwt.t

Create a token and store a token.

Provide expires_in to define a duration in which the token is valid, default is one day. Provide data to store optional data as string. Provide length to define the length of the token in bytes.

val find : string -> Sihl_token__.Model.t Lwt.t

Returns an active and non-expired token. Raises Failure if no token is found.

val find_opt : string -> Sihl_token__.Model.t option Lwt.t

Returns an active and non-expired token.

val find_by_id : string -> Sihl_token__.Model.t Lwt.t

Returns an active and non-expired token by id. Raises Failure if no token is found.

val find_by_id_opt : string -> Sihl_token__.Model.t option Lwt.t

Returns an active and non-expired token by id.

val invalidate : Sihl_token__.Model.t -> unit Lwt.t

Invalidate a token by marking it as such in the database and therefore marking it "to be deleted"

val register : unit -> Sihl_core.Container.Service.t
OCaml

Innovation. Community. Security.