Add cleanup for rotated OAuth token records
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- csharp
- Ambito
- authentication, databases
Direzione di ricerca
Start by tracing the OAuth authorization-code exchange, refresh, grant revocation, and grants UI paths mentioned in the issue; identify where token documents are created, disabled, queried, and deleted. Then review the existing tests around those flows before deciding how cleanup preserves replay detection and grant-family behavior. Done means expired disabled records are cleaned up safely, frequent refreshes do not accumulate unbounded records, and focused rotation/cleanup tests pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
OAuth refresh token rotation currently creates a new OAuthToken document on every successful refresh. The previous token is disabled, but it remains in the oauth-tokens index. I did not find a cleanup path for expired or disabled OAuth token documents except deleting all tokens for a user.
This means active OAuth grants can grow the oauth-tokens index indefinitely over time. It also makes grant-family operations more fragile because revocation currently pages grant-family tokens with a fixed limit.
Current behavior
- Authorization code exchange creates an
OAuthTokendocument. - Refresh finds the token by
RefreshTokenHash. - The spent token is disabled.
- A new
OAuthTokendocument is created with the sameGrantId. - Disabled/spent token documents are retained indefinitely unless the user is deleted or all user tokens are removed.
Desired outcome
Add cleanup or compaction so rotated OAuth token records do not grow forever.
A reasonable policy would be:
- Keep the active token for each grant.
- Remove disabled/spent OAuth token records once they are no longer needed.
- If spent refresh-token hashes are retained for replay detection, only keep them until the relevant refresh-token expiry plus a small safety window.
- Ensure grant revocation and the user's OAuth grants UI continue to work correctly even after old rotated rows are cleaned up.
Notes
Once a token has been refreshed, the old access token is no longer useful. The only possible reason to retain the old row is refresh-token replay detection because the old row may still contain the spent refresh-token hash. If we want that protection, retention should be bounded by RefreshExpiresUtc, not indefinite.
Acceptance criteria
- Expired disabled OAuth token documents are cleaned up or compacted automatically.
- Cleanup is safe for refresh-token replay detection, or the product explicitly accepts not retaining spent refresh-token hashes.
- A grant that refreshes frequently does not accumulate unbounded token documents.
- Grant-family revocation remains reliable even for long-lived/high-refresh grants.
- Add focused tests for refresh rotation plus cleanup behavior.
- Lingua principale
- C#
- Stelle
- 2.5k
- Fork
- 508
- Merge medio
- 2g 17h
- PR unite (30g)
- 40
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di exceptionless/Exceptionless
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
exceptionless/Exceptionless#2707 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
exceptionless/Exceptionless#2706 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
exceptionless/Exceptionless#2705 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
exceptionless/Exceptionless#2704 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
exceptionless/Exceptionless#2703 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di exceptionless/Exceptionless
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 89/100
getsentry/sentry-dotnet#5833 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: core priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
RicoSuter/Namotion.Interceptor#863 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bitfoundation/bitplatform#14428 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno