You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2021/03/17 14:53:39 UTC

[activemq-artemis] branch master updated: ARTEMIS-3172 don't log STOMP CONNECT passcode header

This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new e1669d4  ARTEMIS-3172 don't log STOMP CONNECT passcode header
     new cd44d90  This closes #3485
e1669d4 is described below

commit e1669d4ad2161352cd8118215eaefec2aadadeb0
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Wed Mar 10 09:24:10 2021 -0600

    ARTEMIS-3172 don't log STOMP CONNECT passcode header
---
 .../apache/activemq/artemis/core/protocol/stomp/StompFrame.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
index aa921dd..a48ac3a 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
@@ -20,6 +20,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
@@ -79,7 +80,11 @@ public class StompFrame {
    public String toString() {
       StringBuilder result = new StringBuilder()
          .append("StompFrame[command=").append(command)
-         .append(", headers=").append(headers);
+         .append(", headers=").append(headers
+                                         .keySet()
+                                         .stream()
+                                         .map(key -> key + "=" + (key.equals(Stomp.Headers.Connect.PASSCODE) ? "****" : headers.get(key)))
+                                         .collect(Collectors.joining(", ", "{", "}")));
 
       if (command.equals(Stomp.Responses.MESSAGE) || command.equals(Stomp.Responses.ERROR) || command.equals(Stomp.Commands.SEND)) {
          result.append(", body=").append(this.getBody())