Module Gemini.Auth

type t = [
  1. | `Base64 of Cstruct.t
  2. | Hex.t
]

An authentication token type.

val of_payload : string -> [< t Base64 ]

Given a base64 payload, produce an authentication token.

val hmac_sha384 : api_secret:string -> [< `Base64 of Cstruct.t ] -> Hex.t
val to_string : [< t ] -> string

Produce a string representation of the authentication token.

val to_headers : (module Cfg.S) -> [< `Base64 of Cstruct.t ] -> Cohttp.Header.t

Encode an authentication token as a gemini payload with an http header encoding. Use module Cfg to determine secrets and the api target.