activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-409 clarify STOMP login failure response
Date Mon, 20 Jun 2016 10:57:06 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master fa40a0abc -> 04885bbaf


ARTEMIS-409 clarify STOMP login failure response


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/eb785b41
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/eb785b41
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/eb785b41

Branch: refs/heads/master
Commit: eb785b419495562e0a11f2f668dd96c553457430
Parents: a39f43d
Author: jbertram <jbertram@apache.org>
Authored: Tue May 24 10:46:14 2016 -0500
Committer: jbertram <jbertram@apache.org>
Committed: Fri Jun 17 17:16:51 2016 -0500

----------------------------------------------------------------------
 .../artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java   | 5 +++--
 .../artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java   | 5 +++--
 .../artemis/spi/core/security/ActiveMQJAASSecurityManager.java  | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/eb785b41/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
index 98fead7..1f4fea7 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
@@ -67,8 +67,9 @@ public class StompFrameHandlerV10 extends VersionedStompFrameHandler implements
       else {
          //not valid
          response = new StompFrameV10(Stomp.Responses.ERROR);
-         response.addHeader(Stomp.Headers.Error.MESSAGE, "Failed to connect");
-         response.setBody("The login account is not valid.");
+         String responseText = "Security Error occurred: User name [" + login + "] or password
is invalid";
+         response.setBody(responseText);
+         response.addHeader(Stomp.Headers.Error.MESSAGE, responseText);
       }
       return response;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/eb785b41/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
index 91d0119..3d30ea1 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
@@ -93,8 +93,9 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
             response = createStompFrame(Stomp.Responses.ERROR);
             response.setNeedsDisconnect(true);
             response.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
-            response.addHeader(Stomp.Headers.Error.MESSAGE, "Failed to connect");
-            response.setBody("The login account is not valid.");
+            String responseText = "Security Error occurred: User name [" + login + "] or
password is invalid";
+            response.setBody(responseText);
+            response.addHeader(Stomp.Headers.Error.MESSAGE, responseText);
          }
       }
       catch (ActiveMQStompException e) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/eb785b41/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java
index cd380ec..a2d31bf 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java
@@ -91,7 +91,6 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager2
{
          return true;
       }
       catch (LoginException e) {
-         logger.info("Couldn't validate user: " + e.getMessage());
          if (logger.isDebugEnabled()) {
             logger.debug("Couldn't validate user", e);
          }
@@ -120,7 +119,9 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager2
{
          localSubject = getAuthenticatedSubject(user, password, certificates);
       }
       catch (LoginException e) {
-         logger.debug("Couldn't validate user", e);
+         if (logger.isDebugEnabled()) {
+            logger.debug("Couldn't validate user", e);
+         }
          return false;
       }
 


Mime
View raw message