Files
user-system/svc_robust.txt

232 lines
11 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
=== RUN TestValidatePasswordStrength_TooShort
--- PASS: TestValidatePasswordStrength_TooShort (0.00s)
=== RUN TestValidatePasswordStrength_OnlyLowercase
--- PASS: TestValidatePasswordStrength_OnlyLowercase (0.00s)
=== RUN TestValidatePasswordStrength_LowerAndDigit
--- PASS: TestValidatePasswordStrength_LowerAndDigit (0.00s)
=== RUN TestValidatePasswordStrength_StrictMode_MissingUpper
--- PASS: TestValidatePasswordStrength_StrictMode_MissingUpper (0.00s)
=== RUN TestValidatePasswordStrength_StrictMode_MissingDigit
--- PASS: TestValidatePasswordStrength_StrictMode_MissingDigit (0.00s)
=== RUN TestValidatePasswordStrength_StrictMode_Valid
--- PASS: TestValidatePasswordStrength_StrictMode_Valid (0.00s)
=== RUN TestValidatePasswordStrength_ExactMinLen
--- PASS: TestValidatePasswordStrength_ExactMinLen (0.00s)
=== RUN TestGetPasswordStrength_Scoring
--- PASS: TestGetPasswordStrength_Scoring (0.00s)
=== RUN TestGetPasswordStrength_WeakPassword
--- PASS: TestGetPasswordStrength_WeakPassword (0.00s)
=== RUN TestRegister_WeakPassword_TooShort
--- PASS: TestRegister_WeakPassword_TooShort (0.00s)
=== RUN TestRegister_WeakPassword_SingleCharType
--- PASS: TestRegister_WeakPassword_SingleCharType (0.00s)
=== RUN TestRegister_StrongPassword_Accepted
--- PASS: TestRegister_StrongPassword_Accepted (0.06s)
=== RUN TestLogin_LockAfterMaxAttempts
--- PASS: TestLogin_LockAfterMaxAttempts (0.26s)
=== RUN TestLogin_SuccessAfterCorrectPassword_ClearsAttempts
--- PASS: TestLogin_SuccessAfterCorrectPassword_ClearsAttempts (0.26s)
=== RUN TestLogin_ByEmail
--- PASS: TestLogin_ByEmail (0.13s)
=== RUN TestLogin_ByPhone
--- PASS: TestLogin_ByPhone (0.13s)
=== RUN TestRefreshToken_Success
--- PASS: TestRefreshToken_Success (0.13s)
=== RUN TestRefreshToken_InvalidToken
--- PASS: TestRefreshToken_InvalidToken (0.00s)
=== RUN TestLogout_BlacklistsToken
--- PASS: TestLogout_BlacklistsToken (0.13s)
=== RUN TestIsTokenBlacklisted_EmptyJTI
--- PASS: TestIsTokenBlacklisted_EmptyJTI (0.00s)
=== RUN TestGetUserInfo_Success
--- PASS: TestGetUserInfo_Success (0.06s)
=== RUN TestGetUserInfo_NotFound
--- PASS: TestGetUserInfo_NotFound (0.00s)
=== RUN TestRobust_Password_ExactMinLength
--- PASS: TestRobust_Password_ExactMinLength (0.00s)
=== RUN TestRobust_Password_OneBelowMinLength
--- PASS: TestRobust_Password_OneBelowMinLength (0.00s)
=== RUN TestRobust_Password_MaxReasonableLength
--- PASS: TestRobust_Password_MaxReasonableLength (0.00s)
=== RUN TestRobust_Password_UnicodeCharacters
--- PASS: TestRobust_Password_UnicodeCharacters (0.00s)
=== RUN TestRobust_Password_AllSpecialChars
--- PASS: TestRobust_Password_AllSpecialChars (0.00s)
=== RUN TestRobust_Password_SpecialPlusDigit
--- PASS: TestRobust_Password_SpecialPlusDigit (0.00s)
=== RUN TestRobust_Password_EmptyString
--- PASS: TestRobust_Password_EmptyString (0.00s)
=== RUN TestRobust_Password_WhitespaceOnly
--- PASS: TestRobust_Password_WhitespaceOnly (0.00s)
=== RUN TestRobust_Register_EmptyUsername
--- PASS: TestRobust_Register_EmptyUsername (0.07s)
=== RUN TestRobust_Register_VeryLongUsername
--- PASS: TestRobust_Register_VeryLongUsername (0.06s)
=== RUN TestRobust_Register_SQLInjectionInUsername
--- PASS: TestRobust_Register_SQLInjectionInUsername (0.06s)
=== RUN TestRobust_Register_XSSInNickname
--- PASS: TestRobust_Register_XSSInNickname (0.06s)
=== RUN TestRobust_Register_InvalidEmailFormats
--- PASS: TestRobust_Register_InvalidEmailFormats (0.33s)
=== RUN TestRobust_Login_EmptyAccount
--- PASS: TestRobust_Login_EmptyAccount (0.00s)
=== RUN TestRobust_Login_EmptyPassword
--- PASS: TestRobust_Login_EmptyPassword (0.13s)
=== RUN TestRobust_Login_NullByteInInput
--- PASS: TestRobust_Login_NullByteInInput (0.00s)
=== RUN TestRobust_Login_VeryLongInput
--- PASS: TestRobust_Login_VeryLongInput (0.00s)
=== RUN TestRobust_Login_DisabledUser
--- PASS: TestRobust_Login_DisabledUser (0.06s)
=== RUN TestRobust_Login_LockedUser
--- PASS: TestRobust_Login_LockedUser (0.06s)
=== RUN TestRobust_Login_InactiveUser
--- PASS: TestRobust_Login_InactiveUser (0.07s)
=== RUN TestRobust_Login_LockCounterResetsAfterSuccess
--- PASS: TestRobust_Login_LockCounterResetsAfterSuccess (0.64s)
=== RUN TestRobust_ValidateToken_Tampered
--- PASS: TestRobust_ValidateToken_Tampered (0.00s)
=== RUN TestRobust_ValidateToken_EmptyString
--- PASS: TestRobust_ValidateToken_EmptyString (0.00s)
=== RUN TestRobust_ValidateToken_WrongSecret
--- PASS: TestRobust_ValidateToken_WrongSecret (0.00s)
=== RUN TestRobust_ValidateToken_RefreshTokenUsedAsAccess
--- PASS: TestRobust_ValidateToken_RefreshTokenUsedAsAccess (0.00s)
=== RUN TestRobust_RefreshToken_WithExpiredToken
--- PASS: TestRobust_RefreshToken_WithExpiredToken (0.01s)
=== RUN TestRobust_ConcurrentRegister_UniqueUsernames
--- PASS: TestRobust_ConcurrentRegister_UniqueUsernames (0.26s)
=== RUN TestRobust_ConcurrentLogin_SameUser
--- PASS: TestRobust_ConcurrentLogin_SameUser (0.21s)
=== RUN TestRobust_ConcurrentRegister_DuplicateUsername
auth_robustness_test.go:438: 并发重复用户名注册16 次成功mock 无锁,真实 DB 应为 1
--- PASS: TestRobust_ConcurrentRegister_DuplicateUsername (0.10s)
=== RUN TestRobust_Logout_Idempotent
--- PASS: TestRobust_Logout_Idempotent (0.13s)
=== RUN TestRobust_Logout_NilRequest
--- PASS: TestRobust_Logout_NilRequest (0.00s)
=== RUN TestRobust_IsTokenBlacklisted_EmptyJTI
--- PASS: TestRobust_IsTokenBlacklisted_EmptyJTI (0.00s)
=== RUN TestRobust_GetPasswordStrength_EmptyInput
--- PASS: TestRobust_GetPasswordStrength_EmptyInput (0.00s)
=== RUN TestRobust_GetPasswordStrength_AllTypes
--- PASS: TestRobust_GetPasswordStrength_AllTypes (0.00s)
=== RUN TestRobust_GetPasswordStrength_MaxLengthInput
--- PASS: TestRobust_GetPasswordStrength_MaxLengthInput (0.00s)
=== RUN TestRegister_Success
--- PASS: TestRegister_Success (0.07s)
=== RUN TestRegister_DuplicateUsername
--- PASS: TestRegister_DuplicateUsername (0.06s)
=== RUN TestRegister_DuplicateEmail
--- PASS: TestRegister_DuplicateEmail (0.06s)
=== RUN TestLogin_Success
--- PASS: TestLogin_Success (0.13s)
=== RUN TestLogin_WrongPassword
--- PASS: TestLogin_WrongPassword (0.13s)
=== RUN TestLogin_UserNotFound
--- PASS: TestLogin_UserNotFound (0.00s)
=== RUN TestLogin_DisabledUser
--- PASS: TestLogin_DisabledUser (0.06s)
=== RUN TestCaptchaService_Generate
--- PASS: TestCaptchaService_Generate (0.00s)
=== RUN TestCaptchaService_Verify_WrongAnswer
--- PASS: TestCaptchaService_Verify_WrongAnswer (0.00s)
=== RUN TestCaptchaService_Verify_EmptyInputs
--- PASS: TestCaptchaService_Verify_EmptyInputs (0.00s)
=== RUN TestCaptchaService_ValidateCaptcha_EmptyID
--- PASS: TestCaptchaService_ValidateCaptcha_EmptyID (0.00s)
=== RUN TestCaptchaService_Generate_UniqueIDs
--- PASS: TestCaptchaService_Generate_UniqueIDs (0.01s)
=== RUN TestDeviceService_CreateAndList
--- PASS: TestDeviceService_CreateAndList (0.01s)
=== RUN TestDeviceService_DeleteDevice
--- PASS: TestDeviceService_DeleteDevice (0.00s)
=== RUN TestDeviceService_UpdateDeviceStatus
--- PASS: TestDeviceService_UpdateDeviceStatus (0.00s)
=== RUN TestLoginLogService_RecordAndList
--- PASS: TestLoginLogService_RecordAndList (0.00s)
=== RUN TestLoginLogService_RecordFailedLogin
--- PASS: TestLoginLogService_RecordFailedLogin (0.00s)
=== RUN TestOperationLogService_RecordAndList
--- PASS: TestOperationLogService_RecordAndList (0.00s)
=== RUN TestPermissionService_CreateAndList
--- PASS: TestPermissionService_CreateAndList (0.00s)
=== RUN TestPermissionService_DuplicateCode
--- PASS: TestPermissionService_DuplicateCode (0.00s)
=== RUN TestPermissionService_GetAndUpdate
--- PASS: TestPermissionService_GetAndUpdate (0.00s)
=== RUN TestPermissionService_Delete
--- PASS: TestPermissionService_Delete (0.00s)
=== RUN TestRoleService_CreateAndGet
--- PASS: TestRoleService_CreateAndGet (0.00s)
=== RUN TestRoleService_DuplicateCode
--- PASS: TestRoleService_DuplicateCode (0.00s)
=== RUN TestRoleService_ListRoles
--- PASS: TestRoleService_ListRoles (0.00s)
=== RUN TestRoleService_UpdateRole
--- PASS: TestRoleService_UpdateRole (0.00s)
=== RUN TestRoleService_DeleteRole
--- PASS: TestRoleService_DeleteRole (0.00s)
=== RUN TestTOTPManager_GenerateSecret
--- PASS: TestTOTPManager_GenerateSecret (0.01s)
=== RUN TestTOTPManager_Verify_ValidCode
--- PASS: TestTOTPManager_Verify_ValidCode (0.01s)
=== RUN TestTOTPManager_Verify_InvalidCode
--- PASS: TestTOTPManager_Verify_InvalidCode (0.01s)
=== RUN TestTOTPService_GetTOTPStatus_Disabled
--- PASS: TestTOTPService_GetTOTPStatus_Disabled (0.00s)
=== RUN TestTOTPService_GetTOTPStatus_Enabled
--- PASS: TestTOTPService_GetTOTPStatus_Enabled (0.00s)
=== RUN TestTOTPManager_RecoveryCodesFormat
--- PASS: TestTOTPManager_RecoveryCodesFormat (0.01s)
=== RUN TestValidateRecoveryCode
--- PASS: TestValidateRecoveryCode (0.00s)
=== RUN TestUserRepo_GetUser_NotFound
--- PASS: TestUserRepo_GetUser_NotFound (0.00s)
=== RUN TestUserRepo_EmailConflictDetection
--- PASS: TestUserRepo_EmailConflictDetection (0.00s)
=== RUN TestUserRepo_DeleteUser
--- PASS: TestUserRepo_DeleteUser (0.00s)
=== RUN TestUserRepo_UpdateStatus
--- PASS: TestUserRepo_UpdateStatus (0.00s)
=== RUN TestUserRepo_List_Pagination
--- PASS: TestUserRepo_List_Pagination (0.00s)
=== RUN TestUserRepo_ListByStatus
--- PASS: TestUserRepo_ListByStatus (0.00s)
=== RUN TestUserService_GetUser_NotFound
--- PASS: TestUserService_GetUser_NotFound (0.00s)
=== RUN TestUserService_UpdateUser_Nickname
--- PASS: TestUserService_UpdateUser_Nickname (0.07s)
=== RUN TestUserService_UpdateUser_EmailConflict
--- PASS: TestUserService_UpdateUser_EmailConflict (0.07s)
=== RUN TestUserService_UpdateUser_Birthday
--- PASS: TestUserService_UpdateUser_Birthday (0.07s)
=== RUN TestUserService_UpdatePassword_Success
--- PASS: TestUserService_UpdatePassword_Success (0.32s)
=== RUN TestUserService_UpdatePassword_WrongOld
--- PASS: TestUserService_UpdatePassword_WrongOld (0.13s)
=== RUN TestUserService_UpdatePassword_SameAsOld
--- PASS: TestUserService_UpdatePassword_SameAsOld (0.20s)
=== RUN TestUserService_UpdatePassword_WeakNew
--- PASS: TestUserService_UpdatePassword_WeakNew (0.13s)
=== RUN TestUserService_ListUsers_All
--- PASS: TestUserService_ListUsers_All (0.07s)
=== RUN TestUserService_ListUsers_Pagination
--- PASS: TestUserService_ListUsers_Pagination (0.07s)
=== RUN TestUserService_ListUsers_FilterByStatus
--- PASS: TestUserService_ListUsers_FilterByStatus (0.07s)
=== RUN TestUserService_UpdateUserStatus
--- PASS: TestUserService_UpdateUserStatus (0.07s)
=== RUN TestWebhookService_CreateAndList
--- PASS: TestWebhookService_CreateAndList (0.00s)
=== RUN TestWebhookService_Update
--- PASS: TestWebhookService_Update (0.00s)
=== RUN TestWebhookService_Delete
--- PASS: TestWebhookService_Delete (0.00s)
=== RUN TestWebhookService_Publish_DeliveryRecord
--- PASS: TestWebhookService_Publish_DeliveryRecord (0.00s)
=== RUN TestWebhookSubscribesTo
--- PASS: TestWebhookSubscribesTo (0.00s)
PASS
ok github.com/user-management-system/internal/service 5.528s