You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👋 Hi! Thanks for creating such a simple to use JWT library.
One problem I've run into is that when using the exp functionality I am unable to write tests around expiration scenarios without using time-bending libraries such as Timecop. This isn't the worst thing in the world but I often find I end up in confusing scenarios due to losing the explicit control of what time is being passed to the method under test.
I'm happy to work on a PR if so but I was wondering if there are thoughts around being able to pass the current time to decode. Is this a change that would be accepted? If so, are there ideas around how it should be part of the decode signature?
The text was updated successfully, but these errors were encountered:
Hey @excpt! Thanks for the reply and the tips around tests JWT.
I'm not sure I fully understand how adding the ability to pass the current time would break it. Are you meaning that would increase the chance for "human error" i.e. someone passes an incorrect time object in production code? If that's the case I completely understand. If passing the current time is optional however this might not be as risky. This could also make the library viable for people using non system time sources (external clock services to account for hardware drift etc). Of course you might not want to introduce any of the complexity/risk but just throwing my hat in.
👋 Hi! Thanks for creating such a simple to use JWT library.
One problem I've run into is that when using the
exp
functionality I am unable to write tests around expiration scenarios without using time-bending libraries such as Timecop. This isn't the worst thing in the world but I often find I end up in confusing scenarios due to losing the explicit control of what time is being passed to the method under test.I'm happy to work on a PR if so but I was wondering if there are thoughts around being able to pass the current time to
decode
. Is this a change that would be accepted? If so, are there ideas around how it should be part of thedecode
signature?The text was updated successfully, but these errors were encountered: