TencentCloud / tencentcloud-sdk-python

Tencent Cloud API 3.0 SDK for Python
Apache License 2.0
616 stars 251 forks source link

重构认证模块的ProfileCredential功能 #169

Closed mingyugg closed 1 year ago

mingyugg commented 1 year ago

支持已配置的方式配置多种认证方式,极大程度上避免了生成过多ak/sk的风险,尤其利于多账号的体系下,只需配置role就行了

1、支持配置多个认证 2、支持assume的方式(可以用cvm role和ak/sk去assume)

credentials的默认文件为“~/tencentcloud/credentials” credentials具体格式体现如下:

[default] (the ak/sk profile')
secret_id:xxxx
secret_key:xxxx
token: xxxx

[profile] (the role profile)
role_arn: xxx (required)
session_name: xxx (default is 'tencentcloud-session')
duration_seconds: 3600 (default is 3600)
source_profile: xxx (required, the role'carrier, support 'ak/sk profile' or 'cvm_role')