-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: support token revocation #5477
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
Conversation
ad3147e to
a290ffa
Compare
a290ffa to
6e8bd55
Compare
1a97bd6 to
0c44011
Compare
Codecov Report
@@ Coverage Diff @@
## master #5477 +/- ##
==========================================
+ Coverage 40.49% 40.87% +0.37%
==========================================
Files 142 144 +2
Lines 18968 18972 +4
==========================================
+ Hits 7681 7754 +73
+ Misses 10195 10127 -68
+ Partials 1092 1091 -1
Continue to review full report at Codecov.
|
util/session/sessionmanager.go
Outdated
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.
I think the format of how we formulate the subject convention is too deeply hidden in the code. Can we describe the subject convention somewhere, or better yet, have utility methods in jwtutil to parse the capabilities from a token so that the interpretation of subject is at a central place?
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.
done
Signed-off-by: Alexander Matyushentsev <[email protected]>
0c44011 to
8824a45
Compare
Signed-off-by: Alexander Matyushentsev <[email protected]>
Signed-off-by: Alexander Matyushentsev [email protected]
PR implements revocation of session tokens issued by argocd/dex/oidc provider and local users token expiration.
Revocation:
In order to avoid talking to dex/oidc during every request, revoked tokens are stored in denylist. The logout handler stores token id in redis key
revoked-token|<tokenID>. Key expiration time matches the token expiration time, so it will disappear as soon as token is expired.API Server is not talking to redis on every request. Informer like approach is implemented instead:
new-revoked-tokenRevocation:
Session tokens now have an expiration. The default expiration timeout is 24hr and can be changed using
users.session.durationsetting. E.g.users.session.duration: "2h"Important Changes
admin:loginormy-account:apiKey. For backward compatibility subjects without capability defaults toapiKey