From 56624d5fb1c9e8c2f66348b88a561fca8ece8f41 Mon Sep 17 00:00:00 2001 From: yunchao Date: Wed, 21 Aug 2024 10:18:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20APIGW=E6=8E=A5=E5=85=A5=20(closed=20#37?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/gsekit/process/views/process.py | 4 ++++ apps/iam/handlers/permission.py | 1 + 2 files changed, 5 insertions(+) diff --git a/apps/gsekit/process/views/process.py b/apps/gsekit/process/views/process.py index 5804c12..a157b2f 100644 --- a/apps/gsekit/process/views/process.py +++ b/apps/gsekit/process/views/process.py @@ -24,6 +24,8 @@ from apps.iam.handlers.drf import InstanceActionPermission, ViewBusinessPermission from apps.utils.models import queryset_to_dict_list from apps.utils.drf import GeneralOrderingFilter +from common.log import logger + ProcessViewTags = ["process"] @@ -38,6 +40,8 @@ def get_queryset(self): return self.model.objects.filter(bk_biz_id=self.kwargs["bk_biz_id"]) def get_permissions(self): + logger.info(f"gatewaytest: action: {self.action}") + logger.info(f"gatewaytest: action: {self.request.jwt.payload}") if self.action in ["operate_process"]: return [InstanceActionPermission([ActionEnum.MANAGE_PROCESS], ResourceEnum.BUSINESS)] return [ViewBusinessPermission()] diff --git a/apps/iam/handlers/permission.py b/apps/iam/handlers/permission.py index cd46c78..7371d1b 100644 --- a/apps/iam/handlers/permission.py +++ b/apps/iam/handlers/permission.py @@ -204,6 +204,7 @@ def is_allowed( request = self.make_request(action, resources) try: + logger.info(f"gatewaytest: {request.jwt.payload}, {request.user.username}, {request.user.is_superuser}") result = self.iam_client.is_allowed(request) except AuthAPIError as e: logger.exception(f"[IAM AuthAPI Error]: {e}")