[
https://issues.apache.org/jira/browse/NIFI-16437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124481#comment-18124481
]
ASF subversion and git services commented on NIFI-16437:
--------------------------------------------------------
Commit f026154de3f666ba5dd77140a41ead1926e76a1d in nifi's branch
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=f026154de3f ]
NIFI-16437 - Connector configuration API rejects unset asset references
returned by GET (#11777)
> 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
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)