frasertweedale / hs-jose

Haskell JOSE and JWT library
http://hackage.haskell.org/package/jose
Apache License 2.0
122 stars 46 forks source link

jwt: support custom header types #124

Closed frasertweedale closed 4 months ago

frasertweedale commented 6 months ago

Generalise the types of signJWT, verifyJWT, and related functions to accept custom JWS header types. Add new type synonym SignedJWTWithHeader h (keeping SignedJWT as is). This change could break some applications by introducing type ambiguity. The solution is to add a type annotation or apply a function like:

fixType = id :: SignedJWT -> SignedJWT

I applied this technique in the test suite to address such ambiguity.

Fixes: https://github.com/frasertweedale/hs-jose/issues/122

frasertweedale commented 5 months ago

ping @ericpashman - could you please review this PR and advise if it meets your needs per #122?