Your connector handles sensitive data, including credentials, PII, and secrets. Apply these guidelines to keep that data out of source control, logs, and response payloads.
Your connector handles sensitive data, including:
Credentials: API keys, tokens, and passwords
PII (personally identifiable information): Personal information such as names, emails, and addresses
Secrets: Any value that must remain confidential
This guide uses “credentials” for authentication data and “sensitive data” for all confidential information.
Don't Hardcode Secrets
Hardcoded API keys, tokens, and passwords ship to every subscriber org and persist in source control.
Do: Read credentials from environment variables that your runtime injects, not from hardcoded values in your script.
Don’t: Inline credential values as DataWeave variables.
DataWeave log() output appears in customer debug logs. Full payloads leak tokens, personally identifiable information (PII), and credentials into every customer’s logging backend.
Do: Log only specific scalar fields that you’ve confirmed are safe to expose.
Don’t: Pass payload or other composite values into log().
The envVar() and envVars() functions return system properties that often hold secrets. When you echo them into a response shape, those secrets leak to Flow Builder and downstream consumers.
Do: Use envVar(“WHITELISTED_KEY”) for narrowly scoped lookups when justified.
Don’t: Use envVars() or echo system properties into output.
Example
Vulnerable
1import * from dw::System2---3{ env: envVars() }
Secure
1import * from dw::System2---3{ serviceMode: envVar("SERVICE_MODE") }