dwsmith1983 commented on code in PR #7127:
URL: https://github.com/apache/datafusion-comet/pull/7127#discussion_r4501043014
##########
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:
Fixed in 79b5b4faf. `redact` now hides every URI secret whatever its length;
the eight-character floor applies only to configured values, so a value like
`true` still reads as is. The password is also taken from the raw authority,
the same text Hadoop uses for the container, so a host that makes the authority
registry-based (an underscore, say) no longer drops it. The new tests run your
JCEKS recovery failure with a seven-character password and check that the
driver warning shows `client.secret.data:<redacted>.<account>`.
--
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]