Jimvin opened a new pull request, #11981: URL: https://github.com/apache/nifi/pull/11981
- Resolve pasted instance identifiers through the same lookup used to copy sensitive property values, including Controller-level Controller Services and Connector-managed components - Require READ on each resolved Processor and Controller Service before sensitive values are copied <!-- 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. --> # Summary Aligns authorisation of pasted instance identifiers with the lookup used to copy sensitive property values. `ProcessGroupResource.authorizeInstanceIds()` previously searched only the root Process Group hierarchy for Processors and Controller Services referenced through `instanceIdentifier`. `StandardNiFiServiceFacade.copySensitiveProcessorProperties()` and `copySensitiveServiceProperties()` resolve the same identifiers through `FlowManager`, which also returns Controller-level Controller Services and Connector-managed components. Changes: - Resolve instance identifiers through `AuthorizableLookup.forConnectorManagedFlow()`. Its `getProcessor()` and `getControllerService()` methods use `locateProcessor(id, true)` and `locateControllerService(id, true)`, which resolve through the same `FlowManager` and `ControllerServiceProvider` lookups as the copy methods. - Require READ on each resolved component, as before. - Skip identifiers that are not found locally, as before. No sensitive values are copied for those, so pasting content from another instance continues to work. - Change `authorizeInstanceIds()` to a static method that takes the `Authorizer` and `NiFiUser`, so that it can be tested directly. - Add unit tests for readable, unreadable and missing Controller Services and for an unreadable Processor. Despite its name, `forConnectorManagedFlow()` is used here because it is the existing lookup that covers the whole flow, Connector-managed components included. If a lookup with a more neutral name is preferred, I can add one. -- 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]
