-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
#60 Add expireAfter functionality to JWT Builder #883
Open
pveeckhout
wants to merge
7
commits into
jwtk:master
Choose a base branch
from
pveeckhout:60-convenience_expiration_setter_which_takes_a_duration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
#60 Add expireAfter functionality to JWT Builder #883
pveeckhout
wants to merge
7
commits into
jwtk:master
from
pveeckhout:60-convenience_expiration_setter_which_takes_a_duration
Conversation
This file contains 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
The `expireAfter` method, accepting duration and timeUnit parameters, has been added to the JwtBuilder interface. This method calculates the JWT expiration date as either the issue time plus the duration or the system current time plus the duration if an issuedAt time hasn't been set. Additional tests for this feature have been included in `DefaultJwtParserTest.groovy`.
Should I have forgotten some additional testing, or any other remarks, please do not hesitate to comment. |
Two new tests have been added to DefaultJwtParserTest to validate JWT expiration behavior. The tests ensure that for the 'expireAfter()' method, duration must be more than 0 and timeUnit cannot be null. The error messages for these validation checks have also been modified for clarity.
Awesome, thanks for this! We can merge it in the context of #308. |
…h_takes_a_duration
The token expiry calculation logic has been cleaned up and optimized in DefaultJwtBuilder. A previously used optional stream has been replaced with a more straightforward if-else structure, leading to ease of code maintenance and improved readability.
…_which_takes_a_duration' into 60-convenience_expiration_setter_which_takes_a_duration
A typographical error in the comments of the 'exp' function in JwtBuilder was corrected. The phrase "specified it if" was changed to "specified if it", making the comments clearer and easier to understand.
…ration_setter_which_takes_a_duration
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.
closes #60
The
expireAfter
method, accepting duration and timeUnit parameters, has been added to the JwtBuilder interface.This method calculates the JWT expiration date as either the issuedAt time plus the duration or the system current time plus the duration if an issuedAt time hasn't been set.
Additional tests for this feature have been included in
DefaultJwtParserTest.groovy
.