Which XML tag in global.xml do you use to add a secure config file?

Prepare for the MuleSoft Developer 2 Certification Exam. Access practice quizzes featuring flashcards and multiple choice questions with explanations. Get confident and ready for your certification success!

Multiple Choice

Which XML tag in global.xml do you use to add a secure config file?

Explanation:
The main idea here is how to wire a secure properties file into Mule’s runtime so encrypted values can be used by the application. In the global configuration, you declare a secure-properties:config element and point it to the file that stores the encrypted properties, while also specifying which property in that file should be loaded and decrypted. The file attribute identifies the location of the secure properties file (for example on the classpath or a file path). The key attribute names the specific property within that file that you want Mule to expose to the runtime. Together, these two attributes allow Mule to load and decrypt the secure value so it can be referenced in your flows, such as using ${yourKey} where needed. That’s why the correct form uses both file and key attributes in the same tag, ensuring Mule knows both which file to read and which property to process. A snippet in typical usage would look like a self-closing tag with both attributes, for example: <secure-properties:config file="classpath:secure.properties" key="db.password" />. If the key attribute is omitted, Mule wouldn’t know which property to load; altering the attribute presence or order would break the configuration.

The main idea here is how to wire a secure properties file into Mule’s runtime so encrypted values can be used by the application. In the global configuration, you declare a secure-properties:config element and point it to the file that stores the encrypted properties, while also specifying which property in that file should be loaded and decrypted. The file attribute identifies the location of the secure properties file (for example on the classpath or a file path). The key attribute names the specific property within that file that you want Mule to expose to the runtime. Together, these two attributes allow Mule to load and decrypt the secure value so it can be referenced in your flows, such as using ${yourKey} where needed.

That’s why the correct form uses both file and key attributes in the same tag, ensuring Mule knows both which file to read and which property to process. A snippet in typical usage would look like a self-closing tag with both attributes, for example: <secure-properties:config file="classpath:secure.properties" key="db.password" />. If the key attribute is omitted, Mule wouldn’t know which property to load; altering the attribute presence or order would break the configuration.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy