From 9552eef2a74b18e6e4463f68878ae063ac5b2485 Mon Sep 17 00:00:00 2001 From: zeyu-zhang <61429689+zeyu-zh@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:45:39 +0800 Subject: [PATCH] fix: parse tuple credentials (#302) * Enhance security by introducing credential providers Implemented the concepts of 'credentials' and 'credential providers' to eliminate the need for hardcoding access keys in the codebase. Us- ers can now securely obtain credentials via third-party SDKs, suppo- rting retrieval from services like KMS and environment variables. This enhancement aligns with best practices for cloud service interaction and adds flexibility for custom use cases. Signed-off-by: Zeyu Zhang * Retrieve credentials from providers Signed-off-by: Zeyu Zhang * fix: parse tuple credentials Signed-off-by: Zeyu Zhang * bump version to 0.9.10 Signed-off-by: Zeyu Zhang --------- Signed-off-by: Zeyu Zhang --- aliyun/log/logclient.py | 3 ++- aliyun/log/version.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aliyun/log/logclient.py b/aliyun/log/logclient.py index 90949cc..90818fe 100644 --- a/aliyun/log/logclient.py +++ b/aliyun/log/logclient.py @@ -178,7 +178,8 @@ def _replace_credentials(self): self._last_refresh = time.time() for tries in range(DEFAULT_REFRESH_RETRY_COUNT + 1): try: - self._auth = make_auth(StaticCredentialsProvider(self._credentials_auto_refresher()), + credentials = self._credentials_auto_refresher() + self._auth = make_auth(StaticCredentialsProvider(credentials[0], credentials[1], credentials[2]), self._auth_version, self._region) except Exception as ex: logger.error( diff --git a/aliyun/log/version.py b/aliyun/log/version.py index 79c796e..c15a01f 100644 --- a/aliyun/log/version.py +++ b/aliyun/log/version.py @@ -1,4 +1,4 @@ -__version__ = '0.9.9' +__version__ = '0.9.10' import sys OS_VERSION = str(sys.platform)