Skip to content

Commit

Permalink
Fixed unused field in hiding passwords (strimzi#877)
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Patierno <[email protected]>
  • Loading branch information
ppatierno committed Mar 3, 2024
1 parent afbf0a3 commit e1180e4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/io/strimzi/kafka/bridge/config/KafkaConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static KafkaConfig fromMap(Map<String, Object> map) {

@Override
public String toString() {
Map<String, Object> configToString = this.hidingPasswords(this.config);
Map<String, Object> configToString = this.hidePasswords();
return "KafkaConfig(" +
"config=" + configToString +
",consumerConfig=" + this.consumerConfig +
Expand All @@ -93,12 +93,10 @@ public String toString() {
* Hides Kafka related password(s) configuration (i.e. truststore and keystore)
* by replacing each actual password with [hidden] string
*
* @param config configuration where to do the replacing
* @return updated configuration with hidden password(s)
*/
private Map<String, Object> hidingPasswords(Map<String, Object> config) {
Map<String, Object> configToString = new HashMap<>();
configToString.putAll(this.config);
private Map<String, Object> hidePasswords() {
Map<String, Object> configToString = new HashMap<>(this.config);
configToString.entrySet().stream()
.filter(e -> e.getKey().contains("password"))
.forEach(e -> e.setValue("[hidden]"));
Expand Down

0 comments on commit e1180e4

Please sign in to comment.