-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export IntDate #30
Comments
Bump. It's not immediately clear how to construct a toIntDate posixTime =
case Aeson.fromJSON $ Aeson.toJSON posixTime of
Aeson.Success d -> d
Aeson.Error s -> error $ "Could not roundtrip POSIX time (" ++ show posixTime ++ "): " ++ s On the topic of improving the API, it'd be great to have the following:
|
Why can't you just create it directly? Admittedly I haven't looked at any of this for a while but I have code that does just that in another project and last time I checked it compiled fine.
|
oh interesting. IntDate doesn't show up in the haddocks, so I didn't think it was available. Maybe Jose.Jwt can explicitly list everything reexported instead of reexporting the Jose.Types internal module? If JwtClaims wasn't intended to encode the standard token claims, what is the intended way? The most common usage of JWTs is to transmit auth claims, and IMO it doesnt make sense for an auth application to decode a token that it didnt generate/encode in the first place. It would also be cool to expose an extraClaims field like what |
To quote the Readme/doc:
So there is no intended way other than to create the content as you wish and passing a bytestring to the library. In many cases this will be by creating a type and its corresponding aeson typeclass implementations but it doesn't have to be.
This is clearly not the case. If an app is only consuming tokens that it has signed itself, then there's not much need for a specification, particularly one which supports so many asymmetric cryptography algorithms and places such an emphasis on checking the However, who is signing/verifying the token is irrelevant from the library's perspective. It can encode and decode tokens but doesn't make any attempt to interpret or validate the claims in them. I considered the possibility of adding an "extra claims" map in the past but trying to cater for all the different use cases seemed like a bad idea. The data in the claims varies a lot and is often a superset of the standard claims where some or all fields are required, whereas in the |
No description provided.
The text was updated successfully, but these errors were encountered: