-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated S3 provider to be more generic
- Loading branch information
Showing
11 changed files
with
72 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ __pycache__/ | |
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
.venv/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .core import new, Factory | ||
|
||
__version__ = '0.2.8' | ||
__version__ = '0.3.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import datetime | ||
import hashlib | ||
import hmac | ||
import json | ||
import urllib.parse | ||
from signa.logger import get_logger | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
from .aws import aws_headers | ||
from typing import Any, Dict, Optional | ||
from . import s3 | ||
|
||
|
||
def new(method=None, region=None, bucket=None, key=None, | ||
auth=None, headers=None, payload=None): | ||
headers = headers.copy() if headers else {} | ||
|
||
headers['host'] = '%s.%s.digitaloceanspaces.com' % (bucket, region) | ||
|
||
rel_uri = ('/%s' % key) if key else '/' | ||
|
||
headers.update(aws_headers( | ||
def new(method: str, region: str = '', bucket: str = '', | ||
key: str = '', auth: Optional[Dict[str, str]] = None, | ||
headers: Optional[Dict[str, str]] = None, | ||
payload: Any = None, | ||
) -> Dict[str, str]: | ||
return s3.new( | ||
method=method, | ||
region=region, | ||
service='s3', | ||
uri=rel_uri, | ||
bucket=bucket, | ||
key=key, | ||
auth=auth, | ||
headers=headers, | ||
payload=payload | ||
)) | ||
|
||
return { | ||
'url': 'https://%s%s' % (headers['host'], rel_uri), | ||
'headers': headers, | ||
} | ||
payload=payload, | ||
endpoint='{region}.digitaloceanspaces.com' | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
from .aws import aws_headers | ||
from typing import Any, Dict, Optional | ||
from . import s3 | ||
|
||
|
||
def new(method=None, region=None, bucket=None, key=None, | ||
auth=None, headers=None, payload=None): | ||
headers = headers.copy() if headers else {} | ||
|
||
headers['host'] = '%s.%s.aliyuncs.com' % (bucket, region) | ||
|
||
rel_uri = ('/%s' % key) if key else '/' | ||
|
||
headers.update(aws_headers( | ||
def new(method: str, region: str = '', bucket: str = '', | ||
key: str = '', auth: Optional[Dict[str, str]] = None, | ||
headers: Optional[Dict[str, str]] = None, | ||
payload: Any = None, | ||
) -> Dict[str, str]: | ||
return s3.new( | ||
method=method, | ||
region=region, | ||
service='s3', | ||
uri=rel_uri, | ||
bucket=bucket, | ||
key=key, | ||
auth=auth, | ||
headers=headers, | ||
payload=payload | ||
)) | ||
|
||
return { | ||
'url': 'https://%s%s' % (headers['host'], rel_uri), | ||
'headers': headers, | ||
} | ||
payload=payload, | ||
endpoint='{region}.aliyuncs.com' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters