Pierre Villard created NIFI-16437:
-------------------------------------

             Summary: Connector configuration API rejects unset asset 
references returned by GET
                 Key: NIFI-16437
                 URL: https://issues.apache.org/jira/browse/NIFI-16437
             Project: Apache NiFi
          Issue Type: Bug
            Reporter: Pierre Villard
            Assignee: Pierre Villard


Connector configuration authorization rejects unset asset properties 
represented as ASSET_REFERENCE values with no asset identifiers.

When an optional asset property is unset, NiFi can store it as an 
AssetReference with an empty identifier set. The Connector DTO factory 
serializes this value as an ASSET_REFERENCE with an empty assetReferences list.

If a client retrieves the configuration step and submits the returned payload 
unchanged through the configuration-step PUT or verify-config endpoint, 
AuthorizeConnectorConfigReferences.authorizeAssetReferences rejects the request 
with:
{code:java}
Asset references must be specified when value type is ASSET_REFERENCE{code}
This means that a Connector configuration returned by NiFi cannot always be 
submitted back to NiFi unchanged.

Other Connector configuration components already treat an empty AssetReference 
as an unset property:
 * StandardConnectorDAO converts a null or empty assetReferences list to an 
empty identifier set.
 * StandardConnectorNode allows an AssetReference with no identifiers as an 
unset value.
 * Connector migration can intentionally produce an empty AssetReference when a
source asset is unavailable.

The authorization check should be consistent with these semantics. A null or 
empty asset-reference collection contains no resource requiring authorization 
and should therefore be treated as a no-op. Connector WRITE authorization must 
still be required.



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

Reply via email to