Skip to content

Commit

Permalink
MET-5469: metis-authentication java update
Browse files Browse the repository at this point in the history
Update elastic apm agent to fix error after jvm update.
Update code on login to easier check failure of login.
  • Loading branch information
stzanakis committed Oct 9, 2023
1 parent c79360c commit 940c4a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion metis-authentication/metis-authentication-rest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:11-jre-slim
FROM openjdk:21-slim
COPY target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ public void registerUser(@RequestHeader("Authorization") String authorization)
@ResponseBody
public MetisUserView loginUser(@RequestHeader("Authorization") String authorization)
throws GenericMetisException {
MetisUserView metisUserView;
Credentials credentials = authenticationService
.validateAuthorizationHeaderWithCredentials(authorization);
MetisUserView metisUserView = authenticationService
.loginUser(credentials.getEmail(), credentials.getPassword());
try {
metisUserView = authenticationService
.loginUser(credentials.getEmail(), credentials.getPassword());
} catch (GenericMetisException e) {
LOGGER.info("Authentication failed for user with email: {}", credentials.getEmail());
throw e;
}
LOGGER.info("User with email: {} and user id: {} logged in", metisUserView.getEmail(),
metisUserView.getUserId());
return metisUserView;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<version.ibm.icu4j>69.1</version.ibm.icu4j>
<version.itextpdf>5.5.13.2</version.itextpdf>
<version.jackson>2.13.0</version.jackson>
<version.elastic.apm>1.34.1</version.elastic.apm>
<version.elastic.apm>1.43.0</version.elastic.apm>
<version.javax.annotation>1.3.2</version.javax.annotation>
<version.javax.mail>1.6.0</version.javax.mail>
<version.javax.persistence>1.0.2</version.javax.persistence>
Expand Down

0 comments on commit 940c4a6

Please sign in to comment.