-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
auth/jwt: prevent concurrent reads and writes on MapClaims #564
Conversation
@peterbourgon looks like the test is in place and working (failing). What do you think of passing a claim factory to NewParser, that can be be used to create a new jwt.Claims, as in
If agreed, then I will make the change, test my side and commit to this pull request if you are too busy? |
Yes, sorry, I got the failing test but then failed to find the time to fix it ;) That's exactly what's needed. Probably best to define a new type ClaimFactory func(...) jwt.Claim, take one in the constructor, and probably provide a default EmptyClaimFactory implementation — or whatever would be most appropriate, I'm not a JWT expert. |
@peterbourgon sounds about right. I'm on it 👍 |
@peterbourgon this is now fixed. how shall i go about getting the changes to the repo? probably easiest if you can give me temporary write access so i can just push to this branch? |
why not just fork it to your account and submit a new PR referencing this one? |
add claimsFactory type make NewParser take a claimsFactory instead of an instance of jwt.Claims use claimsFactory to create a jwt.Claims to pass in to jwt.ParseWithClaims update NewParser calls in tests to take a claimsFactory instead of a jwt.Claims instance
@basvanbeek i created a pull request to merge with this branch, but if it's better to create one for merging with master, then let me know and i'll do it. thanks |
… for Map and Standard claims factories
auth/jwt: MapClaims: passing
Hi @peterbourgon, I just encountered the same problem, any clue on when this PR will be merged into master? thanks |
How about now? |
auth/jwt: prevent concurrent reads and writes on MapClaims
Closes #562.