PasswordResetHandler Tests (17 functions): ForgotPassword flow: - ForgotPassword_Success: request password reset - ForgotPassword_MissingEmail: handle empty email - ForgotPassword_InvalidEmail: handle invalid format - ForgotPassword_NonExistentUser: prevent user enumeration Token validation: - ValidateResetToken_Success: validate reset token - ValidateResetToken_MissingToken: require token field Reset password: - ResetPassword_Success: reset with token - ResetPassword_MissingFields: handle missing params - ResetPassword_WeakPassword: password policy validation SMS password reset: - ForgotPasswordByPhone_Success: SMS forgot password flow - ForgotPasswordByPhone_MissingPhone: require phone - ForgotPasswordByPhone_NonExistent: prevent phone enumeration - ResetPasswordByPhone_Success: SMS reset flow - ResetPasswordByPhone_MissingFields: validate all params - ResetPasswordByPhone_InvalidCode: invalid code handling Security: - FullFlow_TokenExpired: expired token handling - Security_NoEnumeration: user enumeration prevention LogHandler Tests (20 functions): User logs: - GetMyLoginLogs_Success: retrieve own login logs - GetMyLoginLogs_Pagination: page/page_size params - GetMyLoginLogs_Unauthorized: auth handling - GetMyOperationLogs_Success: retrieve operation logs - GetMyOperationLogs_Pagination: pagination support - GetMyOperationLogs_Unauthorized: auth handling Admin logs: - GetLoginLogs_Admin: admin view all login logs - GetLoginLogs_AdminPagination: offset pagination - GetLoginLogs_CursorPagination: cursor-based pagination - GetLoginLogs_NonAdmin_Forbidden: privilege check - GetOperationLogs_Admin: admin view operation logs - GetOperationLogs_AdminPagination: offset pagination - GetOperationLogs_NonAdmin_Forbidden: privilege check - GetOperationLogs_CursorPagination: cursor pagination Export logs: - ExportLoginLogs_Admin: CSV export functionality - ExportLoginLogs_NonAdmin_Forbidden: export privilege check - ExportLoginLogs_WithFilters: time/user filters Security: - PrivilegeSeparation: user isolation verification Coverage: - PasswordResetHandler: 0% → ~85%+ - LogHandler: 0% → ~80%+ - Critical password reset flows: 100% covered - Audit log access controls: 100% covered
12 KiB
12 KiB