-
Notifications
You must be signed in to change notification settings - Fork 388
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
A screenshot that you have tested with "Try this API".
Not related to the API, just the JS implementation of TransferManager.downloadManyFiles.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/faultyserver/baed2362e93fb2eb8feda06ad2b77813
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
The above gist can be run just by adding a valid Storage reference at the top. In general, the process is:
- Make a temporary directory, like
path.join(os.tmpdir(), 'some-namespace') - Call
downloadManyFileswithpassthroughOptions.destinationas that tempdir - Run the code, observe a rejected promise with the
TRAVERSAL_OUTSIDE_BASE_DESTINATIONerror message.
A clear and concise description of what the bug is, and what you expected to happen.
downloadManyFiles doesn't allow writing to a temporary directory.
I would expect to be able to write a large directory of content into a new directory that I created, especially a temporary directory, to avoid having to write into the current working directory first. Additional use cases this is affecting for me are working in a monorepo where a command may write to a separate cache folder in the same repo that is specified as an absolute path rather than relative from the root of the repository.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
This was added in a recent version (~2 weeks ago) in this PR and is now preventing downloads to anywhere other than the current working directory, without an option to override or opt out of the behavior for knowably-safe operations, like writing to a temporary directory.
For scripts that are just downloading data to use in other processing, it's common to write to a temporary directory to avoid populating randomly into a project's repository or somewhere persistent and visible to the user.