Search code examples
wso2wso2-micro-integrator

WSO2 Micro Integrator 4.2.0 wso2:vault-lookup() returning alias name and not encrypted password


I did add the secret to my deployment.toml and then encrypt it using the cipher-tool.sh:

[secrets]
orga_client_key = "NuwQtop76Oq6OAWGpkhywAeLkRj1nPiAFlBMzmni2FZO/APTp5EyKl6Hc+xlb5pBUdo3C/cd32eyzGHf/LjtCaSg8CaspYa35au0H19pP5h/9pymnqiKvdXFocbDuNLoFvKp4lMGbh9rd8DmMn6kzerTmAFb1PsvxjCSB$=="

My problem is that then when i try to acces this secret from synapse mediation i only get the alias name itself.

synapse log mediator:

<log level="custom">
   <property expression="wso2:vault-lookup('orga_client_key')" name="TEST KEY"/>
</log>

console log:

INFO {org.apache.synapse.mediators.builtin.LogMediator} - TEST KEY = orga_client_key

Which is the string I am passing.

I found these two that reference the same problem but I'm struggling understanding is there' s a solution to it.

https://github.com/wso2/micro-integrator/issues/2050 https://github.com/wso2/devstudio-tooling-ei/issues/1085

Thanks

Tried encrypting password with WSO2 MI and the cipher-tool. Want the password to be accesible in the mediation flow but function only returns string.


Solution

  • I figured out what the problem was. Basically the encryption was done correctly but starting the server (in a linux env) with:

    sh ./micro-integrator.sh start
    

    I also needed to place the keystore password in a password-persist file in the micro integrator home.