boto/boto — Issue #592: def storage_uri bucket name checking incomplete, why?
Author: fangchin
Created: 2012-02-22 17:01:54+00:00
State: open

According to the following documentation:
1. AWS S3 bucket restrictions and limitations:
http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html
2. Google Cloud Storage bucket name requirements:
https://developers.google.com/storage/docs/bucketnaming#requirements

it should be evident that AWS S3 and Google Cloud Storage have similar but not identical bucket name requirements. Therefore, to be strictly correct, the bucket name validation ought to be done per the given scheme.

Furthermore, the regular expression based bucket validation at line 625/627:
https://github.com/boto/boto/blob/master/boto/__init__.py#L625
https://github.com/boto/boto/blob/master/boto/__init__.py#L627
do not cover some common requirements, e.g. a bucket name can't be formatted like an IPv4 address (using perhaps "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$")

Is it because it's preferred to have the more complete validation done on the server side? At any rate, would be happy to submit a patch to make this area more complete.