|
41 | 41 | class CosConfig(object): |
42 | 42 | """config类,保存用户相关信息""" |
43 | 43 |
|
44 | | - def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token=None, Scheme=None, Timeout=None, |
| 44 | + def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token=None, CredentialInstance=None, Scheme=None, Timeout=None, |
45 | 45 | Access_id=None, Access_key=None, Secret_id=None, Secret_key=None, Endpoint=None, IP=None, Port=None, |
46 | 46 | Anonymous=None, UA=None, Proxies=None, Domain=None, ServiceDomain=None, PoolConnections=10, |
47 | 47 | PoolMaxSize=10, AllowRedirects=False, SignHost=True, EndpointCi=None, EndpointPic=None, EnableOldDomain=True, EnableInternalDomain=True): |
@@ -120,6 +120,10 @@ def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token |
120 | 120 | elif (Access_id and Access_key): |
121 | 121 | self._secret_id = self.convert_secret_value(Access_id) |
122 | 122 | self._secret_key = self.convert_secret_value(Access_key) |
| 123 | + elif (CredentialInstance and hasattr(CredentialInstance, "secret_id") and hasattr(CredentialInstance, "secret_key") and hasattr(CredentialInstance, "token")): |
| 124 | + self._secret_id = None |
| 125 | + self._secret_key = None |
| 126 | + self._credential_inst = CredentialInstance |
123 | 127 | elif self._anonymous: |
124 | 128 | self._secret_id = None |
125 | 129 | self._secret_key = None |
|
0 commit comments