jwt icon indicating copy to clipboard operation
jwt copied to clipboard

TimeFunc being static prevents from using this package in a parallel test

Open jsgoupil opened this issue 4 years ago • 1 comments

I tried to bring this TimeFunc on the ParserOptions, then pass it in the Claims But I just saw a recent retraction of something very similar.

https://github.com/golang-jwt/jwt/pull/184

So, I would believe you will not accept a PR like mine until v5, but having the TimeFunc() local makes more sense for testing

https://github.com/jsgoupil/jwt/commit/a6c0c037dc35f72e1afc9a9628ae10837d4cc5bb

I hope you can consider this bug for a future release.

jsgoupil avatar Mar 29 '22 19:03 jsgoupil

Thanks for opening this issue and linking to the PR.

I suggest keeping it open (maybe adding a /v5 label) so we make sure to consider it if/when thinking through what a future release would look like.

mfridman avatar May 06 '22 02:05 mfridman

I tried to bring this TimeFunc on the ParserOptions, then pass it in the Claims But I just saw a recent retraction of something very similar.

#184

So, I would believe you will not accept a PR like mine until v5, but having the TimeFunc() local makes more sense for testing

jsgoupil@a6c0c03

I hope you can consider this bug for a future release.

Did you by any chance have a look at the v5 branch. I added a feature that hopefully solves your issue here: https://github.com/golang-jwt/jwt/pull/234/files#diff-72f644d282bce7e136d0f762de1b9d5f3e447bfa88e5e0c4974ac2479107ddc9R40-R47

oxisto avatar Feb 17 '23 21:02 oxisto

Fixed by #234

oxisto avatar Feb 21 '23 18:02 oxisto