File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -455,6 +455,8 @@ def parse_section(section):
455455 r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).{8,}$"
456456 )
457457
458+ PASSWORD_VALIDATION_HINT = os .environ .get ("PASSWORD_VALIDATION_HINT" , "" )
459+
458460
459461BYPASS_MODEL_ACCESS_CONTROL = (
460462 os .environ .get ("BYPASS_MODEL_ACCESS_CONTROL" , "False" ).lower () == "true"
Original file line number Diff line number Diff line change @@ -813,6 +813,8 @@ async def signup(
813813 }
814814 else :
815815 raise HTTPException (500 , detail = ERROR_MESSAGES .CREATE_USER_ERROR )
816+ except HTTPException :
817+ raise
816818 except Exception as err :
817819 log .error (f"Signup error: { str (err )} " )
818820 raise HTTPException (500 , detail = "An internal error occurred during signup." )
@@ -954,6 +956,8 @@ async def add_user(
954956 }
955957 else :
956958 raise HTTPException (500 , detail = ERROR_MESSAGES .CREATE_USER_ERROR )
959+ except HTTPException :
960+ raise
957961 except Exception as err :
958962 log .error (f"Add user error: { str (err )} " )
959963 raise HTTPException (
Original file line number Diff line number Diff line change 3333 ENABLE_PASSWORD_VALIDATION ,
3434 OFFLINE_MODE ,
3535 LICENSE_BLOB ,
36+ PASSWORD_VALIDATION_HINT ,
3637 PASSWORD_VALIDATION_REGEX_PATTERN ,
3738 REDIS_KEY_PREFIX ,
3839 pk ,
@@ -173,7 +174,7 @@ def validate_password(password: str) -> bool:
173174
174175 if ENABLE_PASSWORD_VALIDATION :
175176 if not PASSWORD_VALIDATION_REGEX_PATTERN .match (password ):
176- raise Exception (ERROR_MESSAGES .INVALID_PASSWORD ())
177+ raise Exception (ERROR_MESSAGES .INVALID_PASSWORD (PASSWORD_VALIDATION_HINT ))
177178
178179 return True
179180
You can’t perform that action at this time.
0 commit comments