upload password in datasource for Postgresql #275
-
|
Hello, example: datasource-db1.yaml datasources:
I exported the same and got like this: { without password. I uploaded the test.json like this { but it's not exported with password and I need to set the password manually. What should I do ? Thanks. PS: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I haven't tested the Postgres data specifically for this. The annoying part with the datasources/connections is that they all have a slightly different behavior. There is no standard way of say setting a username/password. There might be a bug but I need to dig a bit deeper, though even once it's fixed, let me clarify a few things. Anything that is securedata in the payload, specifically "secureJsonData" gets loaded from your exports 'secure/filename.json' that resides in the exports folder. You match the secure data to a connection with the credential_rules. If none match, it'll try to return default.json from the secure folder if one exists. I haven't seen a behavior where basicAuth is false and it has credentials, so will need to do a fix on this. I'm currently only setting secureJSONData when basicAuth is enabled, so GDG currently won't work for your use case. I'll see about getting a quick fix, or if you want to do a MR, the issue is: https://github.com/esnet/gdg/blob/master/internal/service/connections.go#L151 Once that's fixed, I imagine something like: {
"password": "password",
"user": "user"
}Should work. Also, I converted this issue into a conversation and created bug: #276 for the bug in question. |
Beta Was this translation helpful? Give feedback.
-
|
Actually I misspoke. This works without any changes. Here's my configuration: context_name: testing
contexts:
testing:
output_path: test/data
connections:
credential_rules:
- rules:
- field: "name"
regex: "PostgreSQL"
secure_data: "db.json"
- rules:
- field: "name"
regex: ".*"
secure_data: "default.json"
url: http://localhost:3000
user_name: admin
password: admin
watched:
- General
- Othersecure/db.json {
"password": "secret"
}gdg -c config/testing.yml backup c clear
gdg -c config/testing.yml backup uploadI confirmed the connection against a docker postgres container was re-created successfully. This is the connection type I'm using: |
Beta Was this translation helpful? Give feedback.
Actually I misspoke. This works without any changes. Here's my configuration:
secure/db.json
{ "password": "secret" }I confirmed the connection against a docker postg…