Skip to content
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

Merged
merged 11 commits into from Aug 26, 2021
Merged

Conversation

WANGMUXIAN
Copy link
Contributor

No description provided.

: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')
Copy link
Member

@zqfan zqfan Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secretId => secret_id,其他的也都改一下吧
看下是否需要实时读取

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)
Copy link
Member

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的公开接口

if self.cred is not None:
return self.cred

raise TencentCloudSDKException("no valid credentail.")
Copy link
Member

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.") ,要指明错误码,这种就判定为客户端错误就好了

@zqfan zqfan merged commit 16a1964 into TencentCloud:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants