You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "sharanggupta (via GitHub)" <gi...@apache.org> on 2026/10/25 19:05:51 UTC
Re: [PR] MINOR: Use Locale.ROOT for the SCRAM iteration count and remove the unused credential string format [kafka]
sharanggupta commented on code in PR #23909:
URL: https://github.com/apache/kafka/pull/23909#discussion_r4372030608
##########
clients/src/main/java/org/apache/kafka/common/security/scram/internals/ScramCredentialUtils.java:
##########
@@ -41,7 +42,8 @@ public final class ScramCredentialUtils {
private ScramCredentialUtils() {}
public static String credentialToString(ScramCredential credential) {
Review Comment:
Agreed. `credentialToString`/`credentialFromString` (the ZooKeeper credential-store format) have no callers left outside `ScramCredentialUtilsTest`, so I removed them together with `toProps`, the field-name constants and the tests that only exercised them. `createCache` stays (still used by `CredentialProvider` and `DelegationTokenCache`), and so does its `scramCredentialCache` test. The `Locale.ROOT` fix is now only in `ServerFirstMessage.toMessage()`.
##########
clients/src/test/java/org/apache/kafka/common/security/scram/internals/ScramMessagesTest.java:
##########
@@ -166,6 +167,26 @@ public void validServerFirstMessage() throws SaslException {
}
}
+ @Test
+ public void serverFirstMessageUsesAsciiDigitsRegardlessOfDefaultLocale() throws SaslException {
+ String clientNonce = formatter.secureRandomString();
+ String serverNonce = formatter.secureRandomString();
+ String nonce = clientNonce + serverNonce;
+ String salt = randomBytesAsString();
+
+ // Under a default locale with native digits (e.g. ar-EG formats %d as Arabic-Indic digits) the
+ // iteration count must still be sent as ASCII digits, otherwise clients cannot parse the message
+ Locale defaultLocale = Locale.getDefault();
+ Locale.setDefault(Locale.forLanguageTag("ar-EG"));
Review Comment:
Done, `serverFirstMessageUsesAsciiDigitsRegardlessOfDefaultLocale` now carries `@ResourceLock(Resources.LOCALE)`. The other locale test went away with the removed credential string format.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org