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

feat: port clockskew support #139

Merged
merged 11 commits into from Mar 8, 2022
Merged

Conversation

ksegun
Copy link
Contributor

@ksegun ksegun commented Dec 6, 2021

The approach is similar to that used by the golang mongodb driver to maintain backwards compatibility

This should mitigate #16

The approach is similar to that used by the golang mongodb driver to maintain backwards compatibility
@oxisto
Copy link
Collaborator

oxisto commented Dec 15, 2021

The approach is similar to that used by the golang mongodb driver to maintain backwards compatibility

This should mitigate #16

Thanks for the contribution, very much welcome, this is a feature that was on the wish list for a long time. This is definitely something I also wanted to explore as part of the new validator helper approach. I promise that I will find some time on the upcoming weekend to have a look at this, unfortunately we are quite in a end-of-the-year rush here. I also want to align this with the work I have previously started as well.

@mfridman
Copy link
Member

mfridman commented Dec 15, 2021

Agree with much of what @oxisto said. (I'm also a bit swamped)

My only 2 cents is we should take our time and think through whether this is the correct API and ensure this is a backwards compatible change. (not saying it's not, just that we think through this).

We should also use functional options instead of a variadic struct pointer.

@ksegun
Copy link
Contributor Author

ksegun commented Dec 16, 2021

Agree, we would prefer to have functional options for those of us stuck on the v4 preview in the old library we are quite happy with them.

As we evaluated our options on whether to port to a different library with skew support or this, this was a trade-off that we thought could be adequate until functional options are made available and there could be far easier ways as well now that I consider it e.g. an environment variable.

We fully support whatever approach is decided on.

claims.go Outdated Show resolved Hide resolved
claims_option.go Outdated Show resolved Hide resolved
@ksegun
Copy link
Contributor Author

ksegun commented Feb 13, 2022

@oxisto this is now all functional style

@oxisto
Copy link
Collaborator

oxisto commented Feb 14, 2022

@oxisto this is now all functional style

Nice! I will have a detailed look on this in the upcoming days. Thanks for the improvements

Copy link
Collaborator

@oxisto oxisto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor things, but I want to have at least a small discussion on naming before we merge this (as this impacts the public API).

Good job on making this non-breaking!

cc @mfridman

validator_option.go Outdated Show resolved Hide resolved
validator_option.go Outdated Show resolved Hide resolved
parser.go Outdated Show resolved Hide resolved
claims.go Outdated Show resolved Hide resolved
claims.go Outdated Show resolved Hide resolved
claims.go Outdated Show resolved Hide resolved
oxisto
oxisto previously approved these changes Feb 17, 2022
Copy link
Collaborator

@oxisto oxisto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT. This is / should be 100 % backwards compatible and fixes a long-wanted feature. Furthermore, it allows us to go into the direction of a validation helper that fine-tunes validation of the parser, also completely backwards compatible and incrementally. All new types are unexported, so we are free to change / stabilize the API. All function signature changes are variadic.

I definitely want to get some more votes on this before we merge though

cc @golang-jwt/maintainers

validator_option.go Outdated Show resolved Hide resolved
claims.go Show resolved Hide resolved
mfridman
mfridman previously approved these changes Feb 22, 2022
Copy link
Member

@mfridman mfridman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@oxisto
Copy link
Collaborator

oxisto commented Mar 7, 2022

@mfridman I have tweaked the documentation. I think we can merge it then? We are still free to change the internal names in the future.

@oxisto oxisto requested a review from mfridman March 7, 2022 21:58
Copy link
Member

@mfridman mfridman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

Outside the scope of this PR, we might want to revisit all these functional options in a future breaking release. We should start a discussion about that?

@oxisto
Copy link
Collaborator

oxisto commented Mar 8, 2022

Sounds good to me.

Outside the scope of this PR, we might want to revisit all these functional options in a future breaking release. We should start a discussion about that?

Ideally, we already started them in a way that we are happy with so not too many breaking changes are necessary. That is the main reason why I wanted to keep most of the validation structs and functions unexpected, so we can easily change them again internally.

@oxisto oxisto merged commit d489c99 into golang-jwt:main Mar 8, 2022
@ksegun ksegun deleted the clockskew-support branch March 8, 2022 11:34
@oxisto oxisto mentioned this pull request Mar 15, 2022
@Metatron93
Copy link

ksegun:clockskew-support

mfridman added a commit that referenced this pull request Mar 18, 2022
mfridman added a commit that referenced this pull request Mar 26, 2022
gubertcalixto pushed a commit to eduardocalixtokorp/jwt-go-fork that referenced this pull request Jul 1, 2022
Co-authored-by: Kolawole Segun <Kolawole.Segun@kyndryl.com>
Co-authored-by: Christian Banse <oxisto@aybaze.com>
oxisto added a commit to moneszarrugh/jwt that referenced this pull request Feb 21, 2023
Co-authored-by: Kolawole Segun <Kolawole.Segun@kyndryl.com>
Co-authored-by: Christian Banse <oxisto@aybaze.com>
oxisto pushed a commit to moneszarrugh/jwt that referenced this pull request Feb 21, 2023
oxisto added a commit to twocs/jwt that referenced this pull request Mar 29, 2023
Co-authored-by: Kolawole Segun <Kolawole.Segun@kyndryl.com>
Co-authored-by: Christian Banse <oxisto@aybaze.com>
oxisto pushed a commit to twocs/jwt that referenced this pull request Mar 29, 2023
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.

None yet

6 participants