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

bbotella pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3c85cfb85f Redact hash and _hash suffixed parameters in 
system_views.settings
3c85cfb85f is described below

commit 3c85cfb85f402e0f16e47083175f63e065712066
Author: Bohdan Siryk <[email protected]>
AuthorDate: Mon Sep 14 17:27:20 2026 +0300

    Redact hash and _hash suffixed parameters in system_views.settings
    
    Patch by Bohdan Siryk; reviewed by Bernardo Botella, Stefan Miklosovic for 
CASSANDRA-21686
---
 src/java/org/apache/cassandra/db/virtual/SettingsTable.java      | 3 ++-
 test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java 
b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
index b7cdcb222f..02aabf6eff 100644
--- a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
+++ b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
@@ -118,7 +118,8 @@ public final class SettingsTable extends 
AbstractVirtualTable
                 // this is done on best-effort basis as we do not have names 
in parameters
                 // inherently under control as this is what a user is 
responsible for
                 // when dealing with custom implementations
-                if (key.endsWith("_password") || key.equals("password"))
+                if (key.endsWith("_password") || key.equals("password") ||
+                    key.endsWith("_hash") || key.equals("hash"))
                     map.put(key, Redacted.REDACTED_STRING);
                 else
                     map.put(key, entry.getValue());
diff --git a/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java 
b/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java
index 05b4d15244..a3c3cf61c1 100644
--- a/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java
+++ b/test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java
@@ -125,6 +125,9 @@ public class SettingsTableTest extends CQLTester
         autoRepairOverrides.table_max_repair_time = new 
DurationSpec.IntSecondsBound("6h");
         config.auto_repair.repair_type_overrides.put("full", 
autoRepairOverrides);
 
+        config.default_role_initializer = new 
ParameterizedClass("PasswordDefaultRoleInitializer",
+                                                                 
Map.of("password_hash", 
"$2a$04$wsvzFamDJPDrTwMjgfcgpO.mKc.CMEuHBFZSjhGz2Ts6.v8PUO2rC"));
+
         table = new SettingsTable(KS_NAME, config);
         VirtualKeyspaceRegistry.instance.register(new VirtualKeyspace(KS_NAME, 
ImmutableList.of(table)));
         disablePreparedReuseForTest();
@@ -392,6 +395,9 @@ public class SettingsTableTest extends CQLTester
                     
String.format("{\"keystore_password\":\"%s\",\"keystore\":\"conf/.keystore\",\"key_password\":\"%s\"}",
                                   Redacted.REDACTED_STRING,
                                   Redacted.REDACTED_STRING));
+        assertValue("default_role_initializer.parameters",
+                    String.format("{\"password_hash\":\"%s\"}",
+                                  Redacted.REDACTED_STRING));
 
         Set<Map.Entry<String, Property>> entries = new 
DefaultLoader().flatten(Config.class)
                                                                       
.entrySet()


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

Reply via email to