简体   繁体   English

如何在 DataGrip 中从环境变量设置数据源密码?

[英]How do I set Data Source password from environment variable in DataGrip?

To connect to DB I have to make an API call to generate a token.要连接到数据库,我必须调用 API 来生成令牌。 Lets say I store this in environment variable $TOKEN .假设我将其存储在环境变量$TOKEN中。

Now while setting up my data source in DataGrip, how can I tell DataGrip to read $TOKEN environment variable as its value will keep on changing?现在在 DataGrip 中设置我的数据源时,我如何告诉 DataGrip 读取$TOKEN环境变量,因为它的值会不断变化? Because before opening DataGrip I will make the API call to generate the token and set in a environment variable via script.因为在打开 DataGrip 之前,我将调用 API 来生成令牌并通过脚本设置在环境变量中。

Is it possible to read environment variable as a password in DataGrip?是否可以在 DataGrip 中读取环境变量作为密码?

There is no such feature out of the box.开箱即用没有这样的功能。

You can create your custom plugin to provide this kind of authorisation.您可以创建自定义插件来提供这种授权。 That is the matter of implementing of on class - com.intellij.database.dataSource.DatabaseAuthProvider这是在 class - com.intellij.database.dataSource.DatabaseAuthProvider上实施的问题

See this plugin as an example.这个插件为例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM