[ 
https://issues.apache.org/jira/browse/NIFI-11763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17743802#comment-17743802
 ] 

Dirk Hennig commented on NIFI-11763:
------------------------------------

Hello David, thanks for this idea. Unfortunately this idea would remove the 
dynamic of the NiFi flow and I would have to update plenty of this 
UpdateAttribute processors every time I changed the values. This is costing 
lots of efforts frequently and therefore not useful for me.
In ExecuteGroovyScript you can also read sensitive parameters from context 
using evaluateAttributeExpressions. 
This has not been removed in  NIFI-10674.

FlowFile flowFile = session.get()
if (!flowFile) return
def pw = 
context.newPropertyValue('''#\{Secret}''').evaluateAttributeExpressions().getValue()
flowFile = session.putAttribute(flowFile, 'Secret', pw)

Unfortunately this evaluation is during compile time of the script body and 
cannot use flowfile attributes or variables.
It looks like I need to switch to a different way to store my configurations, 
like database etc. 
Is it not possible to prevent just the access to sensitive parameters but allow 
others when evaluating expressions?
Greetings, Dirk

> evaluateELString not evaluating ContextParameters
> -------------------------------------------------
>
>                 Key: NIFI-11763
>                 URL: https://issues.apache.org/jira/browse/NIFI-11763
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.21.0, 1.22.0
>         Environment: Linux NiFi 3 nodes cluster - 8 CPU core +32 GB of RAM 
> per node
>            Reporter: Dirk Hennig
>            Priority: Major
>         Attachments: Complex_UpdateAttribute_Test.json
>
>
> When using Expression Language it was possible to lookup parameters from 
> ContextParameters and variables from VariableRegistry. Examples:
> ${ literal('#\{Tenant-Testing-HOST1}'):evaluateELString() }
> ${ literal('${Testvar}'):evaluateELString() }
> Both were working in NiFi 1.18.0. Now with NiFi version 1.21.0 this stopped 
> working for ContextParameters and only lookups of varaibles are working. 
> Please see the attached template with an example flow.



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

Reply via email to