watercraft commented on issue #31983:
URL: https://github.com/apache/superset/issues/31983#issuecomment-2758396438

   My workaround also uses the init script with these commands to call the API 
after the import:
   ```  echo "Encrypt database connection URI.... "
     CSRF=`curl --silent -c cookies -H"<<some authentication>>" -X GET 
http://dataviz-superset:8088/api/v1/security/csrf_token/ | python3 -c 'import 
json, sys; print(json.dumps(json.loads("".join([l for l in 
sys.stdin]))["result"]))' | sed 's/"//g' `
     curl --silent -b cookies  -H"<<some authentication>>" -X GET 
http://dataviz-superset:8088/api/v1/database/1/connection | python3 -c 'import 
json, sys; print(json.dumps(json.loads("".join([l for l in 
sys.stdin]))["result"]))' > result
     curl --silent -b cookies -H"Content-Type: application/json" 
-H"X-Csrftoken: $CSRF" -H"<<some authentication>>" -d@result -X PUT 
http://dataviz-superset:8088/api/v1/database/1
   ```


-- 
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