From 9a8e6fba6a8f177d8db4d577087d5902987c706f Mon Sep 17 00:00:00 2001 From: jamesge Date: Tue, 26 Dec 2023 15:34:47 +0800 Subject: [PATCH] fix: missing require user params (#146) --- sdks/bkpaas-auth/CHANGES.md | 2 +- sdks/bkpaas-auth/bkpaas_auth/core/services.py | 1 + sdks/bkpaas-auth/bkpaas_auth/core/token.py | 1 + sdks/bkpaas-auth/pyproject.toml | 2 +- sdks/bkpaas-auth/setup.py | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sdks/bkpaas-auth/CHANGES.md b/sdks/bkpaas-auth/CHANGES.md index 44374b2f..be0f26fe 100644 --- a/sdks/bkpaas-auth/CHANGES.md +++ b/sdks/bkpaas-auth/CHANGES.md @@ -1,6 +1,6 @@ # 版本历史 -## 2.0.7 +## 2.0.8 - 将认证信息标准化到请求头 X-Bkapi-Authorization 中 ## 2.0.6 diff --git a/sdks/bkpaas-auth/bkpaas_auth/core/services.py b/sdks/bkpaas-auth/bkpaas_auth/core/services.py index 530a2e33..2462be4c 100644 --- a/sdks/bkpaas-auth/bkpaas_auth/core/services.py +++ b/sdks/bkpaas-auth/bkpaas_auth/core/services.py @@ -45,6 +45,7 @@ def _get_and_cache_user_info(cache_key, user_params, response_ok_checker): headers={ "X-Bkapi-Authorization": json.dumps(dict(user_params, **get_app_credentials())), }, + params=user_params, ) if not is_success: raise ServiceError('Unable to get user info') diff --git a/sdks/bkpaas-auth/bkpaas_auth/core/token.py b/sdks/bkpaas-auth/bkpaas_auth/core/token.py index 3761419a..81447c1f 100644 --- a/sdks/bkpaas-auth/bkpaas_auth/core/token.py +++ b/sdks/bkpaas-auth/bkpaas_auth/core/token.py @@ -38,6 +38,7 @@ def request_username(self, **credentials): 'blueking-language': get_language(), "X-Bkapi-Authorization": json.dumps(dict(credentials, **get_app_credentials())), }, + params=credentials, ) if not is_success: raise ServiceError('unable to fetch token services') diff --git a/sdks/bkpaas-auth/pyproject.toml b/sdks/bkpaas-auth/pyproject.toml index a24c8529..c374fd7c 100644 --- a/sdks/bkpaas-auth/pyproject.toml +++ b/sdks/bkpaas-auth/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bkpaas-auth" -version = "2.0.7" +version = "2.0.8" description = "User authentication django app for blueking internal projects" readme = "README.md" authors = ["blueking "] diff --git a/sdks/bkpaas-auth/setup.py b/sdks/bkpaas-auth/setup.py index ac01d9d2..20fa91b9 100644 --- a/sdks/bkpaas-auth/setup.py +++ b/sdks/bkpaas-auth/setup.py @@ -23,7 +23,7 @@ setup( long_description=readme, name='bkpaas-auth', - version='2.0.7', + version='2.0.8', description='User authentication django app for blueking internal projects', python_requires='<4.0,>=3.6', author='blueking',