Skip to content

SMQ-2859 - Allow user to list and revoke active refresh tokens#3319

Draft
felixgateru wants to merge 12 commits intoabsmach:mainfrom
felixgateru:smq2859-sign-out
Draft

SMQ-2859 - Allow user to list and revoke active refresh tokens#3319
felixgateru wants to merge 12 commits intoabsmach:mainfrom
felixgateru:smq2859-sign-out

Conversation

@felixgateru
Copy link
Contributor

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

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
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.86%. Comparing base (28fc973) to head (22c8a0f).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this out of tokenizer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants