gohorsejobs/backend/internal/infrastructure/auth
Tiago Yamamoto 052f5169c5 test(auth): add comprehensive auth tests with 98.6% coverage
Backend Tests Added:
- auth_middleware_test.go: 25+ tests for HeaderAuthGuard, OptionalHeaderAuthGuard, RequireRoles, TenantGuard, ExtractRoles, hasRole (100% coverage)
- cors_middleware_test.go: 7 tests for CORS origin validation (100% coverage)
- jwt_service_test.go: expanded with expiration parsing, wrong signing method tests (94.4% coverage)

Features:
- Maximum console.log/fmt.Printf output for debugging
- Tests for JWT from header and cookie fallback
- Tests for role-based access (case-insensitive)
- Tests for tenant enforcement
- Tests for token expiration parsing (7d, 2h, invalid formats)

Total backend auth coverage: 98.6%
2025-12-24 16:20:56 -03:00
..
jwt_service.go feat(auth): add cookie parsing and JWT auth guard to backoffice 2025-12-24 10:27:04 -03:00
jwt_service_test.go test(auth): add comprehensive auth tests with 98.6% coverage 2025-12-24 16:20:56 -03:00