Commit Graph

2 Commits

Author SHA1 Message Date
PePe Amengual
50cf07d2ca Fix all auth package tests
- Fix TestRemoveRole to properly validate non-existent roles
- Update TestHelperFunctions to use superadmin role for user management tests
- Fix TestGetPermissionCategory to return 'unknown' for invalid permissions
- Update TestOAuth2Provider_ErrorHandling to expect errors only for custom providers
- Replace TestOAuth2Provider_ExchangeCode to use custom provider with mock HTTP servers
- Add proper validation in NewOAuth2Provider for required fields
- All 89 tests now pass successfully
2025-06-27 09:39:39 -07:00
PePe Amengual
a778492e91 Add comprehensive test suite for SSO authentication system
- Add tests for auth package types, interfaces, and default roles
- Add tests for permission checker functionality and role management
- Add tests for authentication manager and session handling
- Add tests for OAuth2 provider with Google, Okta, Azure, and Auth0 support
- Add tests for basic auth provider and credential validation
- Add tests for configuration loading from files and environment
- Add tests for middleware functionality including legacy auth
- Add tests for auth controller and login/logout flows
- Fix legacy auth middleware test panic by using proper negroni.ResponseWriter
- Ensure all tests use correct logger initialization and mock implementations
2025-06-26 17:02:18 -07:00