Add cleanup for rotated OAuth token records
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- csharp
- Área
- authentication, databases
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 2.5k
- Forks
- 508
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 40
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de exceptionless/Exceptionless
-
bug documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
exceptionless/Exceptionless#2707 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
exceptionless/Exceptionless#2706 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
exceptionless/Exceptionless#2705 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
exceptionless/Exceptionless#2704 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
exceptionless/Exceptionless#2703 ·
Los mantenedores suelen responder en 1 día
Todos los issues de exceptionless/Exceptionless
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentAbiertobug 優先: 低
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
.NET area: storage bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Larson-Logan/medal-sync#61 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día