dev-resources.site
for different kinds of informations.
How to access Secure Properties in DataWeave 2.0
Published at
11/26/2020
Categories
mulesoft
dataweave
Author
vanchiv
Author
7 person written this
vanchiv
open
In this little blog, I will walk you thru how to access secure properties in dataweave 2.0.
I assume you have created and encrypted your properties. Once you configure the properties, you can read secure properties within mule component such as database, file, etc,
Accessing in Mule Components
For example, to read the secure properties in set payload - you can write xml like below,
<flow name="sample">
<set-payload value="${secure::encrypted.key}"/>
</flow>
Accessing in DataWeave
To access secure properties in dataweave script, you need to use p() as shown below:
%dw 2.0
output application/json
---
{
password: p('secure::encrypted.key')
}
That's simple. I hope you learned something from this little blog. For more MuleSoft article, news and support - visit Vanchiv.
dataweave Article's
7 articles in total
Using time() and duration() in DataWeave for performance check
read article
Main difference between 'do' and 'using' operators in DataWeave
read article
Develop your Battlesnake using a MuleSoft API & DataWeave with this starter project
read article
How to generate shareable link examples from GitHub to open in the DataWeave Playground
read article
How to move your code from the DataWeave Playground to Visual Studio Code
read article
DataWeave: accept lambda as parameter of a function
read article
How to access Secure Properties in DataWeave 2.0
currently reading
Featured ones: