tencentcloud-sdk-python-common 3.0.1065__tar.gz → 3.0.1068__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/PKG-INFO +1 -1
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/__init__.py +1 -1
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/credential.py +14 -4
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud_sdk_python_common.egg-info/PKG-INFO +1 -1
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/README.rst +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/setup.cfg +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/setup.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/__init__.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/abstract_client.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/abstract_model.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/circuit_breaker.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/common_client.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/exception/__init__.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/exception/tencent_cloud_sdk_exception.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/http/__init__.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/http/request.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/profile/__init__.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/profile/client_profile.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/profile/http_profile.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud/common/sign.py +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud_sdk_python_common.egg-info/SOURCES.txt +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud_sdk_python_common.egg-info/dependency_links.txt +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud_sdk_python_common.egg-info/requires.txt +0 -0
- {tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/tencentcloud_sdk_python_common.egg-info/top_level.txt +0 -0
|
@@ -29,6 +29,8 @@ except ImportError:
|
|
|
29
29
|
|
|
30
30
|
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
|
31
31
|
from tencentcloud.common.common_client import CommonClient
|
|
32
|
+
from tencentcloud.common.profile.http_profile import HttpProfile
|
|
33
|
+
from tencentcloud.common.profile.client_profile import ClientProfile
|
|
32
34
|
|
|
33
35
|
class Credential(object):
|
|
34
36
|
def __init__(self, secret_id, secret_key, token=None):
|
|
@@ -159,8 +161,9 @@ class STSAssumeRoleCredential(object):
|
|
|
159
161
|
_region = "ap-guangzhou"
|
|
160
162
|
_version = '2018-08-13'
|
|
161
163
|
_service = "sts"
|
|
164
|
+
_endpoint = "sts.tencentcloudapi.com"
|
|
162
165
|
|
|
163
|
-
def __init__(self, secret_id, secret_key, role_arn, role_session_name, duration_seconds=7200):
|
|
166
|
+
def __init__(self, secret_id, secret_key, role_arn, role_session_name, duration_seconds=7200, endpoint=None):
|
|
164
167
|
"""
|
|
165
168
|
:param secret_id: 接口调用凭证id
|
|
166
169
|
:type secret_id: str
|
|
@@ -187,6 +190,8 @@ class STSAssumeRoleCredential(object):
|
|
|
187
190
|
|
|
188
191
|
self._last_role_arn = None
|
|
189
192
|
self._tmp_credential = None
|
|
193
|
+
if endpoint:
|
|
194
|
+
self._endpoint = endpoint
|
|
190
195
|
|
|
191
196
|
@property
|
|
192
197
|
def secretId(self):
|
|
@@ -232,8 +237,13 @@ class STSAssumeRoleCredential(object):
|
|
|
232
237
|
|
|
233
238
|
def get_sts_tmp_role_arn(self):
|
|
234
239
|
cred = Credential(self._long_secret_id, self._long_secret_key)
|
|
240
|
+
http_profile = HttpProfile()
|
|
241
|
+
http_profile.endpoint = self._endpoint
|
|
242
|
+
client_profile = ClientProfile()
|
|
243
|
+
client_profile.httpProfile = http_profile
|
|
235
244
|
|
|
236
|
-
common_client = CommonClient(credential=cred, region=self._region, version=self._version,
|
|
245
|
+
common_client = CommonClient(credential=cred, region=self._region, version=self._version,
|
|
246
|
+
service=self._service, profile=client_profile)
|
|
237
247
|
params = {
|
|
238
248
|
"RoleArn": self._role_arn,
|
|
239
249
|
"RoleSessionName": self._role_session_name,
|
|
@@ -247,7 +257,7 @@ class STSAssumeRoleCredential(object):
|
|
|
247
257
|
self._expired_time = rsp["Response"]["ExpiredTime"] - self._duration_seconds * 0.9
|
|
248
258
|
|
|
249
259
|
|
|
250
|
-
class EnvironmentVariableCredential():
|
|
260
|
+
class EnvironmentVariableCredential(object):
|
|
251
261
|
|
|
252
262
|
def get_credential(self):
|
|
253
263
|
"""Tencent Cloud EnvironmentVariableCredential.
|
|
@@ -270,7 +280,7 @@ class EnvironmentVariableCredential():
|
|
|
270
280
|
return Credential(self.secret_id, self.secret_key)
|
|
271
281
|
|
|
272
282
|
|
|
273
|
-
class ProfileCredential():
|
|
283
|
+
class ProfileCredential(object):
|
|
274
284
|
|
|
275
285
|
def get_credential(self):
|
|
276
286
|
"""Tencent Cloud ProfileCredential.
|
{tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/README.rst
RENAMED
|
File without changes
|
{tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/setup.cfg
RENAMED
|
File without changes
|
{tencentcloud-sdk-python-common-3.0.1065 → tencentcloud-sdk-python-common-3.0.1068}/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|