You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding an example to the README of using what I think (based on your explanation, thank you) are the most basic modules: either Jwt or Jws. I would lean towards Jws, because it's simpler.
The API docs should funnel people to module Jws as a starting point.
In module Jws, the most "centerpiece" function is Jws.sign, and it should come first among all the functions.
Both 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 reasons why signing can fail should probably be explained — normally, you'd expect anything to be signable, so I suspect this is due to constraints on keys.
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
The text was updated successfully, but these errors were encountered: