Skip to content

Commit

Permalink
fix: kernel_api支持多个网关鉴权 --bug=129825151 (TencentBlueKing#2692)
Browse files Browse the repository at this point in the history
  • Loading branch information
unique0lai authored Aug 29, 2024
1 parent 387b1d9 commit 94fe709
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bkmonitor/kernel_api/middlewares/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def validate(self) -> Tuple[bool, str]:
# jwt headers解析
try:
headers = jwt.get_unverified_header(raw_content)
except Exception as e: # pylint: disable=broad-except
except Exception as e: # pylint: disable=broad-except
return False, f"jwt content parse header error: {e}"

# jwt算法
Expand Down Expand Up @@ -178,7 +178,7 @@ def get_apigw_public_keys() -> Dict[str, str]:
public_key = cache.get(cache_key)
if public_key is None:
try:
public_key = api.bk_apigateway.get_public_key(api_name=settings.BK_APIGW_NAME)["public_key"]
public_key = api.bk_apigateway.get_public_key(api_name=api_name)["public_key"]
except BKAPIError as e:
logger.error(f"获取{api_name} apigw public_key失败,%s" % e)
public_key = ""
Expand Down

0 comments on commit 94fe709

Please sign in to comment.