CenterForOpenScience / waterbutler

WaterButler is a Python web application for interacting with various file storage services via a single RESTful API, developed at Center for Open Science.
Apache License 2.0
62 stars 76 forks source link

OSFstorage provider "inner provider" settings? #400

Open krugar opened 2 years ago

krugar commented 2 years ago

The OSFstorage provider has an "inner provider" that can be filesystem for local testing or a cloud storage for production. This provider is initialized in a utility function named make_provider(), which can be called with a settings parameter: https://github.com/CenterForOpenScience/waterbutler/blob/ef09929b688547eb63d83d8f7fcf168f841ca910/waterbutler/providers/osfstorage/provider.py#L129

one place where this is called from is within download(), where it is indeed called with a settings parameter (with data taken from a "metadata" response by the OSF)

however, within make_provider(), this settings parameter is not actually used to initialize the inner provider, the value used instead is this: https://github.com/CenterForOpenScience/waterbutler/blob/ef09929b688547eb63d83d8f7fcf168f841ca910/waterbutler/providers/osfstorage/provider.py#L142

This seems... unintended?

I stumbled upon this while trying to provide a foldersetting to the filesystem provider via environment variables, which does not work as one might expect (because it is initialized via the above mechanism)