dosubot[bot] commented on issue #35644:
URL: https://github.com/apache/superset/issues/35644#issuecomment-3406885492

   <!-- Answer -->
   To pass passwords for multiple databases in your API call, use the 
`passwords` form field as a JSON string mapping each database YAML path (as it 
appears in your zip, e.g., `databases/Reporting.yaml`, 
`databases/Superset_metadb.yaml`) to its password. The keys must match the file 
paths exactly, including case and directory structure. For example:
   
   ```bash
   --form 'passwords={"databases/Reporting.yaml":"'"$REPORTING_PASS"'", 
"databases/Superset_metadb.yaml":"'"$SUPERSET_DB_PASS"'"}'
   ```
   
   Your curl command should look like:
   
   ```bash
   curl -k -s -w "%{http_code}" -b cookies.txt -o 
"${asset_type}_response_body.txt" \
     --url "https://superset.test.com/api/v1/database/import/"; \
     --header 'accept: application/json' \
     --header "Authorization: Bearer $ACCESS_TOKEN" \
     --header 'content-type: multipart/form-data' \
     --header "referer: https://superset.test.com"; \
     --header "x-csrftoken: $CSRF_TOKEN" \
     --form "formData=@$zip_file" \
     --form overwrite=true \
     --form 'passwords={"databases/Reporting.yaml":"'"$REPORTING_PASS"'", 
"databases/Superset_metadb.yaml":"'"$SUPERSET_DB_PASS"'"}'
   ```
   
   If you need to provide SSH tunnel credentials, use the same pattern for the 
relevant fields (`ssh_tunnel_passwords`, `ssh_tunnel_private_keys`, 
`ssh_tunnel_private_key_passwords`) as JSON objects keyed by the database YAML 
path 
[reference](https://github.com/apache/superset/blob/master/superset/databases/api.py).
   
   Common pitfalls: make sure your JSON is properly escaped, and the paths 
match exactly what’s in your zip file. If a password is missing or a path is 
incorrect, the import will fail 
[reference](https://github.com/apache/superset/blob/master/tests/integration_tests/databases/api_tests.py).
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/52890e10-0d6a-47a0-bcf5-616e1b46ea84?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35644)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to