Skip to content

Commit

Permalink
fix(backend): 调整反向查询 API 日志等级 TencentBlueKing#7580
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Oct 24, 2024
1 parent c95040b commit 8d96e3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dbm-ui/backend/db_proxy/reverse_api/base_reverse_api_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@

class IPHasRegisteredPermission(permissions.BasePermission):
def has_permission(self, request, view):
logger.info(
f"[checking reverse-api-perm] request path: {request.path},"
f"REMOTE_ADDR: {request.META.get('REMOTE_ADDR')},"
f"HTTP_X_FORWARDED_FOR: {request.META.get('HTTP_X_FORWARDED_FOR')}"
)
try:
nginx_ip = get_nginx_ip(request)
logger.debug(f"nginx_ip: {nginx_ip}")

get_nginx_ip(request)
bk_cloud_id = get_bk_cloud_id(request)
logger.debug(f"bk_cloud_id: {bk_cloud_id}")

client_ip = get_client_ip(request)
Machine.objects.get(ip=client_ip, bk_cloud_id=bk_cloud_id)

logger.debug(f"client_ip: {client_ip}")
except Exception as e: # noqa
# if not found:
raise Exception(_("访问受限,不存在于DBM平台 {}".format(e)))
Expand Down

0 comments on commit 8d96e3c

Please sign in to comment.