rich7420 commented on code in PR #7127:
URL: https://github.com/apache/datafusion-comet/pull/7127#discussion_r4485081743
##########
spark/src/main/scala/org/apache/comet/objectstore/AbfsAuthResolver.scala:
##########
@@ -537,15 +537,37 @@ private[comet] object AbfsAuthResolver extends Logging {
/**
* Hides every `secret` of at least [[MIN_REDACTED_LENGTH]] characters in
`message`, and the raw
- * key a `SimpleKeyProvider` message quotes.
+ * key a `SimpleKeyProvider` message quotes. Secrets are matched in the same
text, so one that
+ * overlaps or contains another is hidden whole, and each run of hidden
characters becomes one
+ * marker.
*/
private[objectstore] def redact(message: String, secrets: Iterable[String]):
String = {
- val withoutQuotedKey = QUOTED_KEY_PATTERN.replaceAllIn(message, "key =\""
+ REDACTED + "\"")
- secrets
- .filter(_.length >= MIN_REDACTED_LENGTH)
- .foldLeft(withoutQuotedKey)((text, secret) => text.replace(secret,
REDACTED))
+ val text = QUOTED_KEY_PATTERN.replaceAllIn(message, "key =\"" + REDACTED +
"\"")
+ val hidden = new Array[Boolean](text.length)
+ secrets.filter(_.length >= MIN_REDACTED_LENGTH).foreach { secret =>
Review Comment:
`uriSecrets` still feeds known passwords through the eight-character cutoff.
A JCEKS recovery failure prints a seven-character ABFS password in the driver
warning's credential alias. Mask known URI secrets regardless of length.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]