In an Anypoint project I have a Database Config which uses secure property placeholders. In the Secure Properties Config I have key
set to ${key}
, and then define the key
variable in the environment of the run configuration for the project. This works just fine for decrypting the secure properties when running the project in Studio or when deploying it, and since the value of key
is in my Studio preferences rather than in the project it doesn't get included in the project's Git repository.
However, I encounter a problem when I want to use "Test Connection" in the Database Config. Since "Test Connection" isn't running in an app launched by Studio it doesn't have access to the run configuration environment, and without the key it can't decrypt the properties for the DB connection. This means Studio can't connection to the DB to get the schema for metadata propagation.
I've found two workarounds:
- Paste the actual key into the key field, hit okay, test the DB connection, then go back and replace the actual key with
${key}
. - Launch Studio with the environmental variable
key
set to the actual key.
However, both of these methods are clunky. Is there any way so that instead a "Test Connection" can somehow get the key value from a run configuration?