<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nagaraju Kshathriya</title>
    <description>The latest articles on DEV Community by Nagaraju Kshathriya (@vanchiv).</description>
    <link>https://dev.to/vanchiv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F520910%2Fdbe12f1f-850d-4cc6-bcca-ca11764ae9f3.jpg</url>
      <title>DEV Community: Nagaraju Kshathriya</title>
      <link>https://dev.to/vanchiv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vanchiv"/>
    <language>en</language>
    <item>
      <title>How to access Secure Properties in DataWeave 2.0</title>
      <dc:creator>Nagaraju Kshathriya</dc:creator>
      <pubDate>Thu, 26 Nov 2020 10:35:26 +0000</pubDate>
      <link>https://dev.to/vanchiv/how-to-access-secure-properties-in-dataweave-2-0-2n21</link>
      <guid>https://dev.to/vanchiv/how-to-access-secure-properties-in-dataweave-2-0-2n21</guid>
      <description>&lt;p&gt;In this little blog, I will walk you thru how to access secure properties in dataweave 2.0.&lt;/p&gt;

&lt;p&gt;I assume you have &lt;a href="https://vanchiv.com/dev/create-application-properties-in-mule-4/"&gt;created&lt;/a&gt; and &lt;a href="https://vanchiv.com/dev/secure-properties-in-mule-4/"&gt;encrypted&lt;/a&gt; your properties. Once you configure the properties, you can read secure properties within mule component such as database, file, etc,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing in Mule Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, to read the secure properties in set payload - you can write xml like below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;flow name="sample"&amp;gt;
    &amp;lt;set-payload value="${secure::encrypted.key}"/&amp;gt;
&amp;lt;/flow&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Accessing in DataWeave&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To access secure properties in dataweave script, you need to use &lt;strong&gt;p()&lt;/strong&gt; as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%dw 2.0
output application/json
---
{
    password: p('secure::encrypted.key')
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's simple. I hope you learned something from this little blog. For more MuleSoft article, news and support - visit &lt;a href="https://vanchiv.com"&gt;Vanchiv&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>mulesoft</category>
      <category>dataweave</category>
    </item>
  </channel>
</rss>
