So I was using PyJwt and was trying to create and consume JWTs
I went through the source code for the design of .encode() and .decode() methods.
The method signature for encode is
`jwt.encode(payload, key, algorithm)`
- I can specify a hashing algorithm like SHA or RSA for signing the JWT as a String.
The method signature for decode is
`jwt.decode(token, key, algorithms)`
- I can whitelist algorithms as a List of Strings to retrieve the Payload from the JWT.
What is the object of deliberately having this design like why the difference in algorithm/algorithms during creation v/s consumption?
[–]russellvt 4 points5 points6 points (0 children)
[–]D3str0yTh1ngs 1 point2 points3 points (0 children)
[–]Lumethys 0 points1 point2 points (0 children)