KNOX-3019 - Allow token renewal without upper bound for non-expired tokens #880
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.
What changes were proposed in this pull request?
Implemented what's described in KNOX-3019:
knox.token.exp.max-lifetime
is set to a negative value, tokens can be renewed without a maximum lifetime checkHow was this patch tested?
Updated current and added new JUnit tests.
Conducted manual testing. In both test rounds, the Token TTL was set to 60 seconds and the token renewal interval was 30 seconds
1. Maximum lifetime set to 120 seconds
As you can see, if maximum lifetime is configured, tokens cannot be renewed after they reach that time (minus a 30-second hardcoded buffer).
2. Maximum lifetime set to -1
As this test proves, setting the maximum lifetime allows token renewal operations as many times as one needs until the token was not expired. The original token expiration was
2024-03-13T11:10:39
, and I could extend that up until2024-03-13T11:12:50
(more than 2 minutes) easily.