SMQ-2859 - Allow user to list and revoke active refresh tokens#3319
Draft
felixgateru wants to merge 12 commits intoabsmach:mainfrom
Draft
SMQ-2859 - Allow user to list and revoke active refresh tokens#3319felixgateru wants to merge 12 commits intoabsmach:mainfrom
felixgateru wants to merge 12 commits intoabsmach:mainfrom
Conversation
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3319 +/- ##
==========================================
- Coverage 53.21% 46.86% -6.36%
==========================================
Files 312 10 -302
Lines 32706 303 -32403
==========================================
- Hits 17405 142 -17263
+ Misses 14234 152 -14082
+ Partials 1067 9 -1058 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
arvindh123
reviewed
Jan 23, 2026
Comment on lines
+52
to
+60
| // Store refresh tokens as active with TTL | ||
| if key.Type == auth.RefreshKey && key.ID != "" && key.Subject != "" { | ||
| ttl := time.Until(key.ExpiresAt) | ||
| if ttl > 0 { | ||
| if err := tok.cache.SaveActive(ctx, key.Subject, key.ID, key.Description, ttl); err != nil { | ||
| return "", err | ||
| } | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Can we move this out of tokenizer and put in service ?
Comment on lines
+88
to
+100
| key, err := tok.parseToken(token) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if key.Type == auth.RefreshKey { | ||
| // Remove the refresh token from active tokens | ||
| if err := tok.cache.RemoveActive(ctx, key.ID); err != nil { | ||
| return errors.Wrap(svcerr.ErrAuthentication, err) | ||
| } | ||
| } | ||
|
|
||
| return nil |
Contributor
There was a problem hiding this comment.
can we move this out of tokenizer ?
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 type of PR is this?
This is a feature because it adds the ability of a user to list and revoke active refresh tokens
What does this do?
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes
Did you document any new/modified feature?
Yes
Notes
To be merged after #3241