diff --git a/helpmehelpapplication/helpmehelpapplication.iml b/helpmehelpapplication/helpmehelpapplication.iml new file mode 100644 index 0000000..9e3449c --- /dev/null +++ b/helpmehelpapplication/helpmehelpapplication.iml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java index 16e44cb..c72fbee 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.java @@ -1,5 +1,7 @@ package ntnu.sytemutvikling.team6.models; +import ntnu.sytemutvikling.team6.models.user.User; + import java.time.LocalDateTime; import java.util.UUID; diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java index 2a0657e..4825c95 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java @@ -1,5 +1,7 @@ package ntnu.sytemutvikling.team6.models; +import ntnu.sytemutvikling.team6.models.user.User; + import java.time.LocalDateTime; import java.util.UUID; diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/User.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/User.java deleted file mode 100644 index 283bfa1..0000000 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/User.java +++ /dev/null @@ -1,92 +0,0 @@ -package ntnu.sytemutvikling.team6.models; - -import java.util.UUID; - -// Passord må hashes!!! -// Unntakshåndtering mangler -// Enhetstesting mangler - -/** - * Represents a user. - * - * @author Robin Strand Prestmo - */ -public class User { - private final UUID id; - private String name; - private String email; - private String password; - private final String role; - private final Settings settings; - private final Inbox inbox; - - /** - * Creates a new user - * - * @param id gives the user a unique identifier with UUID - * @param name the name of the user - * @param email the email of the user - * @param password the password for the user - * @param role users role - * @param settings the user´s settings - * @param inbox the user´s inbox - * - */ - public User(UUID id, - String name, - String email, - String password, - String role, - Settings settings, - Inbox inbox) { - - this.id = id; - this.name = name; - this.email = email; - this.password = password; - this.role = role; - this.settings = settings; - this.inbox = inbox; - } - - // Add Getters - - public UUID getId() { - return id; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - public String getRole() { - return role; - } - - public Settings getSettings() { - return settings; - } - - public Inbox getInbox() { - return inbox; - } - - // Add Setters - - - public void setName(String name) { - this.name = name; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setEmail(String email) { - this.email = email; - } -} diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Inbox.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Inbox.java similarity index 97% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Inbox.java rename to helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Inbox.java index 00c8f52..2aa0605 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Inbox.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Inbox.java @@ -1,4 +1,4 @@ -package ntnu.sytemutvikling.team6.models; +package ntnu.sytemutvikling.team6.models.user; import java.util.*; diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Language.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Language.java similarity index 70% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Language.java rename to helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Language.java index d4ab0ae..0afb14c 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Language.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Language.java @@ -1,4 +1,4 @@ -package ntnu.sytemutvikling.team6.models; +package ntnu.sytemutvikling.team6.models.user; /** * Supported application languages. diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Message.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Message.java similarity index 97% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Message.java rename to helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Message.java index 10ea569..eba920f 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Message.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Message.java @@ -1,4 +1,4 @@ -package ntnu.sytemutvikling.team6.models; +package ntnu.sytemutvikling.team6.models.user; import java.time.LocalDateTime; import java.util.UUID; diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Role.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Role.java similarity index 70% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Role.java rename to helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Role.java index cde9117..74e134f 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Role.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Role.java @@ -1,4 +1,4 @@ -package ntnu.sytemutvikling.team6.models; +package ntnu.sytemutvikling.team6.models.user; /** * Available users diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Settings.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Settings.java similarity index 97% rename from helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Settings.java rename to helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Settings.java index cd70f0a..6bbc685 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Settings.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/Settings.java @@ -1,4 +1,4 @@ -package ntnu.sytemutvikling.team6.models; +package ntnu.sytemutvikling.team6.models.user; // Mangler Enhetstesting diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/User.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/User.java new file mode 100644 index 0000000..28c5934 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/user/User.java @@ -0,0 +1,128 @@ +package ntnu.sytemutvikling.team6.models.user; + +import ntnu.sytemutvikling.team6.security.PasswordHasher; + +import java.util.UUID; + +// TODO: Enhetstesting mangler + +/** + * Represents a user. + * + * @author Robin Strand Prestmo + */ +public class User { + private static final PasswordHasher passwordHasher = new PasswordHasher(); + + private final UUID id; + private String name; + private String email; + private String passwordHash; + private final Role role; + private final Settings settings; + private final Inbox inbox; + + /** + * Creates a new user + * + * @param id gives the user a unique identifier with UUID + * @param name the name of the user + * @param email the email of the user + * @param password the password for the user + * @param role users role + * @param settings the user´s settings + * @param inbox the user´s inbox + * + */ + public User(UUID id, + String name, + String email, + String password, + Role role, + Settings settings, + Inbox inbox) { + if (id == null) { + throw new IllegalArgumentException("ID cannot be null."); + } + + if (name == null || name.isBlank()) { + throw new IllegalArgumentException("Name cannot be null or blank."); + } + + if (email == null || email.isBlank() || !email.contains("@") || !email.contains(".")) { + throw new IllegalArgumentException("Email cannot be null or blank, and must contain '@' and '.'"); + } + + if (role == null) { + throw new IllegalArgumentException("Role cannot be null"); + } + + if (settings == null) { + throw new IllegalArgumentException("Settings cannot be null"); + } + + if (inbox == null) { + throw new IllegalArgumentException("Inbox cannot be null"); + } + + this.id = id; + this.name = name; + this.email = email; + this.passwordHash = passwordHasher.getHashPassword(password); + this.role = role; + this.settings = settings; + this.inbox = inbox; + } + + // Add Getters + + public UUID getId() { + return id; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + public Role getRole() { + return role; + } + + public Settings getSettings() { + return settings; + } + + public Inbox getInbox() { + return inbox; + } + + // Add Setters + + public void setName(String name) { + if (name == null || name.isBlank()) { + throw new IllegalArgumentException("Name cannot be null or blank."); + } + this.name = name; + } + + public void setPassword(String password) { + this.passwordHash = passwordHasher.getHashPassword(password); + } + + public void setEmail(String email) { + if (email == null || email.isBlank() || !email.contains("@") || !email.contains(".")) { + throw new IllegalArgumentException("Email cannot be null or blank, and must contains '@' and '.'"); + } + this.email = email; + } + + // Other methods + + public boolean checkPassword(String password) { + return passwordHasher.isValidPassword(password, passwordHash); + } +} \ No newline at end of file diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/security/PasswordHasher.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/security/PasswordHasher.java new file mode 100644 index 0000000..60b2876 --- /dev/null +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/security/PasswordHasher.java @@ -0,0 +1,93 @@ +package ntnu.sytemutvikling.team6.security; + +import java.security.MessageDigest; +import java.security.SecureRandom; +import java.util.Base64; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.PBEKeySpec; + +/** + * A utility for hashing and verifying passwords using PBKDF2. + * + *

