bbende commented on a change in pull request #4968: URL: https://github.com/apache/nifi/pull/4968#discussion_r605781607
########## 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: Yea I agree that the client cert example is probably not realistic, but I guess my general concern was just providing an authorizer that allows everything. I assume the goal here is to eventually have this enabled by default, so I am picturing a user who is trying to switch away from the defaults and not knowing, or forgetting, and leaving this authorizer enabled. I think the only way to make the username available across the board is if the single-user concept was in the framework at a higher level then the provider implementations, and by the time the provider's load their config, it was already populated with the single-user stuff. Something like in nifi.properties... ``` nifi.security.single.user.mode.enabled=true nifi.security.single.user.identity= nifi.security.single.user.password= ``` The framework would generate these values and write them out to nifi.properties, then the identity provider and authorizer would get an instance of NiFiProperties and get these values and fail if they weren't populated. Maybe password would not be in nifi.properties and still in the identity provider (?). I obviously haven't put that much thought into this, and not trying to derail your efforts, just throwing out ideas. If you don't think there is sufficient concern about the authorizer, I won't get too hung up on it. -- 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: [email protected]
