Skip to content

Commit

Permalink
Remove logs meant for auth debugging (#1144)
Browse files Browse the repository at this point in the history
* Use separate limits def

* Add param prefix
  • Loading branch information
dexamundsen authored Jan 27, 2025
1 parent 352e229 commit 322e75b
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
SpringAuthentication.clearCurrentUser();

if (HttpMethods.OPTIONS.equals(request.getMethod())) {
LOGGER.info("Authorization not required for OPTIONS methods requests");
// Authorization not required for OPTIONS methods requests
return true;
}

Expand All @@ -65,13 +65,11 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
if (apiOp != null) {
for (String tag : apiOp.tags()) {
if (OPENAPI_TAG_AUTH_NOT_REQUIRED.equals(tag)) {
LOGGER.info(
"Authorization not required by endpoint: {}", request.getRequestURL().toString());
// Authorization not required by endpoint
return true;
}
}
}
LOGGER.info("Authorization required by endpoint: {}", request.getRequestURL().toString());

UserId userId;
try {
Expand Down Expand Up @@ -123,7 +121,6 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
}

SpringAuthentication.setCurrentUser(userId);
LOGGER.info("User authenticated: subject={}, email={}", userId.getSubject(), userId.getEmail());

// Any further checks on the user (e.g. check email domain name) should go here.
// Return SC_FORBIDDEN, not SC_UNAUTHORIZED, if they fail.
Expand Down
Loading

0 comments on commit 322e75b

Please sign in to comment.