rondagostino commented on code in PR #14083:
URL: https://github.com/apache/kafka/pull/14083#discussion_r1298761957
##########
core/src/test/scala/unit/kafka/server/KafkaApisTest.scala:
##########
@@ -5290,8 +5290,10 @@ class KafkaApisTest {
// read the header from the buffer first so that the body can be read next
from the Request constructor
val header = RequestHeader.parse(buffer)
- val context = new RequestContext(header, "1", InetAddress.getLocalHost,
KafkaPrincipal.ANONYMOUS,
- listenerName, SecurityProtocol.PLAINTEXT, ClientInformation.EMPTY,
fromPrivilegedListener,
+ // DelegationTokens require the context authenticated to be a
+ // non SecurityProtocol.PLAINTEXT and a non KafkaPrincipal.ANONYMOUS
+ val context = new RequestContext(header, "1", InetAddress.getLocalHost,
new KafkaPrincipal(KafkaPrincipal.USER_TYPE, "Alice"),
+ listenerName, SecurityProtocol.SSL, ClientInformation.EMPTY,
fromPrivilegedListener,
Review Comment:
A comment about how we test the failure case via integration tests (e.g.
DelegationTokenRequestsOnPlainTextTest.scala) would be good to add so people
don't think we missed testing that.
--
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]