-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support for jwt
v5
#46
Conversation
For easy reference, here is the upstream PR: golang-jwt/jwt#234 Thanks for the heads-up and draft PR, @oxisto! Please feel free to make any changes that would improve the upstream JWT package as you see fit. I think the narrow scope of this project isolates it from any changes except a major semver increment or I believe the Go compiler would treat any semver major upgrade as a breaking change since the function signature from This will require an update to this package and I think you've identified both options that I would consider.
I like the above option because of it's simplicity, however, the drawback is that I'll need to do a major semver upgrade and make that clear to any package users.
I like this option because it does not require a major semver upgrade and users can simply do a minor upgrade. It also requires fewer changes to the code and documentation overall. However, this is the option I picked with Vulnerability scanners marked this package as being affected by CVEs via the dependencies. Even though the CVE didn't affect For those reasons, I'm leaning towards the former option. If I choose the former option, I have two ways to implement that. Either via
However, I've always used the If anyone has any comments or suggestions, please feel free to leave them here for consideration. |
I based it on the validation API PR for now (golang-jwt/jwt#236), but this will end up in the
Unfortunately, it does. The problem isn't arising through the semver but rather the problem is that the A very very very very hacky way to work around this would be to include the "old"
See above, actually, no. As long as the data structures would stay the same, they would be compatible, but as mentioned above the meaning would be totally different.
Yeah, I feel you. I would also prefer option 2 but its a hassle because you will transitively introduce a dependency to an old package. Even though the Go compiler is smart enough to only include this if you would use the old function, a lot of vulnerability scanners won't. Maybe one option would be to actually have separate go modules, one for "core", one for v4, one for v5. But a this point its probably just best to swallow the pill and release a |
Sorry for the wording, what I meant to say by "a major semver increment" was that the Go module declaration for After glancing at the Line 19 in 7892f09
kid JSON attribute in order to select a cryptographic key.
If the new
I don't mean to dismiss any concerns about the planned changes' effect on the keyfunc project's code base. If I missed a reference to JWT claims or other planned change, we should identify that for later.
This is what I'm currently leaning towards. It will likely make reading the documentation and making decisions about versions simpler for package users. |
I don't want to start an argument here, but just so that we are on the same track of understanding: The Go compiler actually does not care about The problem lies within my previous statement that we need to change the So, same result, but I just wanted to make sure that we have the same understanding of our options :)
That is still the preferred way to do it. I was referring to some code that I have seen which used the
The change is in this PR. golang-jwt/jwt#236
That sounds reasonable |
We have arrived at the first release candidate for |
Are there any updates on when this might be available? |
Please note the upstream project, |
Don’t tell anyone but I will release v5 later tonight ;) |
I expect to release Unless discussed otherwise, the version of This is in line with the first option discussed in the earliest comments in the thread. In this option, If someone would like to discuss the second option, a function for both I plan on using breaking change opportunity to reclaim the names of some deprecated functions. For example, I should also update the |
If you'd like to follow along with the final edits, please see this pull request: |
This serves as an experimental draft PR for the upcoming
v5
version ofjwt
. Since we are most likely changing theClaims
interface, this also has an effect on this library.Basically there are two options here:
v5
claims at some point, possibly also with another major versionv4
andv5
for example using two different functions.Any thought on this? I am happy to make the transition as smooth as possible from the
jwt
side of things, but I fear that we do need to make this break in v4->v5, otherwise we will never succeed with a proper validation API.