WIP - Add nonce validation in PoP token verifier#367
Open
julienstroheker wants to merge 6 commits into
Open
Conversation
d4a3aca to
19be0ef
Compare
amanohar
suggested changes
Jun 15, 2023
AzureMarker
suggested changes
Jun 15, 2023
AzureMarker
reviewed
Jun 16, 2023
AzureMarker
reviewed
Jun 20, 2023
| time.Sleep(2 * time.Second) | ||
|
|
||
| _, err = verifierNonce.ValidatePopToken(validToken) | ||
| assert.NoError(t, err) |
Contributor
There was a problem hiding this comment.
Shouldn't this have an error since the PoP token is only valid for 1 second according to the NewPoPVerifier call on line 313, and it's been 2 seconds since the token was created?
Contributor
|
@julienstroheker is this PR still open? |
Contributor
Author
|
Yes. I was waiting the UT refactor pr to merge first. |
AzureMarker
reviewed
Oct 3, 2023
7394192 to
c4e6be9
Compare
e6b3b70 to
5aa0f6e
Compare
AzureMarker
approved these changes
Oct 5, 2023
* add pop token nonce validation Signed-off-by: Julien Stroheker <juliens@microsoft.com> * add details on UT Signed-off-by: Julien Stroheker <juliens@microsoft.com> * Safe map lock + Uts update Signed-off-by: Julien Stroheker <juliens@microsoft.com> * review Signed-off-by: Julien Stroheker <juliens@microsoft.com> * gen fmt Signed-off-by: Julien Stroheker <juliens@microsoft.com> * Fixing ut race Signed-off-by: Julien Stroheker <juliens@microsoft.com> * using len Signed-off-by: Julien Stroheker <juliens@microsoft.com> * ut reusing nonce with different ts Signed-off-by: Julien Stroheker <juliens@microsoft.com> * Using same token different ts on UT Signed-off-by: Julien Stroheker <juliens@microsoft.com> * remove unused param Signed-off-by: Julien Stroheker <juliens@microsoft.com> * lint issue Signed-off-by: Julien Stroheker <juliens@microsoft.com> * save work * update UTs * review --------- Signed-off-by: Julien Stroheker <juliens@microsoft.com>
Signed-off-by: Julien Stroheker <juliens@microsoft.com>
b8e33bf to
c358321
Compare
AzureMarker
approved these changes
Oct 5, 2023
weinong
reviewed
Oct 7, 2023
weinong
reviewed
Oct 7, 2023
Contributor
Author
|
Still holding this PR due to changes we do on RBAC. This requires more tests + to review PR comments. PLEASE DO NOT MERGE |
Signed-off-by: Julien Stroheker <juliens@microsoft.com>
Signed-off-by: Julien Stroheker <juliens@microsoft.com>
Signed-off-by: Julien Stroheker <juliens@microsoft.com>
julienstroheker
commented
Dec 22, 2023
| "k8s.io/klog/v2" | ||
| ) | ||
|
|
||
| // // create a cache to save nonce claim to make sure the nonce is not reused |
Contributor
Author
There was a problem hiding this comment.
this can be removed
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.
Making sure nonce claim is not been re-used more than once on each requests.
nonceclaim value into a map (cache)nonceclaims by checking the values in the cache.