Skip to content

Commit

Permalink
KC-1752 Remove public facing String redact API which is not currently…
Browse files Browse the repository at this point in the history
… used
  • Loading branch information
YiDing-Duke committed Jun 7, 2021
1 parent 4c75baf commit 4f3fb7a
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,29 +172,14 @@ public int hashCode() {
}

/**
* Override toString not to print values by default in case there are secret fields or secret fields but incorrectly
* marked as isSensitive = false.
* Override toString to redact sensitive value.
* WARNING, user should be responsible to set correct "senstive" field for each config entry.
*/
@Override
public String toString() {
return "ConfigEntry(" +
"name=" + name +
", value=Omitted" +
", source=" + source +
", isSensitive=" + isSensitive +
", isReadOnly=" + isReadOnly +
", synonyms=" + synonyms +
")";
}

/**
* Convert the object to String value with sensitive fields be to redacted.
* WARNING: the caller MUST make sure all sensitive fields have been marked as isSensitive = true.
*/
public String configEntryToRedactedString() {
return "ConfigEntry(" +
"name=" + name +
", value=" + (isSensitive ? "redacted" : value) +
", value=" + (isSensitive ? "Redacted" : value) +
", source=" + source +
", isSensitive=" + isSensitive +
", isReadOnly=" + isReadOnly +
Expand Down

0 comments on commit 4f3fb7a

Please sign in to comment.