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