You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
* added password hashing and updated unit tests.
* Fixed Integrationtests
* changed plain text passwords to hashed versions
* added salt to pws in PrepareDataBase
* updated date of last change and url to blog
@@ -96,15 +98,12 @@ public UserEntity registerNewUser(UserRegisterForm newUser) {
96
98
if (!stringIsValid(password) || !stringIsValid(confirmationPassword))
97
99
thrownewUserNotRegisteredException("Wanted to change password, but password was not valid.");
98
100
99
-
if (!passwordIsValid(password))
100
-
thrownewUserNotRegisteredException("Password needs to be at least 8 characters long and, contains at least one uppercase and lowercase letter and a number.");
101
+
if (!inputSanitizerService.passwordIsValid(password))
102
+
thrownewUserNotRegisteredException("Password needs to be a valid SHA-265 hash.");
101
103
102
104
if (!password.contentEquals(confirmationPassword))
103
105
thrownewUserNotRegisteredException("Passwords do not match.");
104
106
105
-
if (password.toLowerCase().contains(username.toLowerCase()))
106
-
thrownewUserNotRegisteredException("Username must not appear in password.");
107
-
108
107
//check groups
109
108
long[] userGroups = newUser.getGroupIds();
110
109
if (null == userGroups)
@@ -121,25 +120,20 @@ public UserEntity registerNewUser(UserRegisterForm newUser) {
if (!stringIsValid(password) || !stringIsValid(confirmationPassword))
212
203
thrownewUserNotUpdatedException("Wanted to change password, but password was not valid.");
213
204
214
-
if (!passwordIsValid(password))
215
-
thrownewUserNotUpdatedException("Password needs to be at least 8 characters long and, contains at least one uppercase and lowercase letter and a number.");
205
+
if (!inputSanitizerService.passwordIsValid(password))
206
+
thrownewUserNotUpdatedException("Password needs to be a valid SHA-256 hash.");
216
207
217
208
if (!password.contentEquals(confirmationPassword))
218
209
thrownewUserNotUpdatedException("Passwords do not match.");
219
210
220
-
if (password.toLowerCase().contains(lowercaseUserName))
221
-
thrownewUserNotUpdatedException("Username must not appear in password.");
0 commit comments