Conversation
There was a problem hiding this comment.
Pull request overview
Este PR amplía user/v1 agregando endpoints para eliminar un usuario y rotar su token, y mueve la detección de tokens sin hash a un chequeo en el arranque para avisar sobre usuarios antiguos que podrían perder acceso.
Changes:
- Nuevo
DELETE /user/v1/para eliminar el usuario autenticado. - Nuevo
POST /user/v1/tokenpara rotar el token (persistiendo el hash en DB y devolviendo el token plano nuevo). - Chequeo en startup que avisa si existen usuarios con tokens no hasheados; pequeños ajustes de naming/descripciones en endpoints de document.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/init.ts | Agrega initUnhashedTokenCheck() y logging de advertencia si hay tokens no hasheados. |
| src/index.ts | Ejecuta el nuevo chequeo de tokens no hasheados durante el arranque. |
| src/endpoints/user/v1/rotateToken.ts | Implementa endpoint para rotación de token de usuario autenticado. |
| src/endpoints/user/v1/drop.ts | Implementa endpoint para eliminar el usuario autenticado. |
| src/endpoints/user/v1/index.ts | Registra los nuevos handlers drop y rotateToken en user/v1. |
| src/endpoints/document/v1/index.ts | Ajusta el registro del endpoint delete (ahora drop). |
| src/endpoints/document/v1/drop.ts | Ajusta summary/description del endpoint de borrado de documento. |
| src/endpoints/document/v1/get.ts | Ajusta wording de la descripción del endpoint. |
| src/endpoints/document/v1/patch.ts | Ajusta wording de la descripción del endpoint. |
| src/database/migration.ts | Elimina el warning de tokens “plain/unhashed” del proceso de migración. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Se ha extendido la funcionalidad de user/v1 , ahora se puede eliminar el usuario y rotar el token.