Skip to content

Commit

Permalink
Refactor logging statements for clarity and consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcolon021 committed Aug 14, 2024
1 parent d34c01a commit f93acb2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ public HashMap<String, String> authenticate(Map<String, String> authRequest, Str
}

if (introspectResponse == null) {
logger.info("LOGIN FAILED ___ USER NOT AUTHENTICATED ___ Introspection Response {}", introspectResponse);
logger.info("LOGIN FAILED ___ USER NOT AUTHENTICATED ___ INTROSPECTION RESPONSE {}", introspectResponse);
return null;
}

Optional<User> initializedUser = initializeUser(introspectResponse);
if (initializedUser.isEmpty()) {
logger.info("LOGIN FAILED ___ COULD NOT CREATE USER ___");
logger.info("LOGIN FAILED ___ COULD NOT CREATE USER ");
return null;
}

Expand All @@ -117,7 +117,8 @@ public HashMap<String, String> authenticate(Map<String, String> authRequest, Str
}

if (!rasPassport.get().getIss().equals(this.rasPassportIssuer)) {
logger.error("validateRASPassport() LOGIN FAILED ___ PASSPORT ISSUER IS NOT CORRECT ___ USER: {}", user.getSubject());
logger.error("validateRASPassport() LOGIN FAILED ___ PASSPORT ISSUER IS NOT CORRECT ___ USER: {} ___ " +
"EXPECTED ISSUER {} ___ ACTUAL ISSUER {}", user.getSubject(), this.rasPassportIssuer, rasPassport.get().getIss());
return null;
}

Expand All @@ -127,7 +128,7 @@ public HashMap<String, String> authenticate(Map<String, String> authRequest, Str
Optional<Set<String>> dbgapRoleNames = this.roleService.getRoleNamesForDbgapPermissions(dbgapPermissions);
if (dbgapRoleNames.isPresent()) {
user = userService.updateUserRoles(user, dbgapRoleNames.get());
logger.debug("User roles updated: {}", user.getRoles().stream().map(role -> role.getName().replace("MANAGED_", "")).toArray());
logger.debug("USER {} ROLES UPDATED {}", user.getSubject(), user.getRoles().stream().map(role -> role.getName().replace("MANAGED_", "")).toArray());
}

String passport = introspectResponse.get("passport_jwt_v11").toString();
Expand Down

0 comments on commit f93acb2

Please # to comment.