Webs_passkey.ChallengeUnique, expirable, challenges.
module Validator : sig ... endChallenge validators.
val make : ?validity_s:int -> 'a Validator.t -> payload:'a -> tmake v ~payload is a new challenge valid for validity_s seconds with an associated stored payload payload stored in v.validity_s defaults to Validator.challenge_validity_s v.
val validate : 'a Validator.t -> t -> ('a, unit) Stdlib.resultvalidate v c is Ok playload if c validates with v and Error () otherwise. payload is the value given to make. A challenge can be validated only once within the time slot it was given at make. Also due to Validator.max it may fail to validate earlier.
val to_binary_string : t -> stringto_binary_string c are the bytes of the challenge c.
val of_binary_string : string -> tof_binary_string s is the challenge from the bytes in s.
Note. In practice challenges must be at least 16 bytes long. But the only thing you can do with a challenge is validate which will fail if that's not the case so we don't check anything here.
val pp : Stdlib.Format.formatter -> t -> unitpp formats the bytes of the challenge as base64url.