Skip to content
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

Update deprecated call to Crypto.JWT.addClaim #4212

Open
aryairani opened this issue Jul 18, 2023 · 3 comments
Open

Update deprecated call to Crypto.JWT.addClaim #4212

aryairani opened this issue Jul 18, 2023 · 3 comments
Assignees

Comments

@aryairani
Copy link
Contributor

https://github.com/unisonweb/unison/pull/4203/files#diff-08ec3a5cf8f198a78c351f2977ceb06b77705272109827e474d2401e6647158bR133 noted this, and can be reverted after the update.

There only seems to be one usage site:

instance Servant.Auth.ToJWT HashJWTClaims where
  encodeJWT (HashJWTClaims h u) =
    Jose.emptyClaimsSet
      & Jose.addClaim "h" (toJSON h)
      & Jose.addClaim "u" (toJSON u)
      & Jose.addClaim "t" (toJSON hashJWTType)

https://hackage.haskell.org/package/jose-0.10/docs/Crypto-JWT.html says "Deprecated: use a sub-type". I don't know what that means, but hopefully @ChrisPenner does :)

Low priority but maybe a quick fix so we can forget about it?

@ChrisPenner
Copy link
Contributor

ChrisPenner commented Jul 18, 2023

I looked into the use a sub-type thing but there doesn't actually appear to be a valid (and non-silly) way to do it.
Left an issue here so we'll hopefully hear back: frasertweedale/hs-jose#116

@frasertweedale
Copy link

From your use case, it seems you are constrained by types classes from servant-auth that deal with ClaimsSet in the concrete. I'll look into it further to see how servant-auth could be updated to handle claims set types more abstractly.

@frasertweedale
Copy link

It looks like some significant (probably API-breaking) changes are needed in servant-auth to avoid the deprecated symbols. I'll file a ticket there soon, and promise not to remove the deprecated bits from jose until servant is no longer using them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants