bachmanity1 commented on code in PR #15475:
URL: https://github.com/apache/kafka/pull/15475#discussion_r1669346859
##########
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/HttpAccessTokenRetrieverTest.java:
##########
@@ -174,33 +176,39 @@ public void testParseAccessTokenInvalidJson() {
}
@Test
- public void testFormatAuthorizationHeader() {
- assertAuthorizationHeader("id", "secret");
+ public void testFormatAuthorizationHeader() throws
UnsupportedEncodingException {
+ assertAuthorizationHeader("id", "secret", false);
}
@Test
- public void testFormatAuthorizationHeaderEncoding() {
+ public void testFormatAuthorizationHeaderEncoding() throws
UnsupportedEncodingException {
// See KAFKA-14496
- assertAuthorizationHeader("SOME_RANDOM_LONG_USER_01234",
"9Q|0`8i~ute-n9ksjLWb\\50\"AX@UUED5E");
+ assertAuthorizationHeader("SOME_RANDOM_LONG_USER_01234",
"9Q|0`8i~ute-n9ksjLWb\\50\"AX@UUED5E", false);
+ // See KAFKA-16345
+ assertAuthorizationHeader("user!@~'", "secret-(*)!", true);
}
- private void assertAuthorizationHeader(String clientId, String
clientSecret) {
+ private void assertAuthorizationHeader(String clientId, String
clientSecret, boolean urlencode) throws UnsupportedEncodingException {
Review Comment:
yeah, I think your suggestion is good. I've updated the code.
--
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]