wuqingjun opened a new pull request, #24429: URL: https://github.com/apache/kafka/pull/24429
`PlainSaslServer.evaluateResponse` reported PLAIN authentication failures as `Authentication failed: Invalid username or password` with no username, so broker logs could not identify which client was misconfigured — especially under Kubernetes, where the host/IP is not meaningful. This includes the client-supplied username in the PLAIN failure messages: - `Authentication failed for user <name>: password not specified` - `Authentication failed for user <name>: credentials could not be verified` - `Authentication failed for user <name>: Invalid username or password` - `Authentication failed for user <name>: Client requested an authorization id that is different from username` The username is the client's own value and the exception message already returns to that client, so no new information is disclosed. Bad-username and bad-password still produce the same message, so username enumeration is not enabled, and the password is never included. Carries forward the approach of #9445, which was auto-closed as stale. ### Tests Updated `PlainSaslServerTest`, `SaslAuthenticatorTest`, and `SaslAuthenticatorFailureDelayTest`. `:clients:checkstyleMain` and `PlainSaslServerTest` pass locally. -- 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]
