Assign properties to DB connection in WSO2 Micro Integrator.

huangapple go评论45阅读模式
英文:

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是分配给加密文本的别名。但我如何引用加密的密码以将其分配给连接池呢?

感谢您的帮助 Assign properties to DB connection in WSO2 Micro Integrator.

英文:

In one of my ESB artifacts, I’ve included a DB Mediator . Here is the part of the code…

...            
&lt;dbreport&gt;
                &lt;connection&gt;
                    &lt;pool&gt;
                        &lt;driver&gt;com.mysql.cj.jdbc.Driver&lt;/driver&gt;
                        &lt;url&gt;jdbc:mysql://localhost:3306/wso2_sessions&lt;/url&gt;
                        &lt;user&gt;testUser&lt;/user&gt;
                        &lt;password&gt;myownpassword!&lt;/password&gt;
                    &lt;/pool&gt;
                &lt;/connection&gt;
                &lt;statement&gt;
                    &lt;sql&gt;&lt;![CDATA[my SQL statement]]&gt;&lt;/sql&gt;
                &lt;/statement&gt;
            &lt;/dbreport&gt;           

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.

&lt;property expression=&quot;wso2:vault-lookup(&#39;db_password&#39;)&quot; name=&quot;db_password&quot; scope=&quot;default&quot; type=&quot;STRING&quot;/&gt;

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 Assign properties to DB connection in WSO2 Micro Integrator.

答案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.

Assign properties to DB connection in WSO2 Micro Integrator.

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.

huangapple
  • 本文由 发表于 2023年5月22日 17:33:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76304791.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定