From b04e17cf0ae9ee42e5ccbd9723933a881d8b0624 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 4 Mar 2024 11:52:54 +0200 Subject: [PATCH 01/13] Created Users module, and added FreelancerRegister request and response --- .../requests/FreelancerRegisterRequest.java | 16 ++++++++++++++++ .../responses/FreelancerRegisterResponse.java | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java create mode 100644 services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java diff --git a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java new file mode 100644 index 00000000..b33c01d8 --- /dev/null +++ b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java @@ -0,0 +1,16 @@ +package com.workup.users.requests; +import com.workup.shared.commands.CommandRequest; +import lombok.Builder; +import lombok.NonNull; + +import java.util.Date; + +@Builder +public class FreelancerRegisterRequest extends CommandRequest { + @NonNull String email; + @NonNull String passwordHash; + @NonNull String fullName; + String jobTitle; + String city; + Date birthDate; +} diff --git a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java new file mode 100644 index 00000000..68c4d81e --- /dev/null +++ b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java @@ -0,0 +1,9 @@ +package com.workup.users.responses; + +import com.workup.shared.commands.CommandResponse; +import lombok.NonNull; + +public class FreelancerRegisterResponse extends CommandResponse { + @NonNull boolean success; + String authToken; +} From 0777010098090ac064563ca97018e22b930d82b5 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 4 Mar 2024 15:08:48 +0200 Subject: [PATCH 02/13] Addressed @Ahmad45123's comments and created a test to verify the serialization process. --- .../requests/FreelancerRegisterRequest.java | 16 ---------------- .../responses/FreelancerRegisterResponse.java | 9 --------- .../users/requests/FreelancerLoginRequest.java | 9 +++++++++ 3 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java delete mode 100644 services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java create mode 100644 shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerLoginRequest.java diff --git a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java deleted file mode 100644 index b33c01d8..00000000 --- a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.workup.users.requests; -import com.workup.shared.commands.CommandRequest; -import lombok.Builder; -import lombok.NonNull; - -import java.util.Date; - -@Builder -public class FreelancerRegisterRequest extends CommandRequest { - @NonNull String email; - @NonNull String passwordHash; - @NonNull String fullName; - String jobTitle; - String city; - Date birthDate; -} diff --git a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java deleted file mode 100644 index 68c4d81e..00000000 --- a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.workup.users.responses; - -import com.workup.shared.commands.CommandResponse; -import lombok.NonNull; - -public class FreelancerRegisterResponse extends CommandResponse { - @NonNull boolean success; - String authToken; -} diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerLoginRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerLoginRequest.java new file mode 100644 index 00000000..b278398d --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerLoginRequest.java @@ -0,0 +1,9 @@ +//package com.workup.users.requests; +// +//public class FreelancerLoginRequest { +// String email = ""; +// +// @NonNull +// @Builder.Default +// String passwordHash = ""; +//} From 58cf9f3ac9a157d8a6b0a7aae726b3c73e8e0446 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 4 Mar 2024 11:52:54 +0200 Subject: [PATCH 03/13] Created Users module, and added FreelancerRegister request and response --- .../requests/FreelancerRegisterRequest.java | 16 ++++++++++++++++ .../responses/FreelancerRegisterResponse.java | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java create mode 100644 services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java diff --git a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java new file mode 100644 index 00000000..b33c01d8 --- /dev/null +++ b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java @@ -0,0 +1,16 @@ +package com.workup.users.requests; +import com.workup.shared.commands.CommandRequest; +import lombok.Builder; +import lombok.NonNull; + +import java.util.Date; + +@Builder +public class FreelancerRegisterRequest extends CommandRequest { + @NonNull String email; + @NonNull String passwordHash; + @NonNull String fullName; + String jobTitle; + String city; + Date birthDate; +} diff --git a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java new file mode 100644 index 00000000..68c4d81e --- /dev/null +++ b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java @@ -0,0 +1,9 @@ +package com.workup.users.responses; + +import com.workup.shared.commands.CommandResponse; +import lombok.NonNull; + +public class FreelancerRegisterResponse extends CommandResponse { + @NonNull boolean success; + String authToken; +} From 791fbc72f27092c546e29d075389966bed318e52 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 4 Mar 2024 15:08:48 +0200 Subject: [PATCH 04/13] Addressed @Ahmad45123's comments and created a test to verify the serialization process. --- .../requests/FreelancerRegisterRequest.java | 16 ---------------- .../responses/FreelancerRegisterResponse.java | 9 --------- 2 files changed, 25 deletions(-) delete mode 100644 services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java delete mode 100644 services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java diff --git a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java deleted file mode 100644 index b33c01d8..00000000 --- a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.workup.users.requests; -import com.workup.shared.commands.CommandRequest; -import lombok.Builder; -import lombok.NonNull; - -import java.util.Date; - -@Builder -public class FreelancerRegisterRequest extends CommandRequest { - @NonNull String email; - @NonNull String passwordHash; - @NonNull String fullName; - String jobTitle; - String city; - Date birthDate; -} diff --git a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java deleted file mode 100644 index 68c4d81e..00000000 --- a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.workup.users.responses; - -import com.workup.shared.commands.CommandResponse; -import lombok.NonNull; - -public class FreelancerRegisterResponse extends CommandResponse { - @NonNull boolean success; - String authToken; -} From aad08eb0fa52b66a4f4d4b467341f87f8f986988 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Sun, 28 Apr 2024 20:59:59 +0300 Subject: [PATCH 05/13] Added all required Authentication (register/login) requests and responses Signed-off-by: Akram-Fahim --- .../users/RequestsAndResponsesTest.java | 47 +++++++++++-------- .../users/requests/AuthenticationRequest.java | 12 +++++ .../users/requests/ClientRegisterRequest.java | 19 ++++++++ .../requests/FreelancerRegisterRequest.java | 23 ++++----- .../commands/users/requests/LoginRequest.java | 13 +++++ .../responses/AuthenticationResponse.java | 13 +++++ .../responses/FreelancerRegisterResponse.java | 14 ------ .../users/responses/SignUpAndInResponse.java | 14 ++++++ .../commands/users/responses/UserType.java | 6 +++ 9 files changed, 117 insertions(+), 44 deletions(-) create mode 100644 shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java create mode 100644 shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java create mode 100644 shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java create mode 100644 shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java delete mode 100644 shared/src/main/java/com/workup/shared/commands/users/responses/FreelancerRegisterResponse.java create mode 100644 shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java create mode 100644 shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java diff --git a/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java b/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java index f005e3a8..1a2e6f11 100644 --- a/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java +++ b/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java @@ -1,30 +1,39 @@ package com.workup.users; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.workup.shared.commands.users.requests.AuthenticationRequest; +import com.workup.shared.commands.users.requests.ClientRegisterRequest; import com.workup.shared.commands.users.requests.FreelancerRegisterRequest; -import com.workup.shared.commands.users.responses.FreelancerRegisterResponse; +import com.workup.shared.commands.users.requests.LoginRequest; +import com.workup.shared.commands.users.responses.SignUpAndInResponse; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + public class RequestsAndResponsesTest { - private static Object[] testObjects = { // all requests/responses to be tested - FreelancerRegisterRequest.builder().build(), FreelancerRegisterResponse.builder().build(), - }; + private static Object[] testObjects = { // all requests/responses to be tested + FreelancerRegisterRequest.builder().build(), + SignUpAndInResponse.builder().build(), + AuthenticationRequest.builder().build(), + ClientRegisterRequest.builder().build(), + LoginRequest.builder().build() + }; - @Test - public void testSerializationNoExceptionsThrown() throws JsonProcessingException { - ObjectMapper objectMapper = new ObjectMapper(); - for (Object testObject : testObjects) { - String className = testObject.getClass().getName(); - assertDoesNotThrow( - () -> objectMapper.writeValueAsString(testObject), - String.format("Serialization of %s should not throw exceptions", className)); - String json = objectMapper.writeValueAsString(testObject); - assertDoesNotThrow( - () -> objectMapper.readValue(json, testObject.getClass()), - String.format("Deserialization of %s should not throw exceptions", className)); + @Test + public void testSerializationNoExceptionsThrown() throws JsonProcessingException { + ObjectMapper objectMapper = new ObjectMapper(); + for (Object testObject : testObjects) { + String className = testObject.getClass().getName(); + assertDoesNotThrow( + () -> objectMapper.writeValueAsString(testObject), + String.format("Serialization of %s should not throw exceptions", className) + ); + String json = objectMapper.writeValueAsString(testObject); + assertDoesNotThrow( + () -> objectMapper.readValue(json, testObject.getClass()), + String.format("Deserialization of %s should not throw exceptions", className) + ); + } } - } } diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java new file mode 100644 index 00000000..d5e870bb --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java @@ -0,0 +1,12 @@ +package com.workup.shared.commands.users.requests; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder(setterPrefix = "with") +@JsonDeserialize(builder = AuthenticationRequest.AuthenticationRequestBuilder.class) +public class AuthenticationRequest { + private String authToken; +} diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java new file mode 100644 index 00000000..9108cd8e --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java @@ -0,0 +1,19 @@ +package com.workup.shared.commands.users.requests; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder(setterPrefix = "with") +@JsonDeserialize(builder = ClientRegisterRequest.ClientRegisterRequestBuilder.class) +public class ClientRegisterRequest { + private String email; + private String passwordHash; + private String clientName; + private String industry; + private String city; + private String photoId; + private String description; + private Integer employeeCount; +} diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java index 98b75ecc..1336ec01 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java @@ -1,19 +1,20 @@ package com.workup.shared.commands.users.requests; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.workup.shared.commands.CommandRequest; -import java.util.Date; +import lombok.Builder; import lombok.Getter; -import lombok.experimental.SuperBuilder; -import lombok.extern.jackson.Jacksonized; + +import java.util.Date; @Getter -@SuperBuilder(setterPrefix = "with") -@Jacksonized +@Builder(setterPrefix = "with") +@JsonDeserialize(builder = FreelancerRegisterRequest.FreelancerRegisterRequestBuilder.class) public class FreelancerRegisterRequest extends CommandRequest { - public String email; - public String passwordHash; - public String fullName; - public String jobTitle; - public String city; - public Date birthDate; + private String email; + private String passwordHash; + private String fullName; + private String jobTitle; + private String city; + private Date birthDate; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java new file mode 100644 index 00000000..ef1737bc --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java @@ -0,0 +1,13 @@ +package com.workup.shared.commands.users.requests; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder(setterPrefix = "with") +@JsonDeserialize(builder = LoginRequest.LoginRequestBuilder.class) +public class LoginRequest { + private String email; + private String passwordHash; +} diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java new file mode 100644 index 00000000..68bf5db4 --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java @@ -0,0 +1,13 @@ +package com.workup.shared.commands.users.responses; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder(setterPrefix = "with") +@JsonDeserialize(builder = AuthenticationResponse.AuthenticationResponseBuilder.class) +public class AuthenticationResponse { + private String email; + private UserType userType; +} diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/FreelancerRegisterResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/FreelancerRegisterResponse.java deleted file mode 100644 index 0dfabc7d..00000000 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/FreelancerRegisterResponse.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.workup.shared.commands.users.responses; - -import com.workup.shared.commands.CommandResponse; -import lombok.Getter; -import lombok.experimental.SuperBuilder; -import lombok.extern.jackson.Jacksonized; - -@Getter -@SuperBuilder(setterPrefix = "with") -@Jacksonized -public class FreelancerRegisterResponse extends CommandResponse { - public boolean success; - public String authToken; -} diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java new file mode 100644 index 00000000..4d0c736c --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java @@ -0,0 +1,14 @@ +package com.workup.shared.commands.users.responses; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.workup.shared.commands.CommandResponse; +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder(setterPrefix = "with") +@JsonDeserialize(builder = SignUpAndInResponse.SignUpAndInResponseBuilder.class) +public class SignUpAndInResponse extends CommandResponse { + boolean success; + String authToken; +} diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java b/shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java new file mode 100644 index 00000000..2b68d577 --- /dev/null +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java @@ -0,0 +1,6 @@ +package com.workup.shared.commands.users.responses; + +public enum UserType { + FREELANCER, + CLIENT +} From c1b58aa5a1b37cad7dc3554aa47487ee37fa4fc4 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 4 Mar 2024 11:52:54 +0200 Subject: [PATCH 06/13] Created Users module, and added FreelancerRegister request and response --- .../requests/FreelancerRegisterRequest.java | 16 ++++++++++++++++ .../responses/FreelancerRegisterResponse.java | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java create mode 100644 services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java diff --git a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java new file mode 100644 index 00000000..b33c01d8 --- /dev/null +++ b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java @@ -0,0 +1,16 @@ +package com.workup.users.requests; +import com.workup.shared.commands.CommandRequest; +import lombok.Builder; +import lombok.NonNull; + +import java.util.Date; + +@Builder +public class FreelancerRegisterRequest extends CommandRequest { + @NonNull String email; + @NonNull String passwordHash; + @NonNull String fullName; + String jobTitle; + String city; + Date birthDate; +} diff --git a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java new file mode 100644 index 00000000..68c4d81e --- /dev/null +++ b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java @@ -0,0 +1,9 @@ +package com.workup.users.responses; + +import com.workup.shared.commands.CommandResponse; +import lombok.NonNull; + +public class FreelancerRegisterResponse extends CommandResponse { + @NonNull boolean success; + String authToken; +} From 3641a2fb7431987a9b112fb2ce40ccc23664c003 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 4 Mar 2024 15:08:48 +0200 Subject: [PATCH 07/13] Addressed @Ahmad45123's comments and created a test to verify the serialization process. --- .../requests/FreelancerRegisterRequest.java | 16 ---------------- .../responses/FreelancerRegisterResponse.java | 9 --------- 2 files changed, 25 deletions(-) delete mode 100644 services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java delete mode 100644 services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java diff --git a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java b/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java deleted file mode 100644 index b33c01d8..00000000 --- a/services/users/src/main/java/com/workup/users/requests/FreelancerRegisterRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.workup.users.requests; -import com.workup.shared.commands.CommandRequest; -import lombok.Builder; -import lombok.NonNull; - -import java.util.Date; - -@Builder -public class FreelancerRegisterRequest extends CommandRequest { - @NonNull String email; - @NonNull String passwordHash; - @NonNull String fullName; - String jobTitle; - String city; - Date birthDate; -} diff --git a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java b/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java deleted file mode 100644 index 68c4d81e..00000000 --- a/services/users/src/main/java/com/workup/users/responses/FreelancerRegisterResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.workup.users.responses; - -import com.workup.shared.commands.CommandResponse; -import lombok.NonNull; - -public class FreelancerRegisterResponse extends CommandResponse { - @NonNull boolean success; - String authToken; -} From 62d2f0c8d061c411918778fa3f3709b4955b99e1 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Sun, 28 Apr 2024 21:29:40 +0300 Subject: [PATCH 08/13] Updated the annotations to match the ones requested by @Ahmad45123 Signed-off-by: Akram-Fahim --- .../users/requests/AuthenticationRequest.java | 10 ++++---- .../users/requests/ClientRegisterRequest.java | 24 +++++++++---------- .../requests/FreelancerRegisterRequest.java | 23 +++++++++--------- .../commands/users/requests/LoginRequest.java | 12 +++++----- .../responses/AuthenticationResponse.java | 12 +++++----- .../users/responses/SignUpAndInResponse.java | 12 +++++----- 6 files changed, 46 insertions(+), 47 deletions(-) diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java index d5e870bb..9b759355 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java @@ -1,12 +1,12 @@ package com.workup.shared.commands.users.requests; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import lombok.Builder; import lombok.Getter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; @Getter -@Builder(setterPrefix = "with") -@JsonDeserialize(builder = AuthenticationRequest.AuthenticationRequestBuilder.class) +@SuperBuilder(setterPrefix = "with") +@Jacksonized public class AuthenticationRequest { - private String authToken; + private String authToken; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java index 9108cd8e..42260a36 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java @@ -1,19 +1,19 @@ package com.workup.shared.commands.users.requests; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import lombok.Builder; import lombok.Getter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; @Getter -@Builder(setterPrefix = "with") -@JsonDeserialize(builder = ClientRegisterRequest.ClientRegisterRequestBuilder.class) +@SuperBuilder(setterPrefix = "with") +@Jacksonized public class ClientRegisterRequest { - private String email; - private String passwordHash; - private String clientName; - private String industry; - private String city; - private String photoId; - private String description; - private Integer employeeCount; + private String email; + private String passwordHash; + private String clientName; + private String industry; + private String city; + private String photoId; + private String description; + private Integer employeeCount; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java index 1336ec01..6f2875ac 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java @@ -1,20 +1,19 @@ package com.workup.shared.commands.users.requests; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.workup.shared.commands.CommandRequest; -import lombok.Builder; -import lombok.Getter; - import java.util.Date; +import lombok.Getter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; @Getter -@Builder(setterPrefix = "with") -@JsonDeserialize(builder = FreelancerRegisterRequest.FreelancerRegisterRequestBuilder.class) +@SuperBuilder(setterPrefix = "with") +@Jacksonized public class FreelancerRegisterRequest extends CommandRequest { - private String email; - private String passwordHash; - private String fullName; - private String jobTitle; - private String city; - private Date birthDate; + private String email; + private String passwordHash; + private String fullName; + private String jobTitle; + private String city; + private Date birthDate; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java index ef1737bc..c89d10c1 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java @@ -1,13 +1,13 @@ package com.workup.shared.commands.users.requests; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import lombok.Builder; import lombok.Getter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; @Getter -@Builder(setterPrefix = "with") -@JsonDeserialize(builder = LoginRequest.LoginRequestBuilder.class) +@SuperBuilder(setterPrefix = "with") +@Jacksonized public class LoginRequest { - private String email; - private String passwordHash; + private String email; + private String passwordHash; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java index 68bf5db4..5c013cfb 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java @@ -1,13 +1,13 @@ package com.workup.shared.commands.users.responses; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import lombok.Builder; import lombok.Getter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; @Getter -@Builder(setterPrefix = "with") -@JsonDeserialize(builder = AuthenticationResponse.AuthenticationResponseBuilder.class) +@SuperBuilder(setterPrefix = "with") +@Jacksonized public class AuthenticationResponse { - private String email; - private UserType userType; + private String email; + private UserType userType; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java index 4d0c736c..48902472 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java @@ -1,14 +1,14 @@ package com.workup.shared.commands.users.responses; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.workup.shared.commands.CommandResponse; -import lombok.Builder; import lombok.Getter; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; @Getter -@Builder(setterPrefix = "with") -@JsonDeserialize(builder = SignUpAndInResponse.SignUpAndInResponseBuilder.class) +@SuperBuilder(setterPrefix = "with") +@Jacksonized public class SignUpAndInResponse extends CommandResponse { - boolean success; - String authToken; + boolean success; + String authToken; } From 3c6d6b6c668c1f7487562d49e430381984e3f51f Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Sun, 28 Apr 2024 22:07:27 +0300 Subject: [PATCH 09/13] Linting Signed-off-by: Akram-Fahim --- .../users/RequestsAndResponsesTest.java | 46 +++++++++---------- .../responses/AuthenticationResponse.java | 1 + .../commands/users/responses/UserType.java | 6 --- .../workup/shared/enums/users/UserType.java | 6 +++ 4 files changed, 29 insertions(+), 30 deletions(-) delete mode 100644 shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java create mode 100644 shared/src/main/java/com/workup/shared/enums/users/UserType.java diff --git a/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java b/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java index 1a2e6f11..fc381b9c 100644 --- a/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java +++ b/services/users/src/test/java/com/workup/users/RequestsAndResponsesTest.java @@ -1,5 +1,7 @@ package com.workup.users; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.workup.shared.commands.users.requests.AuthenticationRequest; @@ -9,31 +11,27 @@ import com.workup.shared.commands.users.responses.SignUpAndInResponse; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; - public class RequestsAndResponsesTest { - private static Object[] testObjects = { // all requests/responses to be tested - FreelancerRegisterRequest.builder().build(), - SignUpAndInResponse.builder().build(), - AuthenticationRequest.builder().build(), - ClientRegisterRequest.builder().build(), - LoginRequest.builder().build() - }; + private static Object[] testObjects = { // all requests/responses to be tested + FreelancerRegisterRequest.builder().build(), + SignUpAndInResponse.builder().build(), + AuthenticationRequest.builder().build(), + ClientRegisterRequest.builder().build(), + LoginRequest.builder().build() + }; - @Test - public void testSerializationNoExceptionsThrown() throws JsonProcessingException { - ObjectMapper objectMapper = new ObjectMapper(); - for (Object testObject : testObjects) { - String className = testObject.getClass().getName(); - assertDoesNotThrow( - () -> objectMapper.writeValueAsString(testObject), - String.format("Serialization of %s should not throw exceptions", className) - ); - String json = objectMapper.writeValueAsString(testObject); - assertDoesNotThrow( - () -> objectMapper.readValue(json, testObject.getClass()), - String.format("Deserialization of %s should not throw exceptions", className) - ); - } + @Test + public void testSerializationNoExceptionsThrown() throws JsonProcessingException { + ObjectMapper objectMapper = new ObjectMapper(); + for (Object testObject : testObjects) { + String className = testObject.getClass().getName(); + assertDoesNotThrow( + () -> objectMapper.writeValueAsString(testObject), + String.format("Serialization of %s should not throw exceptions", className)); + String json = objectMapper.writeValueAsString(testObject); + assertDoesNotThrow( + () -> objectMapper.readValue(json, testObject.getClass()), + String.format("Deserialization of %s should not throw exceptions", className)); } + } } diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java index 5c013cfb..36ff0bd8 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java @@ -1,5 +1,6 @@ package com.workup.shared.commands.users.responses; +import com.workup.shared.enums.users.UserType; import lombok.Getter; import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java b/shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java deleted file mode 100644 index 2b68d577..00000000 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/UserType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.workup.shared.commands.users.responses; - -public enum UserType { - FREELANCER, - CLIENT -} diff --git a/shared/src/main/java/com/workup/shared/enums/users/UserType.java b/shared/src/main/java/com/workup/shared/enums/users/UserType.java new file mode 100644 index 00000000..0654d83d --- /dev/null +++ b/shared/src/main/java/com/workup/shared/enums/users/UserType.java @@ -0,0 +1,6 @@ +package com.workup.shared.enums.users; + +public enum UserType { + FREELANCER, + CLIENT +} From b6133862295f62ac6861bec4d13874f723d59b04 Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 29 Apr 2024 13:13:59 +0300 Subject: [PATCH 10/13] Handled Inheritance bug Signed-off-by: Akram-Fahim --- .../shared/commands/users/requests/AuthenticationRequest.java | 3 ++- .../shared/commands/users/requests/ClientRegisterRequest.java | 3 ++- .../workup/shared/commands/users/requests/LoginRequest.java | 3 ++- .../commands/users/responses/AuthenticationResponse.java | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java index 9b759355..79d9bbd5 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/AuthenticationRequest.java @@ -1,5 +1,6 @@ package com.workup.shared.commands.users.requests; +import com.workup.shared.commands.CommandRequest; import lombok.Getter; import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; @@ -7,6 +8,6 @@ @Getter @SuperBuilder(setterPrefix = "with") @Jacksonized -public class AuthenticationRequest { +public class AuthenticationRequest extends CommandRequest { private String authToken; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java index 42260a36..46140c68 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java @@ -1,5 +1,6 @@ package com.workup.shared.commands.users.requests; +import com.workup.shared.commands.CommandRequest; import lombok.Getter; import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; @@ -7,7 +8,7 @@ @Getter @SuperBuilder(setterPrefix = "with") @Jacksonized -public class ClientRegisterRequest { +public class ClientRegisterRequest extends CommandRequest { private String email; private String passwordHash; private String clientName; diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java index c89d10c1..d8f446e9 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java @@ -1,5 +1,6 @@ package com.workup.shared.commands.users.requests; +import com.workup.shared.commands.CommandRequest; import lombok.Getter; import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; @@ -7,7 +8,7 @@ @Getter @SuperBuilder(setterPrefix = "with") @Jacksonized -public class LoginRequest { +public class LoginRequest extends CommandRequest { private String email; private String passwordHash; } diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java index 36ff0bd8..570f9a6a 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/AuthenticationResponse.java @@ -1,5 +1,6 @@ package com.workup.shared.commands.users.responses; +import com.workup.shared.commands.CommandResponse; import com.workup.shared.enums.users.UserType; import lombok.Getter; import lombok.experimental.SuperBuilder; @@ -8,7 +9,7 @@ @Getter @SuperBuilder(setterPrefix = "with") @Jacksonized -public class AuthenticationResponse { +public class AuthenticationResponse extends CommandResponse { private String email; private UserType userType; } From deedfe31f9854df8f4d77a81e89c4f59c8acb33a Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Mon, 29 Apr 2024 13:19:46 +0300 Subject: [PATCH 11/13] Removed the success boolean as suggested by @Ahmad45123 Signed-off-by: Akram-Fahim --- .../shared/commands/users/responses/SignUpAndInResponse.java | 1 - 1 file changed, 1 deletion(-) diff --git a/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java b/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java index 48902472..488ed021 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java +++ b/shared/src/main/java/com/workup/shared/commands/users/responses/SignUpAndInResponse.java @@ -9,6 +9,5 @@ @SuperBuilder(setterPrefix = "with") @Jacksonized public class SignUpAndInResponse extends CommandResponse { - boolean success; String authToken; } From 30eba498dd3d79128f55be3a7b564df01d3f34fe Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Wed, 1 May 2024 11:23:54 +0300 Subject: [PATCH 12/13] Addressed Noureldin's comments Signed-off-by: Akram-Fahim --- .../shared/commands/users/requests/ClientRegisterRequest.java | 2 +- .../commands/users/requests/FreelancerRegisterRequest.java | 2 +- .../com/workup/shared/commands/users/requests/LoginRequest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java index 46140c68..b9371443 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/ClientRegisterRequest.java @@ -10,7 +10,7 @@ @Jacksonized public class ClientRegisterRequest extends CommandRequest { private String email; - private String passwordHash; + private String password; private String clientName; private String industry; private String city; diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java index 6f2875ac..73fbe1de 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/FreelancerRegisterRequest.java @@ -11,7 +11,7 @@ @Jacksonized public class FreelancerRegisterRequest extends CommandRequest { private String email; - private String passwordHash; + private String password; private String fullName; private String jobTitle; private String city; diff --git a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java index d8f446e9..ed7fc438 100644 --- a/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java +++ b/shared/src/main/java/com/workup/shared/commands/users/requests/LoginRequest.java @@ -10,5 +10,5 @@ @Jacksonized public class LoginRequest extends CommandRequest { private String email; - private String passwordHash; + private String password; } From ab6604a4ac3f0988115e057022d1235eef5c08ca Mon Sep 17 00:00:00 2001 From: Akram-Fahim Date: Thu, 9 May 2024 16:12:57 +0300 Subject: [PATCH 13/13] Created AuthTokenHandler and PasswordHasher, and used both of them to create FreelancerRegister command. Signed-off-by: Akram-Fahim --- .idea/compiler.xml | 4 ++- services/users/pom.xml | 26 ++++++++++++++ .../users/commands/FreelancerRegister.java | 36 +++++++++++++++++++ .../commands/utils/AuthTokenHandler.java | 27 ++++++++++++++ .../users/commands/utils/PasswordHasher.java | 13 +++++++ .../src/main/resources/application.properties | 1 + 6 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 services/users/src/main/java/com/workup/users/commands/FreelancerRegister.java create mode 100644 services/users/src/main/java/com/workup/users/commands/utils/AuthTokenHandler.java create mode 100644 services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java diff --git a/.idea/compiler.xml b/.idea/compiler.xml index a0c6be67..c2c4090a 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -2,7 +2,9 @@ - + + + diff --git a/services/users/pom.xml b/services/users/pom.xml index ff215d4a..59fb0d78 100644 --- a/services/users/pom.xml +++ b/services/users/pom.xml @@ -103,6 +103,32 @@ 1.19.7 test + + + org.mindrot + jbcrypt + 0.4 + + + + io.jsonwebtoken + jjwt-api + 0.11.2 + + + + io.jsonwebtoken + jjwt-impl + 0.11.2 + runtime + + + + io.jsonwebtoken + jjwt-jackson + 0.11.2 + runtime + diff --git a/services/users/src/main/java/com/workup/users/commands/FreelancerRegister.java b/services/users/src/main/java/com/workup/users/commands/FreelancerRegister.java new file mode 100644 index 00000000..fa2450a3 --- /dev/null +++ b/services/users/src/main/java/com/workup/users/commands/FreelancerRegister.java @@ -0,0 +1,36 @@ +package com.workup.users.commands; + +import static com.workup.users.commands.utils.AuthTokenHandler.generateToken; +import static com.workup.users.commands.utils.PasswordHasher.hashPassword; + +import com.workup.shared.commands.users.requests.FreelancerRegisterRequest; +import com.workup.shared.commands.users.responses.SignUpAndInResponse; +import com.workup.shared.enums.HttpStatusCode; +import com.workup.users.db.Freelancer; +import java.util.Objects; + +public class FreelancerRegister + extends UserCommand { + + @Override + public SignUpAndInResponse Run(FreelancerRegisterRequest request) { + if (Objects.isNull(request.getEmail()) + || Objects.isNull(request.getPassword()) + || Objects.isNull(request.getFullName())) { + return SignUpAndInResponse.builder().withStatusCode(HttpStatusCode.BAD_REQUEST).build(); + } + Freelancer freelancer = + Freelancer.builder() + .withEmail(request.getEmail()) + .withPassword_hash(hashPassword(request.getPassword())) + .withFull_name(request.getFullName()) + .withJob_title(request.getJobTitle()) + .withCity(request.getCity()) + .build(); + + return SignUpAndInResponse.builder() + .withAuthToken(generateToken(freelancer.getEmail())) + .withStatusCode(HttpStatusCode.OK) + .build(); + } +} diff --git a/services/users/src/main/java/com/workup/users/commands/utils/AuthTokenHandler.java b/services/users/src/main/java/com/workup/users/commands/utils/AuthTokenHandler.java new file mode 100644 index 00000000..475546ea --- /dev/null +++ b/services/users/src/main/java/com/workup/users/commands/utils/AuthTokenHandler.java @@ -0,0 +1,27 @@ +package com.workup.users.commands.utils; + +import io.jsonwebtoken.*; +import java.util.Date; + +public class AuthTokenHandler { + private static final String SECRET_KEY = System.getenv("SECRET_KEY"); + private static final JwtParser parser = Jwts.parserBuilder().setSigningKey(SECRET_KEY).build(); + + public static String generateToken(String email) { + Date now = new Date(); + Date expiryDate = new Date(now.getTime() + 3600000); // Token expires in 1 hour + + return Jwts.builder() + .setSubject(email) + .setIssuedAt(now) + .setExpiration(expiryDate) + .signWith(SignatureAlgorithm.HS512, SECRET_KEY) + .compact(); + } + + public static String decodeToken(String token) { + Jws claimsJws = parser.parseClaimsJws(token); + Claims body = claimsJws.getBody(); + return body.getSubject(); + } +} diff --git a/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java b/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java new file mode 100644 index 00000000..87bebe26 --- /dev/null +++ b/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java @@ -0,0 +1,13 @@ +package com.workup.users.commands.utils; + +import org.mindrot.jbcrypt.BCrypt; + +public class PasswordHasher { + public static String hashPassword(String password) { + return BCrypt.hashpw(password, BCrypt.gensalt()); + } + + public static boolean checkPassword(String inputPassword, String hashedPassword) { + return BCrypt.checkpw(inputPassword, hashedPassword); + } +} diff --git a/services/users/src/main/resources/application.properties b/services/users/src/main/resources/application.properties index cbbffada..0a6f3603 100644 --- a/services/users/src/main/resources/application.properties +++ b/services/users/src/main/resources/application.properties @@ -8,3 +8,4 @@ spring.rabbitmq.host=localhost spring.rabbitmq.port=5672 spring.rabbitmq.username=guest spring.rabbitmq.password=guest +SECRET_KEY=j4#BbFGfoc^2k*Bz