[
https://issues.apache.org/jira/browse/NIFI-15842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18073795#comment-18073795
]
ASF subversion and git services commented on NIFI-15842:
--------------------------------------------------------
Commit 775dd9d7cfb5f0e9b55ce00f82fb378ea33b0af3 in nifi's branch
refs/heads/main from Kevin Doran
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=775dd9d7cfb ]
NIFI-15842 Fix fetching secrets with null fullyQualifiedName (#11143)
SecretReference objects with a providerName but no fullyQualifiedName
(e.g., from a connector configuration provider with unset secret
properties) caused a NullPointerException in the default
ParameterProvider.fetchParameters implementation. The null FQN was
added to the secret names list and passed to startsWith(), which
does not accept null.
Filter null fullyQualifiedName values from the secret names list in
both fetchSecretsWithoutCache and fetchSecretsWithCache before passing
them to the ParameterProvider. References with null FQN are mapped to
a null Secret (unresolved), consistent with the existing behavior for
references with no matching provider.
> NPE in ParameterProviderSecretsManager when SecretReference has null
> fullyQualifiedName
> ---------------------------------------------------------------------------------------
>
> Key: NIFI-15842
> URL: https://issues.apache.org/jira/browse/NIFI-15842
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 2.9.0
> Reporter: Kevin Doran
> Assignee: Kevin Doran
> Priority: Major
> Fix For: nifi-api-2.9.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> When a connector's configuration contains a SECRET_REFERENCE property with
> providerName populated but fullyQualifiedSecretName set to null (representing
> a secret-type property that has not been configured yet), the NiFi framework
> throws a NullPointerException during connector installation:
>
> {code}
> Error fetching parameters for ParameterProvider[id=...]: Cannot invoke
> "String.startsWith(String)" because "fqn" is null
> {code}
>
> *Root cause:*
>
> {\{ParameterProviderSecretsManager}} collects \{{fullyQualifiedName}} from
> all \{{SecretReference}} objects into a list and passes it to
> \{{ParameterProvider.fetchParameters()}}. When a reference has a null FQN
> (valid state — the secret property is defined but not yet configured), the
> null is added to the list. The default \{{fetchParameters(context, list)}}
> implementation in \{{ParameterProvider}} iterates the list and calls
> \{{startsWith()}} on each entry, which throws NPE on the null.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)