Bob Paulin created NIFI-16435:
---------------------------------

             Summary: [Connectors] Ensure external configuration does not 
include properties/steps not declared on Connector
                 Key: NIFI-16435
                 URL: https://issues.apache.org/jira/browse/NIFI-16435
             Project: Apache NiFi
          Issue Type: Task
            Reporter: Bob Paulin


Saving a connector step through a {{ConnectorConfigurationProvider}} never 
removed a property the connector no longer declares. The provider overwrites 
its stored configuration with whatever the framework hands it, so the provider 
wasn't the problem. Before saving, 
{{StandardConnectorRepository.buildMergedWorkingConfiguration}} loaded the 
existing external configuration and laid the incoming step on top of it. Every 
stored key was carried forward, including ones that were renamed or removed.

 

{{buildMergedWorkingConfiguration}} now filters the loaded configuration 
against the connector's declared steps before merging. Steps and properties the 
connector doesn't declare are dropped, an incoming property the connector 
doesn't declare is skipped, and an undeclared step is never recreated. The 
filter applies on every save, with no special case for a connector that 
declares no steps; the REST endpoint already rejects step updates for those. A 
system test, {{{}ConnectorUndeclaredExternalPropertyIT{}}}, starts with an 
external configuration holding an undeclared property and checks that the saved 
file no longer has it; a new unit test checks the same merge rules. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to