-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert format of configuration URLs #54
Comments
Okay, I will revert to the old URL format and parser. I might change the format a bit. Do you think we should use @ for the bucket?
|
Proposal for config URLs, read here |
Mapping these config strings to URI components:
The
The
I think this matches pretty closely your existing implementation from v1 (apart from AWS region in the host, which I think is a bit inconsistent with the others)? I think this is also a superset of at least the basic GCP and AWS bucket URI formats that I know about, which is a nice property. I'm not that familiar with the other providers so I don't know if it would accommodate their existing formats too. I'll look through the proposal doc in more detail to see if it matches this generic structure. |
Thanks for your input! I do agree that
This way the configuration URLs can be consistent across all currently supported cloud storage services. And besides it simplifies the parser function :-) |
I'd expect these strings to be parseable with https://nodejs.org/api/url.html#new-urlinput-base as they'll be a standard format. A quick test in node:
This outputs
|
I have implemented the standard URL parser but unfortunately this can't be used with the config URL of the local adapter and the GS adapter: const u = "local://path/to/bucket@bucket_name?mode=511&extra_option2=value2"
{
value: {
type: 'local:',
part1: null, // should be: path/to/bucket
part2: null,
bucketName: 'path',
extraOptions: { mode: '511', extra_option2: 'value2' }
},
error: null
}
const u ="gcs://path/to/key_file.json@bucket_name?extra_option1=value1&extra_option2=value2";
{
value: {
type: 'gcs:',
part1: null, // should be: path/to/key_file.json
part2: null,
bucketName: 'path',
extraOptions: { extra_option1: 'value1', extra_option2: 'value2' }
},
error: null
} Also the config URL doesn't (yet) use the path to an object in the storage; you need to call a It might be worth considering whether or not we should add support for direct URL's to objects in the storage. This would imply that if a path to an object is detected in the config URL, the Storage automatically calls a
|
The path could be treated as a default object prefix for any later calls to any of the getFile methods? |
fixed in 2.1.0 |
GCP: gs://bucketname/path/to/object
https://cloud.google.com/storage/docs/gsutil
AWS: s3://buckname/path/to/object
https://docs.aws.amazon.com/cli/latest/userguide/cli-services-s3-commands.html#using-s3-commands-managing-objects-param
I understand extra params are required such as region, credentials etc... but the v1 formats handled that nicely.
Originally posted by @headlessme in #46 (comment)
The text was updated successfully, but these errors were encountered: