You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/03/21 11:47:27 UTC

[GitHub] [james-project] chibenwa opened a new pull request #925: JAMES-3594 ReadOnlyLDAPUser adapt log message

chibenwa opened a new pull request #925:
URL: https://github.com/apache/james-project/pull/925


   Wrap the info and warn log into one:
   
    - error is too high for something that can be caused by bad user input
    - error log was missing critical information like username
    - the info log is duplicated with the error log


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa merged pull request #925: JAMES-3594 ReadOnlyLDAPUser adapt log message

Posted by GitBox <gi...@apache.org>.
chibenwa merged pull request #925:
URL: https://github.com/apache/james-project/pull/925


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a change in pull request #925: JAMES-3594 ReadOnlyLDAPUser adapt log message

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #925:
URL: https://github.com/apache/james-project/pull/925#discussion_r831727008



##########
File path: server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyLDAPUser.java
##########
@@ -129,11 +129,11 @@ public boolean verifyPassword(String password) {
         try {
             BindResult bindResult = connectionPool.bindAndRevertAuthentication(userDN.toString(), password);
             return bindResult.getResultCode() == ResultCode.SUCCESS;
+        } catch (LDAPBindException e) {
+            LOGGER.info("Error binding LDAP for {}: {}", userName.asString(), e.getMessage());
+            return false;
         } catch (Exception e) {
-            if (e instanceof LDAPBindException) {
-                LOGGER.info("Error binding LDAP for {}: {}", userName.asString(), e.getMessage());
-            }
-            LOGGER.error("Unexpected error upon authentication", e);
+            LOGGER.error("Unexpected error upon authenticationfor {}", userName.asString(), e);

Review comment:
       ```suggestion
               LOGGER.error("Unexpected error upon authentication for {}", userName.asString(), e);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] quantranhong1999 commented on a change in pull request #925: JAMES-3594 ReadOnlyLDAPUser adapt log message

Posted by GitBox <gi...@apache.org>.
quantranhong1999 commented on a change in pull request #925:
URL: https://github.com/apache/james-project/pull/925#discussion_r831707535



##########
File path: server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyLDAPUser.java
##########
@@ -129,11 +129,11 @@ public boolean verifyPassword(String password) {
         try {
             BindResult bindResult = connectionPool.bindAndRevertAuthentication(userDN.toString(), password);
             return bindResult.getResultCode() == ResultCode.SUCCESS;
+        } catch (LDAPBindException e) {
+            LOGGER.info("Error binding LDAP for {}: {}", userName.asString(), e.getMessage());
+            return false;
         } catch (Exception e) {
-            if (e instanceof LDAPBindException) {
-                LOGGER.info("Error binding LDAP for {}: {}", userName.asString(), e.getMessage());
-            }
-            LOGGER.error("Unexpected error upon authentication", e);
+            LOGGER.error("Unexpected error upon authenticationfor {}", userName.asString(), e);

Review comment:
       `LOGGER.error("Unexpected error upon authentication for {}", userName.asString(), e);`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org