bbende commented on a change in pull request #4968:
URL: https://github.com/apache/nifi/pull/4968#discussion_r605752399



##########
File path: 
nifi-nar-bundles/nifi-single-user-iaa-providers-bundle/nifi-single-user-iaa-providers/src/main/java/org/apache/nifi/authorization/single/user/SingleUserAuthorizer.java
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.nifi.authorization.single.user;
+
+import org.apache.nifi.authorization.AuthorizationRequest;
+import org.apache.nifi.authorization.AuthorizationResult;
+import org.apache.nifi.authorization.Authorizer;
+import org.apache.nifi.authorization.AuthorizerConfigurationContext;
+import org.apache.nifi.authorization.AuthorizerInitializationContext;
+import org.apache.nifi.authorization.exception.AuthorizationAccessException;
+import org.apache.nifi.authorization.exception.AuthorizerCreationException;
+import org.apache.nifi.authorization.exception.AuthorizerDestructionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Single User Authorizer
+ */
+public class SingleUserAuthorizer implements Authorizer {

Review comment:
       Is there some way this could be linked together with the identity from 
the SingleUserLoginIdentityProvider?
   
   This is really more of a no-op authorizer that just authorizes everything 
regardless of the user identity. For example, if a request was made with a 
client cert then it would be authorized to do anything, even if that identity 
was not the username of the SingleUserLoginIdentityProvider. Maybe not an issue 
if this is only intended for local use.
   
   I'm not exactly sure how the coordination between identity providers and 
authorizers would work though, since they purposely don't know about each 
other. The only idea that comes to mind is if the single-user identity came 
from nifi.properties since they both have access to that. Alternatively, could 
maybe use the existing file-based providers, but have someway to setup the 
initial user / initial admin with the single-user identity, then eliminate the 
need for a new Authorizer implementation.




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

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


Reply via email to