Add *WithClaims methods to jwt middleware for more advanced usage.#488
Merged
peterbourgon merged 4 commits intogo-kit:masterfrom Mar 16, 2017
Merged
Add *WithClaims methods to jwt middleware for more advanced usage.#488peterbourgon merged 4 commits intogo-kit:masterfrom
peterbourgon merged 4 commits intogo-kit:masterfrom
Conversation
Contributor
Author
|
I'm happy with the state of this PR. Would appreciate a review 👍 |
Member
|
I don't have enough context or knowledge of JWT to properly review the semantics here, but the code looks good. Unless @briankassouf wants to object, I'll merge in 48h. |
basvanbeek
reviewed
Mar 15, 2017
auth/jwt/middleware_test.go
Outdated
| t.Fatal("Claims were not passed into context correctly") | ||
| } | ||
| if !stdCl.VerifyAudience("go-kit", true) { | ||
| t.Fatal("JWT jwt.StandardClaims.Audience did not match: expecting %s got %s", standardClaims.Audience, stdCl.Audience) |
Member
|
Only one little I do have one potential addition for the middleware_test in highlighting the typical practice of embedding a I've taken the liberty to add onto this PR and code can be seen here: |
Contributor
|
This change looks good to me! |
Member
|
Thanks @cam-stitt and everyone! |
jamesgist
pushed a commit
to jamesgist/kit
that referenced
this pull request
Nov 1, 2024
Add *WithClaims methods to jwt middleware for more advanced usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I started migrating our existing JWT layer to go-kit's version however I was not able to complete the process. We implement a custom jwt.Claims object and need to be able to add middleware layers that use this.
This PR adds some new exported middlewares that allow for advanced claim types.