2014-08-27 11:17:06 -04:00
|
|
|
from __future__ import unicode_literals
|
2013-10-28 13:43:25 -07:00
|
|
|
from .responses import S3ResponseInstance
|
2013-02-18 21:22:03 -05:00
|
|
|
|
2013-03-05 08:14:43 -05:00
|
|
|
url_bases = [
|
2015-11-27 13:49:44 -05:00
|
|
|
"https?://s3(.*).amazonaws.com",
|
2014-07-08 20:35:48 -04:00
|
|
|
"https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3(.*).amazonaws.com"
|
2013-03-05 08:14:43 -05:00
|
|
|
]
|
2013-02-18 16:09:40 -05:00
|
|
|
|
2013-03-05 08:14:43 -05:00
|
|
|
url_paths = {
|
2015-11-27 13:49:44 -05:00
|
|
|
# subdomain bucket
|
2013-10-28 13:43:25 -07:00
|
|
|
'{0}/$': S3ResponseInstance.bucket_response,
|
2015-11-27 13:49:44 -05:00
|
|
|
|
|
|
|
# subdomain key of path-based bucket
|
2015-11-27 14:43:03 -05:00
|
|
|
'{0}/(?P<key_or_bucket_name>.+)': S3ResponseInstance.ambiguous_response,
|
2015-11-27 13:49:44 -05:00
|
|
|
|
|
|
|
# path-based bucket + key
|
|
|
|
'{0}/(?P<bucket_name_path>[a-zA-Z0-9\-_./]+)/(?P<key_name>.+)': S3ResponseInstance.key_response,
|
2013-02-18 16:09:40 -05:00
|
|
|
}
|