`Export datasets` tool ignores user's credentials
Describe the bug
The tool Export datasets to remote files source does not provide the user's context to access the credentials when exporting.
Galaxy Version and/or server at which you observed the bug
Galaxy Version: 24.0
Commit: (run git rev-parse HEAD if you run this Galaxy server)
Browser and Operating System Operating System: Windows, Linux, macOS Browser: Firefox, Chrome, Chrome-based, Safari
To Reproduce Steps to reproduce the behavior:
- Setup a writeable file source plugging that requires a token or password
- Login with a user and make sure you set up the file source credentials in the settings
- Try to export a dataset to that file source using http://127.0.0.1:8081/?tool_id=export_remote&version=latest
- See the export fail
Expected behavior The user's credentials should be available when trying to export.
So the point where we are missing the user_context is here:
https://github.com/galaxyproject/galaxy/blob/c2438b2f06b92bc7169e5974f962de41e10cbc7b/tools/data_export/export_remote.py#L35
However, I'm failing to see how I can access the requesting user in the tool script to build the user_context :thinking:
Any hints?
Bumping this issue - I just ran into this myself.
I can export to Zenodo sandbox just fine using "Export history to file" or using the workflow invocation export wizard. But the "Export Datasets" tool doesn't pick up my credentials at runtime (even though it lists the available Zenodo sandbox records just fine when using the UI to set the "Directory URI" setting).
This should be possible now using the new way of integrating Zenodo and Invenio-based repositories in combination with this fix https://github.com/galaxyproject/galaxy/pull/19768. There is a new blog post covering this approach here https://galaxyproject.org/news/2025-03-10-inveniordm-integration-update/