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 example in documentation incorrect #49

Closed centromere closed 7 years ago

centromere commented 7 years ago

In the documentation the example reads:

signClaims jwk (newJWSHeader (Protected, alg)) claims

however, the type of signClaims is:

signClaims :: (MonadRandom m, MonadError e m, AsError e) => JWK -> JWSHeader () -> ClaimsSet -> m SignedJWT

In order for it to work the type would have to be:

signClaims :: (MonadRandom m, MonadError e m, AsError e) => JWK -> JWSHeader Protection -> ClaimsSet -> m SignedJWT

or the example would need to be changed to:

signClaims jwk (newJWSHeader ((), alg)) claims
frasertweedale commented 7 years ago

@centromere thanks for reporting!