英文:
wso2 micro integrator assign properties to DB connection
问题
在我的一个ESB构件中,我已经包含了一个DB中介程序。以下是代码的一部分...
<dbreport>
<connection>
<pool>
<driver>com.mysql.cj.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/wso2_sessions</url>
<user>testUser</user>
<password>myownpassword!</password>
</pool>
</connection>
<statement>
<sql><![CDATA[my SQL statement]]></sql>
</statement>
</dbreport>
我想将"myownpassword!" 存储为加密的形式。我知道如何在deployment.toml中设置加密的秘密存储库,然后在ESB代码中调用它们,即
<property expression="wso2:vault-lookup('db_password')" name="db_password" scope="default" type="STRING"/>
其中db_password是分配给加密文本的别名。但我如何引用加密的密码以将其分配给连接池呢?
感谢您的帮助
英文:
In one of my ESB artifacts, I’ve included a DB Mediator . Here is the part of the code…
...
<dbreport>
<connection>
<pool>
<driver>com.mysql.cj.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/wso2_sessions</url>
<user>testUser</user>
<password>myownpassword!</password>
</pool>
</connection>
<statement>
<sql><![CDATA[my SQL statement]]></sql>
</statement>
</dbreport>
I'd like to store myownpassword! encrypted. I got how to set encrypted secret vaults in deployment.toml and then call them within the ESB code, i.e.
<property expression="wso2:vault-lookup('db_password')" name="db_password" scope="default" type="STRING"/>
where db_password is the alias assigned to the encrypted text.
But how can I refer to the encrypted password so to assign it to the connection pool?
Thanks for help
答案1
得分: 1
AFAIK,你不能直接在DB池配置中引用安全保险库条目。因此,一种方法是将条目保存在注册表中,然后从注册表中检索它。但是,这仍然不允许你加密密码。
另一种选择是创建一个外部数据源,然后引用数据源,而不是在synapse执行流中包含DB连接详细信息。外部数据服务将允许你加密敏感数据。
英文:
AFAIK you can't directly refer to secure vault entries in your DB pool configs. So one way is to save the entries in the registry and then retrieve it from the registry. But still, this will not allow you to encrypt the password.
Another option is to create an external datasource and then refer to the Datasource rather than having the DB connection details in the synapse execution flow. External Dataservices will allow you to encrypt sensitive data.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论