Closed fluxth closed 1 year ago
Maybe with a as_dict
argument to to_jwk
, with a default value of False
for backwards compatibility?
Hmm, that might work...
I'm a bit concerned about the return type hint but with @overload
it should work fine
I'm a bit concerned about the return type hint but with @overload it should work fine
yes using overloads is pretty common for this use case
Currently, the when generating a JWK, the only way to get a
dict
from PyJWT is to:This is very unfortunate when you want to add more fields into the JWK:
There should be a way in the API to get the underlying
dict
from theAlgorithm.to_jwk(key)
functions. My proposal is to add another variantAlgorithm.to_jwk_dict(key)
to not break API compatibility.I'm planning to send PR implementing this, but I figured I should raise an issue first to see if there's any better way of doing this...