gerlowskija commented on code in PR #897:
URL: https://github.com/apache/solr/pull/897#discussion_r894482144


##########
solr/core/src/java/org/apache/solr/handler/admin/api/DefaultUpdateAuthenticationConfigAPI.java:
##########
@@ -0,0 +1,50 @@
+/*
+ * 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.handler.admin.api;
+
+import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST;
+import static 
org.apache.solr.security.PermissionNameProvider.Name.SECURITY_EDIT_PERM;
+
+import org.apache.solr.api.EndPoint;
+import org.apache.solr.handler.admin.SecurityConfHandler;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+
+/**
+ * V2 API for updating the authentication section of Solr's security.json 
configuration.
+ *
+ * <p>Only registered when no authentication plugin is currently registered. 
This API (POST
+ * /v2/cluster/security/authentication) is analogous to the v1 `POST 
/solr/admin/authentication`
+ * API.
+ */
+public class DefaultUpdateAuthenticationConfigAPI {
+  private final SecurityConfHandler securityConfHandler;
+
+  public DefaultUpdateAuthenticationConfigAPI(SecurityConfHandler 
securityConfHandler) {
+    this.securityConfHandler = securityConfHandler;
+  }
+
+  @EndPoint(
+      path = {"/cluster/security/authentication"},
+      method = POST,
+      permission = SECURITY_EDIT_PERM)
+  public void updateAuthenticationConfig(SolrQueryRequest req, 
SolrQueryResponse rsp)

Review Comment:
   Maybe we should, but I'm not sure what they would be.  This file is the 
annotation conversion for `cluster.security.authentication.Commands.json`, 
which is the POST api loaded when no authentication plugin is in use.
   
   The old apispec file didn't define any commands, and there are no examples 
in the ref-guide (afaict) that show what commands are supported in the 
no-authc-plugin case.
   
   So in short, I only did things this way because (1) I don't know what the 
concrete classes should be, and (2) this had parity with the apispec, so it 
seemed at least pass-able.
   
   (This is also the situation on DefaultUpdateAuthorizationConfigAPI below)



##########
solr/core/src/java/org/apache/solr/api/AnnotatedApi.java:
##########
@@ -335,6 +337,33 @@ void invoke(SolrQueryRequest req, SolrQueryResponse rsp, 
CommandOperation cmd) {
       }
     }
 
+    public int hashCode() {

Review Comment:
   Several of the instance variables we use to compute the hashCode here are 
non-final.  I'd bet those vars are unlikely to change in practice, but I wasn't 
confident enough in that to put in caching here, just in case.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to