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 56624d5 commit 456af56
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions apps/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ def make_anonymous_user(self, bk_username=None):
def authenticate(self, request, gateway_name, bk_username, verified, **credentials):
if not verified:
return self.make_anonymous_user(bk_username=bk_username)

logger.info(f"gatewaytest {gateway_name}, {bk_username}, {request.jwt.payload}")

return self.user_maker(bk_username)
3 changes: 0 additions & 3 deletions apps/gsekit/process/views/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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 @@ -40,8 +39,6 @@ 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: 0 additions & 1 deletion apps/iam/handlers/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ 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 456af56

Please sign in to comment.