[PEAR-BUG] Bug #18654 [Opn->Csd]: Underscores in bucket names

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=18654&edit=1

 ID:               18654
 Updated by:       [email protected]
 Reported By:      josh dot adell at gmail dot com
 Summary:          Underscores in bucket names
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          Services_Amazon_S3
-Operating System: Linux
+Operating System: Irrelevant
 Package Version:  0.3.3
-PHP Version:      5.3.6
+PHP Version:      Irrelevant
-Assigned To:      
+Assigned To:      gauthierm
 Roadmap Versions: 
 New Comment:

-Status:           Open
+Status:           Closed
-Operating System: Linux
+Operating System: Irrelevant
-PHP Version:      5.3.6
+PHP Version:      Irrelevant
-Assigned To:
+Assigned To:      gauthierm
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/

Fixed in r313021. Released in 0.3.4.

http://svn.php.net/viewvc?view=revision&revision=313020


Previous Comments:
------------------------------------------------------------------------

[2011-07-06 20:09:45] gauthierm

The caveat here is that some DNS resolvers won't understand underscores.
If you know all the software in your stack 
will work with underscores, they're ok to use. Amazon recommends against
it because they don't control all the 
software people will use to access content on S3.

I think in this case it should be up to the developer to choose whether
or not to use non-standard DNS names. Ideally 
we could show some kind of warning, but PEAR does not allow warnings to
be raised by packages.

I will make the default rules strict (throw an exception on underscore).
I will also add an option where you can relax the 
check and it will not restrict underscores or ending in a dash.

------------------------------------------------------------------------

[2011-07-06 19:56:48] gauthierm

It's worth noting that Amazon's S3 documentation recommends against
using underscores in bucket names when 
using the virtual host access method:

"To conform with DNS requirements, we recommend following these
additional guidelines when creating buckets:

Bucket names should not contain underscores (_)

Bucket names should be between 3 and 63 characters long

Bucket names should not end with a dash

Bucket names cannot contain two, adjacent periods

Bucket names cannot contain dashes next to periods (e.g.,
"my-.bucket.com" and "my.-bucket" are invalid)"

------------------------------------------------------------------------

[2011-07-06 19:41:35] gauthierm

Thanks for the patch. That's one crazy regexp. I think I will take your
patch and rewrite the expression using extended 
syntax so it can be documented a bit better.

------------------------------------------------------------------------

[2011-07-06 19:27:38] jadell

Added #patch
bug:18654;patch:underscore_bucket_name;revision:1309976858;.

------------------------------------------------------------------------

[2011-07-06 19:18:13] jadell

Description:
------------
If the bucket has an underscore in the name (ex: 
my_test_bucket) and using virtual host request style, getting 
the URL fails with the exception:

Invalid bucket name when requestStyle is 
REQUEST_STYLE_VIRTUAL_HOST: my_test_bucket in 
/usr/share/php/Services/Amazon/S3.php on line 489

It is possible to browse to the bucket using 
http://my_test_bucket.s3.amazonaws.com.

The regex on line 208 in Bucket.php should be amended to 
include underscores as valid caharacters.

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18654&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.