first working version of s3 refactor.

This commit is contained in:
Steve Pulec 2015-11-27 13:49:44 -05:00
commit 1df454a632
6 changed files with 86 additions and 35 deletions

View file

@ -2,10 +2,23 @@ from __future__ import unicode_literals
from .responses import S3ResponseInstance
url_bases = [
"https?://s3(.*).amazonaws.com",
"https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3(.*).amazonaws.com"
]
url_paths = {
# subdomain bucket
'{0}/$': S3ResponseInstance.bucket_response,
'{0}/(?P<key_name>.+)': S3ResponseInstance.key_response,
# subdomain key of path-based bucket
'{0}/(?P<key_name>.+)': S3ResponseInstance.response,
# path-based bucket + key
'{0}/(?P<bucket_name_path>[a-zA-Z0-9\-_./]+)/(?P<key_name>.+)': S3ResponseInstance.key_response,
# '{0}/(?P<bucket_name>[a-zA-Z0-9\-_.]+)$': ro.bucket_response,
# '{0}/(?P<bucket_name>[a-zA-Z0-9\-_.]+)/$': bucket_response2,
}