New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
凭证管理支持获取默认凭证 #106
凭证管理支持获取默认凭证 #106
Conversation
tencentcloud/common/credential.py
Outdated
:param secretKey: The secret key of your credential. get by environment variable TENCENTCLOUD_SECRET_KEY | ||
:type secretKey: str | ||
""" | ||
self.secretId = os.environ.get('TENCENTCLOUD_SECRET_ID') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secretId => secret_id,其他的也都改一下吧
看下是否需要实时读取
tencentcloud/common/credential.py
Outdated
client_config = ini_map.get("default") | ||
self.secretId = client_config.get('secret_id', None) | ||
self.secretKey = client_config.get('secret_key', None) | ||
self.role_name = client_config.get('role_name', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
role_name => role_arn,因为sts现在没有根据role_name查role_arn的公开接口
tencentcloud/common/credential.py
Outdated
if self.cred is not None: | ||
return self.cred | ||
|
||
raise TencentCloudSDKException("no valid credentail.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TencentCloudSDKException("ClientSideError", "no valid credentail.") ,要指明错误码,这种就判定为客户端错误就好了
No description provided.