The generated hash contains both a random salt and the hashed password, + * encoded as Base64 string. + *

+ * + * @author Robin Strand Prestmo + */ +public final class PasswordHasher { + private static final SecureRandom RNG = new SecureRandom(); + + /** + * Hashes a password using PBKDF2 and a random salt. + * + * @param password the password to hash. + * @return a Base64 string containing the salt and the hashed password. + * @throws IllegalArgumentException if the password is null or blank. + */ + public String getHashPassword(String password) { + if (password == null || password.isBlank()) { + throw new IllegalArgumentException("Password cannot be null or blank."); + } + + String hashPass = ""; + + try { + // 1. Create salt + byte[] salt = new byte[16]; + RNG.nextBytes(salt); + + // 2. Create PBKDF2 Hash value + PBEKeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 100000, 32 * 8); + SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256"); + byte[] hash = factory.generateSecret(spec).getEncoded(); + + // 3. Combine salt and password bytes + byte[] hashBytes = new byte[48]; + System.arraycopy(salt, 0, hashBytes, 0, 16); + System.arraycopy(hash, 0, hashBytes, 16, 32); + + // 4. Turn the combined salt+hash into a string. + hashPass = Base64.getEncoder().encodeToString(hashBytes); + } catch (Exception e) { + throw new RuntimeException("Error while hashing password.", e); + } + return hashPass; + } + + /** + * Checks if the password matches a perviously stored hash. + * + * @param password The password the user types. + * @param hashPass Is the stored hashed password + * @return True if password is valid, otherwise false. + */ + public boolean isValidPassword(String password, String hashPass) { + if (password == null || password.isBlank()) { + return false; + } + + try { + // Extract the bytes + byte[] hashBytes = Base64.getDecoder().decode(hashPass); + + // Get salt + byte[] salt = new byte[16]; + System.arraycopy(hashBytes, 0, salt, 0, 16); + + // Compute the hash on the password the user entered + PBEKeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 100000, 32 * 8); + SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256"); + byte[] hash = factory.generateSecret(spec).getEncoded(); + + // Compare results + byte[] storedHash = new byte[32]; + System.arraycopy(hashBytes, 16, storedHash, 0, 32); + + return MessageDigest.isEqual(storedHash, hash); + + } catch (Exception e) { + throw new RuntimeException("Error while validating password.", e); + } + } +} diff --git a/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/models/user/UserTest.java b/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/models/user/UserTest.java new file mode 100644 index 0000000..5fa92c8 --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/models/user/UserTest.java @@ -0,0 +1,218 @@ +package ntnu.sytemutvikling.team6.models.user; + +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +class UserTest { + + @Nested + class constructorTests { + private final UUID validID = UUID.randomUUID(); + private final String validName = "Name"; + private final String validEmail = "Email@gmail.com"; + private final String validPassword = "Password"; + private final Role validRole = Role.NORMAL_USER; + private final Settings validSettings = new Settings(); + private final Inbox validInbox = new Inbox(); + + @Test + void shouldThrowIfIdIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + null, + validName, + validEmail, + validPassword, + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfNameIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + null, + validEmail, + validPassword, + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfNameIsBlank() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + " ", + validEmail, + validPassword, + validRole, + validSettings, + validInbox + )); + } + + @Nested + class emailTests { + + @Test + void shouldThrowIfEmailIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + null, + validPassword, + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfEmailIsBlank() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + " ", + validPassword, + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfEmailDoesNotContainAt() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + "test.gmail.com", + validPassword, + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfEmailDoesNotContainPeriod() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + "test@gmailcom", + validPassword, + validRole, + validSettings, + validInbox + )); + } + } + + @Test + void shouldThrowIfPasswordIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + validEmail, + null, + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfRoleIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + validEmail, + validPassword, + null, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfPasswordIsBlank() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + validEmail, + " ", + validRole, + validSettings, + validInbox + )); + } + + @Test + void shouldThrowIfSettingsIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + validEmail, + validPassword, + validRole, + null, + validInbox + )); + } + + @Test + void shouldThrowIfInboxIsNull() { + assertThrows(IllegalArgumentException.class, () -> + new User( + validID, + validName, + validEmail, + validPassword, + validRole, + validSettings, + null + )); + } + + @Test + void shouldCreateUser() { + User user = new User( + validID, + validName, + validEmail, + validPassword, + validRole, + validSettings, + validInbox + ); + + assertAll( + () -> assertEquals(validID, user.getId()), + () -> assertEquals(validName, user.getName()), + () -> assertEquals(validEmail, user.getEmail()), + () -> assertEquals(validRole, user.getRole()), + () -> assertEquals(validSettings, user.getSettings()), + () -> assertEquals(validInbox, user.getInbox()) + ); + } + + } +} \ No newline at end of file diff --git a/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/security/PasswordHasherTest.java b/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/security/PasswordHasherTest.java new file mode 100644 index 0000000..68a9409 --- /dev/null +++ b/helpmehelpapplication/src/test/java/ntnu/sytemutvikling/team6/security/PasswordHasherTest.java @@ -0,0 +1,70 @@ +package ntnu.sytemutvikling.team6.security; + +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class PasswordHasherTest { + private final PasswordHasher hasher = new PasswordHasher(); + + @Nested + class getHashPasswordTest { + + @Test + void shouldThrowIfPasswordIsNull() { + assertThrows(IllegalArgumentException.class, () -> hasher.getHashPassword(null)); + } + + @Test + void shouldThrowIfPasswordIsBlank() { + assertThrows(IllegalArgumentException.class, () -> hasher.getHashPassword(" ")); + } + + @Test + void shouldReturnDifferentHashesForSamePasswordBecauseSaltIsRandom() { + String test1 = hasher.getHashPassword("Password"); + String test2 = hasher.getHashPassword("Password"); + + assertNotEquals(test1, test2); + } + } + + @Nested + class isValidPasswordTest { + + @Test + void shouldReturnTrueForCorrectPassword() { + String test = hasher.getHashPassword("Password"); + assertTrue(hasher.isValidPassword("Password", test)); + } + + @Test + void shouldReturnFalseForWrongPassword() { + String test = hasher.getHashPassword("Password"); + assertFalse(hasher.isValidPassword("password", test)); + } + + @Test + void shouldReturnFalseIfPasswordIsBlank() { + String test = hasher.getHashPassword("Test"); + assertFalse(hasher.isValidPassword(" ", test)); + } + + @Test + void shouldReturnFalseIfPasswordIsNull() { + String test = hasher.getHashPassword("Test"); + assertFalse(hasher.isValidPassword(null, test)); + } + + @Test + void shouldThrowIfStoredHashIsNull() { + assertThrows(RuntimeException.class, () -> hasher.isValidPassword("Password", null)); + } + + @Test + void shouldThrowIfStoredHashIsBlank() { + assertThrows(RuntimeException.class, () -> hasher.isValidPassword("Password", " ")); + } + } +} \ No newline at end of file diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/Main.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/Main.class new file mode 100644 index 0000000..110f8b9 Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/Main.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class index 7803742..ef0710b 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class index 61b8503..c923756 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/CharityRegistry.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class index 78d4151..eeddec5 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Donation.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class index 1b81460..4f9d393 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/DonationRegistry.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class index 28853ec..e4b6592 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Inbox.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Inbox.class deleted file mode 100644 index 72613e7..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Inbox.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Language.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Language.class deleted file mode 100644 index de22840..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Language.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Message.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Message.class deleted file mode 100644 index 12c1cec..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Message.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Role.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Role.class deleted file mode 100644 index f19f0d3..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Role.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Settings.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Settings.class deleted file mode 100644 index 9420861..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Settings.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/User.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/User.class deleted file mode 100644 index c0cc6c8..0000000 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/User.class and /dev/null differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class index 970aced..ce901b4 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/UserRegistry.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Inbox.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Inbox.class new file mode 100644 index 0000000..4e08a72 Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Inbox.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Language.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Language.class new file mode 100644 index 0000000..5520821 Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Language.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Message.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Message.class new file mode 100644 index 0000000..e556e51 Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Message.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Role.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Role.class new file mode 100644 index 0000000..8d6c32e Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Role.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Settings.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Settings.class new file mode 100644 index 0000000..26851ad Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/Settings.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/User.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/User.class new file mode 100644 index 0000000..e981ecb Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/user/User.class differ diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/security/PasswordHasher.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/security/PasswordHasher.class new file mode 100644 index 0000000..e454773 Binary files /dev/null and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/security/PasswordHasher.class differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests$emailTests.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests$emailTests.class new file mode 100644 index 0000000..51a8c3c Binary files /dev/null and b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests$emailTests.class differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests.class new file mode 100644 index 0000000..e7def3c Binary files /dev/null and b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest$constructorTests.class differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest.class new file mode 100644 index 0000000..810d4b9 Binary files /dev/null and b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/models/user/UserTest.class differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$getHashPasswordTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$getHashPasswordTest.class new file mode 100644 index 0000000..4047693 Binary files /dev/null and b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$getHashPasswordTest.class differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$isValidPasswordTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$isValidPasswordTest.class new file mode 100644 index 0000000..7d04343 Binary files /dev/null and b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest$isValidPasswordTest.class differ diff --git a/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest.class b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest.class new file mode 100644 index 0000000..93e185d Binary files /dev/null and b/helpmehelpapplication/target/test-classes/ntnu/sytemutvikling/team6/security/PasswordHasherTest.class differ