2014-08-27 11:17:06 -04:00
|
|
|
from __future__ import unicode_literals
|
2016-01-17 17:19:53 -05:00
|
|
|
|
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",
|
2019-10-31 08:44:26 -07:00
|
|
|
r"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
|
|
|
|
2016-01-24 16:33:36 -05:00
|
|
|
url_paths = {
|
2015-11-27 13:49:44 -05:00
|
|
|
# subdomain bucket
|
2019-10-31 08:44:26 -07:00
|
|
|
"{0}/$": S3ResponseInstance.bucket_response,
|
2015-11-27 13:49:44 -05:00
|
|
|
# subdomain key of path-based bucket
|
2019-10-31 08:44:26 -07:00
|
|
|
"{0}/(?P<key_or_bucket_name>[^/]+)/?$": S3ResponseInstance.ambiguous_response,
|
2015-11-27 13:49:44 -05:00
|
|
|
# path-based bucket + key
|
2020-02-13 18:01:44 -08:00
|
|
|
"{0}/(?P<bucket_name_path>[^/]+)/(?P<key_name>.+)": S3ResponseInstance.key_or_control_response,
|
2019-08-28 16:17:45 +02:00
|
|
|
# subdomain bucket + key with empty first part of path
|
2020-02-13 18:01:44 -08:00
|
|
|
"{0}//(?P<key_name>.*)$": S3ResponseInstance.key_or_control_response,
|
2016-01-24 16:33:36 -05:00
|
|
|
}
|