Feat#1 creating auth-service, with JUnit test #14

Merged
stanislav.hejny merged 2 commits from Create-Auth-Microservice#1 into develop 2025-05-07 08:38:06 +00:00
Member

I included the JUnit test class with this version since I already completed it before making the ticket for the test.

I included the JUnit test class with this version since I already completed it before making the ticket for the test.
hurui200320 was assigned by abed.alrahman 2025-05-05 00:44:08 +00:00
stanislav.hejny was assigned by abed.alrahman 2025-05-05 00:44:08 +00:00
stanislav.hejny requested changes 2025-05-05 10:23:45 +00:00
Dismissed
@ -0,0 +64,4 @@
public Mono<ResponseEntity<VerificationResponse>> verify(@RequestHeader(HttpHeaders.AUTHORIZATION) String authorizationHeader) {
log.info("Received token verification request");
if (authorizationHeader == null || !authorizationHeader.startsWith("Bearer ")) {
log.warn("Verification request missing or invalid Bearer token format.");

Please add the actual token string to the log message, this will help greatly with debugging (and invalid token leaks no security info)

Please add the actual token string to the log message, this will help greatly with debugging (and invalid token leaks no security info)
Author
Member

Added

Added
stanislav.hejny marked this conversation as resolved
@ -0,0 +57,4 @@
@ExceptionHandler(Exception.class)
public ProblemDetail handleGenericException(Exception ex) {
logger.error("An unexpected error occurred: ", ex); // Log the full stack trace
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.INTERNAL_SERVER_ERROR, "An unexpected internal error occurred.");

please remove the word 'unexpected' from the message, it gives kind of bad impression when the software reports something 'unexpected', it feels like we made insufficient design and there are things we did not think of.
String "An internal error occurred." will be just fine.

please remove the word 'unexpected' from the message, it gives kind of bad impression when the software reports something 'unexpected', it feels like we made insufficient design and there are things we did not think of. String "An internal error occurred." will be just fine.
Author
Member

Yes, you are right, I changed it.
Check style used two, sorry, I forgot that I changed my IDE :)

Yes, you are right, I changed it. Check style used two, sorry, I forgot that I changed my IDE :)
stanislav.hejny marked this conversation as resolved

Hi Abed,
may I kindly ask to review the parts with commented out code, generally we do not want to keep commented out logic in the source code, unless it refers to future features that are yet to be implemented and that would break the code if present before full implementation, and in this case, please mention this fact in the commented out code itself.

Also, i believe there's a checkstyle rule that says the line of code should not be longer than 100 chars. i know it is bit limiting if you have wide big monitor, but can you perhaps edit your IDE settings to indicate the 100 chars limit and try to fit the Java code line length within that 100chars, where feasible?

Hi Abed, may I kindly ask to review the parts with commented out code, generally we do not want to keep commented out logic in the source code, unless it refers to future features that are yet to be implemented and that would break the code if present before full implementation, and in this case, please mention this fact in the commented out code itself. Also, i believe there's a checkstyle rule that says the line of code should not be longer than 100 chars. i know it is bit limiting if you have wide big monitor, but can you perhaps edit your IDE settings to indicate the 100 chars limit and try to fit the Java code line length within that 100chars, where feasible?
requested review from stanislav.hejny 2025-05-06 23:23:42 +00:00
hurui200320 deleted branch Create-Auth-Microservice#1 2025-05-19 05:35:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clevermicro/user-management#14
No description provided.