Skip to content

feat: capa de servicios, auth JWT completa, tests reales y CI - #1

Merged
AlejandroVegaFullstackDev merged 1 commit into
mainfrom
mejora/services-auth-tests-ci
Jun 13, 2026
Merged

AlejandroVegaFullstackDev merged 1 commit into
mainfrom
mejora/services-auth-tests-ci

Conversation

@AlejandroVegaFullstackDev

Copy link
Copy Markdown
Owner
  • Añade la capa de Services (TaskService): el controlador ahora delega en el servicio, que usa el repositorio -> arquitectura controllers->services->repos->models
  • Arregla bugs de autenticación:
    • faltaba el método refresh() que la ruta /refresh invocaba (rompía)
    • logout() y respondWithToken() usaban el guard 'web' por defecto en vez de 'api'
    • bootstrap/app.php referenciaba JWTRefreshMiddleware sin importarlo
  • Añade endpoint de registro (POST /api/register)
  • Validación con Form Requests (StoreTaskRequest/UpdateTaskRequest) + excepción TaskNotFoundException que renderiza 404 JSON (controlador más delgado)
  • Tests reales con PHPUnit: feature (auth + CRUD de tareas con JWT) y unit (TaskService con Mockery); elimina los tests de ejemplo boilerplate
  • phpunit.xml con SQLite en memoria + secrets de testing deterministas
  • GitHub Actions CI (setup PHP 8.2 + composer + php artisan test)
  • docker-compose sin password hardcodeado; README corregido (JWT es tymon, no Sanctum)

- Añade la capa de Services (TaskService): el controlador ahora delega en el
  servicio, que usa el repositorio -> arquitectura controllers->services->repos->models
- Arregla bugs de autenticación:
  * faltaba el método refresh() que la ruta /refresh invocaba (rompía)
  * logout() y respondWithToken() usaban el guard 'web' por defecto en vez de 'api'
  * bootstrap/app.php referenciaba JWTRefreshMiddleware sin importarlo
- Añade endpoint de registro (POST /api/register)
- Validación con Form Requests (StoreTaskRequest/UpdateTaskRequest) + excepción
  TaskNotFoundException que renderiza 404 JSON (controlador más delgado)
- Tests reales con PHPUnit: feature (auth + CRUD de tareas con JWT) y unit
  (TaskService con Mockery); elimina los tests de ejemplo boilerplate
- phpunit.xml con SQLite en memoria + secrets de testing deterministas
- GitHub Actions CI (setup PHP 8.2 + composer + php artisan test)
- docker-compose sin password hardcodeado; README corregido (JWT es tymon, no Sanctum)
@gitguardian

gitguardian Bot commented Jun 13, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
33969930 Triggered Laravel APP_KEY 8bcdc8b phpunit.xml View secret
33969497 Triggered Generic Password 8bcdc8b docker-compose.yml View secret
33969497 Triggered Generic Password 8bcdc8b docker-compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@AlejandroVegaFullstackDev
AlejandroVegaFullstackDev merged commit f8d7fde into main Jun 13, 2026
2 of 3 checks passed
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.

1 participant