You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/04/06 19:56:09 UTC

[GitHub] [activemq-artemis] ahoffer opened a new pull request, #4019: ARTEMIS-3765 Display validated user in Hawtio

ahoffer opened a new pull request, #4019:
URL: https://github.com/apache/activemq-artemis/pull/4019

   This PR adds a "Validated User" column to the Hawtio plugin. The column is
   not visible by default. The "Validated User" column is available in the
   Session, Consumer, and Producer tabs of the artemis-navigation notebook.
   "Validated User" is also available for sort and filtering in those view.
   The "Validated Consumer" in the Producer view is always blank. I debugged
   as far as I could, but did not find the cause of the issue.


-- 
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: gitbox-unsubscribe@activemq.apache.org

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


[GitHub] [activemq-artemis] jbertram commented on pull request #4019: ARTEMIS-3765 Display validated user in Hawtio

Posted by GitBox <gi...@apache.org>.
jbertram commented on PR #4019:
URL: https://github.com/apache/activemq-artemis/pull/4019#issuecomment-1102750156

   @ahoffer, nice work. Thanks for the PR!


-- 
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: gitbox-unsubscribe@activemq.apache.org

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


[GitHub] [activemq-artemis] ahoffer commented on a diff in pull request #4019: ARTEMIS-3765 Display validated user in Hawtio

Posted by GitBox <gi...@apache.org>.
ahoffer commented on code in PR #4019:
URL: https://github.com/apache/activemq-artemis/pull/4019#discussion_r844360464


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/predicate/ConnectionFilterPredicate.java:
##########
@@ -71,6 +66,17 @@ public boolean test(RemotingConnection connection) {
       return true;
    }
 
+   Set<String> collectFromSessions(String connectionId, Function<ServerSession, String> getter) {
+      List<ServerSession> sessions = server.getSessions(connectionId);
+      Set<String> sessionAttributes = new HashSet<>();
+      for (ServerSession session : sessions) {
+         String value = getter.apply(session);
+         String string = value == null ? "" : value;
+         sessionAttributes.add(string);
+      }
+      return sessionAttributes;
+   }
+

Review Comment:
   i thought I reverted this change. At one point, I was pulling validated users from the sessions associated with the connections and displaying them. I created this method so that I didn't have to copy and paste code for getUsername() and getValidatedUser However, I backed those changes out. I thought I backed this one out too. If you want, I can roll the code back to how it was.



##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/predicate/ConnectionFilterPredicate.java:
##########
@@ -71,6 +66,17 @@ public boolean test(RemotingConnection connection) {
       return true;
    }
 
+   Set<String> collectFromSessions(String connectionId, Function<ServerSession, String> getter) {
+      List<ServerSession> sessions = server.getSessions(connectionId);
+      Set<String> sessionAttributes = new HashSet<>();
+      for (ServerSession session : sessions) {
+         String value = getter.apply(session);
+         String string = value == null ? "" : value;
+         sessionAttributes.add(string);
+      }
+      return sessionAttributes;
+   }
+

Review Comment:
   I thought I reverted this change. At one point, I was pulling validated users from the sessions associated with the connections and displaying them. I created this method so that I didn't have to copy and paste code for getUsername() and getValidatedUser However, I backed those changes out. I thought I backed this one out too. If you want, I can roll the code back to how it was.



-- 
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: gitbox-unsubscribe@activemq.apache.org

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


[GitHub] [activemq-artemis] ahoffer commented on a diff in pull request #4019: ARTEMIS-3765 Display validated user in Hawtio

Posted by GitBox <gi...@apache.org>.
ahoffer commented on code in PR #4019:
URL: https://github.com/apache/activemq-artemis/pull/4019#discussion_r844371477


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java:
##########
@@ -2651,7 +2651,7 @@ public void buildSessionJSON(JsonArrayBuilder array, ServerSession sess) {
       JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("sessionID", sess.getName()).add("creationTime", sess.getCreationTime()).add("consumerCount", sess.getServerConsumers().size());
 
       if (sess.getValidatedUser() != null) {
-         obj.add("principal", sess.getValidatedUser());
+         obj.add("validatedUser", sess.getValidatedUser());

Review Comment:
   I'm fine with either validated user or principal. I think it was Justin (?) who said to keep "validated user" to keep things consistent.



-- 
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: gitbox-unsubscribe@activemq.apache.org

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


[GitHub] [activemq-artemis] asfgit closed pull request #4019: ARTEMIS-3765 Display validated user in Hawtio

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4019: ARTEMIS-3765 Display validated user in Hawtio
URL: https://github.com/apache/activemq-artemis/pull/4019


-- 
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: gitbox-unsubscribe@activemq.apache.org

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


[GitHub] [activemq-artemis] ahoffer commented on a diff in pull request #4019: ARTEMIS-3765 Display validated user in Hawtio

Posted by GitBox <gi...@apache.org>.
ahoffer commented on code in PR #4019:
URL: https://github.com/apache/activemq-artemis/pull/4019#discussion_r844366597


##########
artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js:
##########
@@ -326,7 +326,7 @@ var Artemis;
                 header: 'User ID'
             },
             {
-                itemField: 'StringProperties',
+                itemField: 'validatedUser',
                 header: 'Validated User',
                 templateFn: function(value) {
                     return value._AMQ_VALIDATED_USER;

Review Comment:
   The line `header: 'Validated User'` was already in main. I don't know what it does -- I don't see it anywhere on the UI. I change the `itemField` name for consistency.  I'm happy to try and work on this. Let me know how you want it to work.



-- 
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: gitbox-unsubscribe@activemq.apache.org

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