Skip to content

Commit bb8f2e3

Browse files
committed
feat: update core
1 parent d91f6cb commit bb8f2e3

File tree

13 files changed

+98
-408
lines changed

13 files changed

+98
-408
lines changed

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ certifi >= 14.05.14
22
six >= 1.10
33
python_dateutil >= 2.5.3
44
setuptools >= 21.0.0
5-
urllib3 >= 1.15.1
6-
pytz >= 2020.5
5+
urllib3 >= 1.15.1

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
"certifi>=2017.4.17",
1616
"python-dateutil>=2.1",
1717
"six>=1.10",
18-
"urllib3>=1.23",
19-
"pytz>=2020.5"
18+
"urllib3>=1.23"
2019
]
2120

2221
setup(

volcenginesdkcore/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# coding:utf-8
22

33
from volcenginesdkcore.configuration import Configuration
4-
from volcenginesdkcore.credentials import Credentials
54
from volcenginesdkcore.api_client import ApiClient

volcenginesdkcore/api_client.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
from six.moves.urllib.parse import quote
1616

1717
from volcenginesdkcore.configuration import Configuration
18-
from volcenginesdkcore.credentials import Credentials
1918
from volcenginesdkcore import rest
20-
from volcenginesdkcore.sign import Request
21-
from volcenginesdkcore.sign import SignerV4
19+
from volcenginesdkcore.signv4 import SignerV4
2220

2321

2422
class ApiClient(object):
@@ -536,19 +534,13 @@ def update_params_for_auth(self, host, path, method, headers, querys, auth_setti
536534
return
537535

538536
for auth in auth_settings:
539-
r = Request()
540-
r.host = host
541-
r.path = path
542-
r.method = method
543-
r.headers = headers
537+
headers["Host"] = host
544538
if method == "POST":
545-
r.body = json.dumps(body)
546-
r.query = dict(querys) # change list tuple to dict
547-
r.headers["Host"] = host
548-
credentials = Credentials(ak=self.configuration.ak, sk=self.configuration.sk, service=service,
549-
region=self.configuration.region)
550-
SignerV4.sign(r, credentials)
551-
headers.update(r.headers) # update to new headers
539+
body = json.dumps(body)
540+
else:
541+
body = ""
542+
SignerV4.sign(path, method, headers, body, dict(querys),
543+
self.configuration.ak, self.configuration.sk, self.configuration.region, service)
552544

553545
def __deserialize_file(self, response):
554546
"""Deserializes body to file

volcenginesdkcore/credentials.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

volcenginesdkcore/sign/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

volcenginesdkcore/sign/meta_data.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

volcenginesdkcore/sign/request.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

volcenginesdkcore/sign/result.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

volcenginesdkcore/sign/signv4.py

Lines changed: 0 additions & 199 deletions
This file was deleted.

0 commit comments

Comments
 (0)