dsmiley commented on code in PR #4120:
URL: https://github.com/apache/solr/pull/4120#discussion_r2902120922


##########
solr/core/src/java/org/apache/solr/security/AuthorizationUtils.java:
##########
@@ -43,6 +45,7 @@ private AuthorizationUtils() {
     /* Private ctor prevents instantiation */
   }
 
+  @SuppressWarnings("ClassCanBeRecord")

Review Comment:
   why suppress this warning?  It doesn't fail the build; does it?  This seems 
like a suitable record.



##########
solr/core/src/java/org/apache/solr/servlet/RequiredSolrRequestFilter.java:
##########
@@ -77,6 +78,9 @@ protected void doFilter(HttpServletRequest req, 
HttpServletResponse res, FilterC
 
       // we want to prevent any attempts to close our request or response 
prematurely
       chain.doFilter(closeShield(req), closeShield(res));
+    } catch (SolrException e) {

Review Comment:
   good catch



##########
solr/core/src/java/org/apache/solr/servlet/AuthenticationFilter.java:
##########
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.servlet;
+
+import static org.apache.solr.common.SolrException.ErrorCode.SERVER_ERROR;
+import static org.apache.solr.security.AuditEvent.EventType.ANONYMOUS;
+import static org.apache.solr.security.AuditEvent.EventType.AUTHENTICATED;
+import static org.apache.solr.security.AuditEvent.EventType.REJECTED;
+
+import io.opentelemetry.api.trace.Span;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.FilterConfig;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.core.CoreContainer;
+import org.apache.solr.security.AuditEvent;
+import org.apache.solr.security.AuthenticationPlugin;
+import org.apache.solr.security.PKIAuthenticationPlugin;
+import org.apache.solr.security.PublicKeyHandler;
+import org.apache.solr.util.tracing.TraceUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A servlet filter to handle authentication. Anything that needs to be served 
without
+ * authentication (such as UI) must be resolved and returned by a filter 
preceding this one,
+ * typically by forwarding to the default servlet. Also, any tracing, auditing 
and ratelimiting

Review Comment:
   > Anything that needs to be served without authentication (such as UI) must 
be resolved and returned by a filter preceding this one,  typically by 
forwarding to the default servlet.
   
   This statement is false; it presumes that the only way to do this is the way 
it's working now.  I will show how to do so in a follow-on PR but have been 
waiting for this PR and others to land.  



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