[ 
https://issues.apache.org/jira/browse/ARTEMIS-6049?focusedWorklogId=1019425&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1019425
 ]

ASF GitHub Bot logged work on ARTEMIS-6049:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/May/26 18:05
            Start Date: 08/May/26 18:05
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on code in PR #6419:
URL: https://github.com/apache/artemis/pull/6419#discussion_r3210495489


##########
artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTestIndividualSettings.java:
##########
@@ -84,4 +90,38 @@ private boolean fileContains(File file, String search) {
       }
       return false;
    }
+
+   @Test
+   public void testMaskClusterPassword() throws Exception {
+      final String password = RandomUtil.randomUUIDString();
+
+      Create c = new Create();
+      Create.enableInput();
+      try {
+         InputReader inputReader = Mockito.mock(InputReader.class);
+         
Mockito.when(inputReader.readPassword(Mockito.anyString())).thenReturn(password);
+         c.setLineReader(inputReader);
+
+         
assertEquals(PasswordMaskingUtil.wrap(PasswordMaskingUtil.getDefaultCodec().encode(password)),
 c.getClusterPassword());
+      } finally {
+         Create.disableInput();
+      }
+   }
+
+   @Test
+   public void testMaskAdminPassword() throws Exception {
+      final String password = RandomUtil.randomUUIDString();
+
+      Create c = new Create();
+      Create.enableInput();
+      try {
+         InputReader inputReader = Mockito.mock(InputReader.class);
+         
Mockito.when(inputReader.readPassword(Mockito.anyString())).thenReturn(password);

Review Comment:
   Agreed.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1019425)
    Time Spent: 1h  (was: 50m)

> Mask cluster-password specified via create command
> --------------------------------------------------
>
>                 Key: ARTEMIS-6049
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-6049
>             Project: Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Currently when a broker is created we ask for admin user and password values. 
> This password is hashed before it is stored in the 
> {{artemis-users.properties}} file. However, when creating a clustered broker 
> (e.g. using the {{--clustered}} switch) we ask for cluster-user and 
> cluster-password values, but we don't mask the cluster-password value when it 
> is stored in {{broker.xml}}. We should mask the cluster-password with the 
> default sensitive string codec.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to