KNOX-2266 - Tokens Should Include a Unique Identifier#284
Merged
pzampino merged 1 commit intoapache:masterfrom Mar 10, 2020
Merged
KNOX-2266 - Tokens Should Include a Unique Identifier#284pzampino merged 1 commit intoapache:masterfrom
pzampino merged 1 commit intoapache:masterfrom
Conversation
moresandeep
requested changes
Mar 10, 2020
Contributor
moresandeep
left a comment
There was a problem hiding this comment.
Looks good, few minor things.
...rver/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
Show resolved
Hide resolved
...rver/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
Show resolved
Hide resolved
...rver/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
Show resolved
Hide resolved
...service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java
Outdated
Show resolved
Hide resolved
5eb2293 to
73610ea
Compare
moresandeep
approved these changes
Mar 10, 2020
stoty
pushed a commit
to stoty/knox
that referenced
this pull request
May 14, 2024
Change-Id: I2e221099c55cc60b125505b45c23a28b7602c9bb
This file contains hidden or 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
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.
What changes were proposed in this pull request?
JWTs issued and validated by Knox now include a unique identifier as a private claim. This is mostly to guarantee token uniqueness, even for multiple requests within the same second.
Further, the TokenStateService has been updated to leverage this unique identifier as the key for handling token state. This identifier is less susceptible to the nuances of some storage mechanisms.
How was this patch tested?
Mulitple existing tests were modified to accommodate this change while ensuring the maintenance of existing behavior. TokenServiceResourceTest#testConcurrentGetToken was added to validate these changes. I've also done a bit of manual testing.