Open ulrikstrid opened 3 years ago
I suggest:
Jwt
or Jws
. I would lean towards Jws
, because it's simpler.Jws
as a starting point.Jws
, the most "centerpiece" function is Jws.sign
, and it should come first among all the functions.Jws.sign
and Jwt.sign
take a ~header:Header.t
argument. My understanding is that it's possible to get basic Jwt usage with only alg
, however there are 8 other fields which must be manually set to None
for such usage. If that's accurate, I'd recommend turning this record into a bunch of optional arguments, or a single argument where the fields are given as elements of a polymorphic variant list.
The API is needlessly complex currently, we can simplify a lot of the things that are normally done with the library like signing things.
I would love suggestions and hear pain points of the current API.
cc @aantron and @anmonteiro that might have some ideas