Skip to content
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

allow JWT properties to be stored under non-string context key #64

Closed
wants to merge 1 commit into from

Conversation

TheMacies
Copy link

What

  • This PR changes the property key to be used in request context to interface{}
  • Changes are backwards compatible, because string satisfies interface{}

Why

Storing context values with string keys is not a clean design. A conflict may arise if other package were to add a 'user' value to the context. A solution is to use predefined package's private context keys. The problem and way of creating such keys are both described here.

This PR enables that behaviour.

@grounded042 grounded042 mentioned this pull request Apr 23, 2021
21 tasks
@sergiught
Copy link
Contributor

We just released the v2.0.0-beta 🥳 !

You can start testing it by running go get github.com/auth0/go-jwt-middleware/v2@v2.0.0-beta.

In case of issues fetching the v2 you might want to try go clean --modcache first before doing go get.

I'm closing this pr as now this is part of v2, but feel free to reopen if needed.

@sergiught sergiught closed this Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants