Skip to content
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

Uppercase bucket name breaks API #44

Closed
atimb opened this issue Nov 1, 2011 · 6 comments
Closed

Uppercase bucket name breaks API #44

atimb opened this issue Nov 1, 2011 · 6 comments

Comments

@atimb
Copy link

atimb commented Nov 1, 2011

If you use a bucket name containing uppercase characters, the exports.stringToSign(options) call in auth.js will return the resource name with uppercase characters, however Amazon waits this in strictly lowercase format in the signature.

Example:

Init knox with bucket name testUpperCase

StringToSign in knox:

GET


Tue, 01 Nov 2011 06:51:56 GMT
/testUpperCase/pic.jpg

Amazon response HTTP 403:

<Error><Code>SignatureDoesNotMatch</Code> [...]
<StringToSign>GET


Tue, 01 Nov 2011 06:51:56 GMT
/testuppercase/pic.jpg</StringToSign> [...]
@alhui
Copy link

alhui commented Dec 28, 2011

May also be experiencing this problem. Our bucket has capitals in it, GSTest

@ntkachov
Copy link

I can confirm that this is an issue. Using a bucketname such as "cloud" works where as "Cloud" does not.

We used a simple get request on S3. a captial letter bucketname returns an 403 but the same request with a lowercase letter returns the file.

@domenic
Copy link
Contributor

domenic commented Jul 16, 2012

So stringToSign should lowercase before returning? Sounds easy enough. Want to submit a patch and get all the fame and glory?

@domenic
Copy link
Contributor

domenic commented Jul 18, 2012

After investigating this, it's unfortunately a lot more complicated. The punchline is, I don't think we should support mixed-case buckets.

The reasoning is that mixed-case bucket names are not DNS-compliant. They can only be created in the US Standard region, and are recommended against by Amazon.

Furthermore, since you can't access them "virtual hosted style" (i.e. with urls like http://bucketname.s3.amazonaws.com), due to this DNS-incompliance, you must access them "path style." (Amazon explains the differences here.) But this has a large number of disadvantages. You start needing to specify a different endpoint per region, and you cannot access programatically-created buckets using the path style. So that's not really a good option.

I think the best thing to do is add a nice error message if the user tries to pass mixed-case bucket names to Knox, and error out early.

@whiteb0x
Copy link

whiteb0x commented Aug 5, 2013

Hey Domenic - is there a quick fix for the S3 lowercase bucket name error in the Demo for the app? I can't seem to get it working.

@domenic
Copy link
Contributor

domenic commented Aug 5, 2013

@whiteb0x I am not sure what demo and what app you are talking about?

I think you can use uppercase names now, it switches to path style and turns off HTTPS which should work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants