You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2022/06/14 10:47:43 UTC

[GitHub] [qpid-broker-j] dakirily opened a new pull request, #129: QPID-8591: [Broker-J] Missing message id for add/update/delete user

dakirily opened a new pull request, #129:
URL: https://github.com/apache/qpid-broker-j/pull/129

   This PR addresses JIRA QPID-8591 adding ids for user management log messages (adding / updating / deleting user)


-- 
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: dev-unsubscribe@qpid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-broker-j] vavrtom commented on a diff in pull request #129: QPID-8591: [Broker-J] Missing message id for add/update/delete user

Posted by GitBox <gi...@apache.org>.
vavrtom commented on code in PR #129:
URL: https://github.com/apache/qpid-broker-j/pull/129#discussion_r917600911


##########
broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java:
##########
@@ -103,13 +106,34 @@ public String getPassword()
     @Override
     public void setPassword(final String password)
     {
-        setAttributes(Collections.<String, Object>singletonMap(User.PASSWORD, password));
+        setAttributes(Collections.singletonMap(User.PASSWORD, password));
     }
 
     @Override
     protected void logOperation(final String operation)
     {
-        ((Container) _authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(AuthenticationProviderMessages.OPERATION(operation));
+    }
+
+    @Override
+    protected void logCreated(final Map<String, Object> attributes, final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.CREATE(getName(), "SUCCESS", String.valueOf(getActualAttributes())));

Review Comment:
   The outcome should be used instead of the "SUCCESS" string to see if operation was successful.



##########
broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java:
##########
@@ -103,13 +106,34 @@ public String getPassword()
     @Override
     public void setPassword(final String password)
     {
-        setAttributes(Collections.<String, Object>singletonMap(User.PASSWORD, password));
+        setAttributes(Collections.singletonMap(User.PASSWORD, password));
     }
 
     @Override
     protected void logOperation(final String operation)
     {
-        ((Container) _authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(AuthenticationProviderMessages.OPERATION(operation));
+    }
+
+    @Override
+    protected void logCreated(final Map<String, Object> attributes, final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.CREATE(getName(), "SUCCESS", String.valueOf(getActualAttributes())));
+    }
+
+    @Override
+    protected void logDeleted(final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.DELETE(getName(), "SUCCESS"));

Review Comment:
   The outcome should be used instead of the "SUCCESS" string to see if operation was successful.



##########
broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java:
##########
@@ -103,13 +106,34 @@ public String getPassword()
     @Override
     public void setPassword(final String password)
     {
-        setAttributes(Collections.<String, Object>singletonMap(User.PASSWORD, password));
+        setAttributes(Collections.singletonMap(User.PASSWORD, password));
     }
 
     @Override
     protected void logOperation(final String operation)
     {
-        ((Container) _authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(AuthenticationProviderMessages.OPERATION(operation));
+    }
+
+    @Override
+    protected void logCreated(final Map<String, Object> attributes, final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.CREATE(getName(), "SUCCESS", String.valueOf(getActualAttributes())));
+    }
+
+    @Override
+    protected void logDeleted(final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.DELETE(getName(), "SUCCESS"));
     }
 
+    @Override
+    protected void logUpdated(final Map<String, Object> attributes, final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.UPDATE(getName(), "SUCCESS", String.valueOf(getActualAttributes())));

Review Comment:
   The outcome should be used instead of the "SUCCESS" string to see if operation was successful.



-- 
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: dev-unsubscribe@qpid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-broker-j] vavrtom merged pull request #129: QPID-8591: [Broker-J] Missing message id for add/update/delete user

Posted by GitBox <gi...@apache.org>.
vavrtom merged PR #129:
URL: https://github.com/apache/qpid-broker-j/pull/129


-- 
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: dev-unsubscribe@qpid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org