Copilot commented on code in PR #5439:
URL: https://github.com/apache/solr/pull/5439#discussion_r4802370945


##########
solr/core/src/java/org/apache/solr/security/PKIAuthenticationPlugin.java:
##########
@@ -133,18 +155,25 @@ public boolean doAuthenticate(
     // Getting the received time must be the first thing we do, processing the 
request can take time
     long receivedTime = System.currentTimeMillis();
 
-    String headerV2 = request.getHeader(HEADER_V2);
-    if (headerV2 == null) {
-      return sendError(response, "No PKI auth header was provided");
-    }
+    PKIHeaderData headerData;
+    String headerV3 = findAcceptedHeaderV3(request);
+    if (headerV3 != null) {
+      headerData = validatedV3HeaderCache.get(headerV3);

Review Comment:
   Please add explicit dual-header tests for this selection policy. The 
unit-test request mock exposes only one header name at a time, and the 
integration test supplies valid tokens for both profiles, so it would still 
pass if V2 were always selected. Cover a valid V3 with an invalid V2, an 
unaccepted V3 with a valid V2, and an invalid accepted V3 with a valid V2 to 
protect the preference and downgrade behavior.



-- 
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]

Reply via email to