-
Notifications
You must be signed in to change notification settings - Fork 285
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
Endpoint is currently "bucket.domain" instead of "domain/bucket" #165
Comments
Sigh. This is a constant recurring question. And, I'm no longer sure what the right answer is. Here's the first place I answered it. In short, Amazon explains why virtual host-style (bucket.domain) is preferred here and here. In short:
and, more damningly
That is, you cannot use programmatically-created buckets using the path-style (domain/bucket) access. On the other hand:
which has caused many questions, e.g. #153 and #125. I suppose we could make this configurable. |
Thanks for taking the time to answer it (yet again), I hadn't seen the previous issues and will close this one. |
No, let's leave it open. I'll probably make it configurable, since this does keep recurring. At the very least I need to add something to the readme :). |
Cool. Currently I'm using a fork just before this change :) which is working well |
Eek, I don't want to drive people back to the bad old days of Knox 0.0.9! Haha. |
making it a client option would be nice, so you aren't forced into either, but can pick whichever matches your endpoint pubilcation. new Client() with an option a la {format: "path"} vs. {format: "domain"} or the like? |
Lots of changes to client creation: - Add new `style` option, which can be either `"virtualHost"` (default, and the current behavior: "bucket.endpoint") or `"path"` (uses "endpoint/bucket"). - Removed the `domain` option, since it was incoherent. What we used to call "domain," Amazon called "endpoint" (i.e. the term "endpoint" was misused). - `client.region` is now normalized to always exist, if no custom endpoint was passed, or to be `undefined` if it was. Also: - Tests converted to BDD style for easier nesting and repetition of tests. - Tests clean up after themselves, in all buckets, better.
I am working on this in a branch. The API will be a new option, To do this I needed to refactor the tests though, to run through the test suite twice (once for each style), so I took it as an opportunity to overhaul the tests generally, e.g. convert to BDD. I'm most of the way through that, with just |
@domenic : How's it going? Close to landing? |
@timmywil this weekend is most likely... juggling so many projects that demand my attention, during the week I can usually only manage a few hours at a time, which wouldn't be enough to polish this off. |
gotcha, thanks! |
process.env.NODE_TLS_REJECT_UNAUTHORIZED=0 tells node/tls to skip certificate check |
72e0aa0 contains my latest work on this. It's pretty much done and seems to work well, judging by all the tests that pass. You can explicitly pass in I haven't done auto-switching yet, but am leaning toward doing so. It would cover a few cases
I'd use the code from https://github.com/aws/aws-sdk-js/blob/master/lib/services/s3.js#L106-L136 most likely |
Oh, right, and on timeline, for those waiting patiently: I'll try to implement the auto-switching late tonight, after dinner. |
Knox 0.8.0 will try to automatically use path style if it sees a non-DNS compliant bucket name. Let me know how it goes! |
Is there a reason the first format is preferred ?
In the case of a bucket name of the format
bucket.name
the prefix mode fails w/ https. While not strongly tested, there may be a performance advantage w/ the former as well
https://stackoverflow.com/questions/5907622/which-way-of-referencing-s3-files-is-better-faster
The text was updated successfully, but these errors were encountered: