Skip to content

feat: add cleanup for expired OAuth2 provider app codes and tokens #18825

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

Open
wants to merge 1 commit into
base: thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance
Choose a base branch
from

Conversation

ThomasK33
Copy link
Member

Add OAuth2 Provider App Codes and Tokens Cleanup

This PR adds database cleanup functionality for expired OAuth2 provider app codes and tokens. The implementation:

  1. Adds two new database methods:

    • DeleteExpiredOAuth2ProviderAppCodes - Removes authorization codes that have expired
    • DeleteExpiredOAuth2ProviderAppTokens - Removes access tokens that have expired
  2. Integrates these methods into the database purge routine alongside the existing device code cleanup

  3. Adds authorization checks to ensure only system operations can perform these cleanup tasks

  4. Includes comprehensive tests to verify the cleanup functionality works correctly for both expired app codes and tokens

These changes ensure that expired OAuth2 provider data is properly cleaned up from the database, preventing unnecessary accumulation of stale records.

Copy link
Member Author

ThomasK33 commented Jul 10, 2025

@ThomasK33 ThomasK33 requested a review from johnstcn July 10, 2025 11:06
@ThomasK33 ThomasK33 marked this pull request as ready for review July 10, 2025 11:06
@ThomasK33 ThomasK33 requested a review from mafredri July 10, 2025 11:10
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from dae9dfa to 29ecd64 Compare July 10, 2025 11:36
@ThomasK33 ThomasK33 force-pushed the thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance branch from e24c4b5 to 98e7f95 Compare July 12, 2025 12:55
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 29ecd64 to 50a22db Compare July 12, 2025 12:55
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 50a22db to 93a1a1d Compare July 14, 2025 12:43
@ThomasK33 ThomasK33 force-pushed the thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance branch from 98e7f95 to 2792051 Compare July 14, 2025 12:43
@ThomasK33 ThomasK33 force-pushed the thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance branch from 2792051 to 3dd0c37 Compare July 14, 2025 16:22
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 93a1a1d to 5c7f06a Compare July 14, 2025 16:22
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 5c7f06a to 8e8bb3c Compare July 14, 2025 17:10
@ThomasK33 ThomasK33 force-pushed the thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance branch from 3dd0c37 to 962c22c Compare July 14, 2025 17:18
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 8e8bb3c to 0393465 Compare July 14, 2025 17:18
@ThomasK33 ThomasK33 changed the base branch from thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance to graphite-base/18825 July 15, 2025 17:24
@ThomasK33 ThomasK33 force-pushed the graphite-base/18825 branch from 962c22c to bed62ad Compare July 15, 2025 17:27
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 0393465 to 643824a Compare July 15, 2025 17:27
@ThomasK33 ThomasK33 changed the base branch from graphite-base/18825 to thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance July 15, 2025 17:27
@ThomasK33 ThomasK33 requested a review from dannykopping July 17, 2025 13:30
Change-Id: I07e7c229efa6e92282885464d2193dfc4c2e1c98
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the thomask33/07-10-feat_add_cleanup_for_expired_oauth2_provider_app_codes_and_tokens branch from 643824a to f2c16b5 Compare July 17, 2025 14:38
@ThomasK33 ThomasK33 force-pushed the thomask33/07-08-feat_replace_callback_url_with_redirect_uris_for_oauth2_rfc_6749_compliance branch from bed62ad to 4fb1c39 Compare July 17, 2025 14:38
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