Skip to content

Commit

Permalink
feat: APIGW接入 (closed #370)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyyalt committed Aug 21, 2024
1 parent 51c35cc commit 56624d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/gsekit/process/views/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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()]
Expand Down
1 change: 1 addition & 0 deletions apps/iam/handlers/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 56624d5

Please sign in to comment.