-
Notifications
You must be signed in to change notification settings - Fork 6.6k
fix(server): JWT token checks (#14930) #15004
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
base: master
Are you sure you want to change the base?
Conversation
|
@GeorgiYosifov would you mind adding unit tests? |
fc880c5 to
a61d5ee
Compare
|
Ok, I will add unit tests but I encounter that there is also problem with token revocation when I use "argocd cli". I will continue my work on the bug. |
e3f2c1c to
3af1087
Compare
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
3af1087 to
56fc1e5
Compare
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
|
@crenshaw-dev Can you review the PR at this state, before I add unit tests and test also with dex configuration manually? |
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15004 +/- ##
==========================================
+ Coverage 62.26% 62.29% +0.02%
==========================================
Files 351 351
Lines 49368 49430 +62
==========================================
+ Hits 30741 30790 +49
- Misses 15682 15708 +26
+ Partials 2945 2932 -13 ☔ View full report in Codecov by Sentry. |
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
|
Unit tests are added, still remains to test it with Dex configured. |
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
|
@agaudreault and @crenshaw-dev can this changes be merged as it becomes harder and harder to keep changes up to date just to wait this PR to be merged? Is there something missing in order the PR to be merged? |
|
@GeorgiYosifov, Thanks for working on this issue. I have verified the changes locally by integrating it with the master branch and it works well. |
| } | ||
| req.AddCookie(cookie) | ||
|
|
||
| _, err = client.Do(req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This http call needs to be made after reconfirming from the user, needs to be moved after checking thecanLogout.
| req.AddCookie(cookie) | ||
|
|
||
| _, err = client.Do(req) | ||
| errors.CheckError(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method will cause a fatal error and cause the program to terminate abruptly. If the remote server is unavailable or errors out due to network issue, it is probably its better to give a warning and logout locally and clean up the local storage.
| return nil, "", common.ErrTokenVerification | ||
| } | ||
|
|
||
| id, _ := claims["jti"].(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to check if the conversion to string was successful using an ok boolean (instead of ignoring). If the key is not found or if the conversion fails, id can be set to empty string probably with a warning log.
|
@GeorgiYosifov We are looking at speeding up the review and merge process. Please let us know if you can rebase the changes with the latest master branch. Let me know if you need any help. Thank you. |
anandf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the changes and it works well. Requires rebase with latest master and then it is good to merge.
|
Hi @anandf, Unfortunately I am out of the topic and I would not be able to cover your concerns in the above comments. You are good to go with any modifications on top of this branch in seek of success the PR to be merged someday. |
|
@GeorgiYosifov my review comments are minor and can be done later as a separate PR on top of your changes too. Can you rebase the code with the latest master and we can priortize for the merge. Other minor comments can be addressed later. |
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
|
I am done @anandf |
Signed-off-by: GeorgiYosifov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @GeorgiYosifov Can you add the file logout_test.go whatever is there in the latest master branch ? Looks like the file deletion was unintentional.
Signed-off-by: GeorgiYosifov <[email protected]>
Forgot to mention this comment, feel free to commit, merge. |
Signed-off-by: GeorgiYosifov <[email protected]>
Signed-off-by: GeorgiYosifov <[email protected]>
|
@agaudreault I see that you have requested a few changes. Could you take a re-look at this PR and help with the merge process. Thank you. |
Fixes: #14930
OIDC, Dex and Admin token revocation is done correctly.
API and CLI entry points are corrected.
Unit tests are added for each implementation change.
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist:
Please see Contribution FAQs if you have questions about your pull-request.