Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: 修复第三方插件日志get_paas_logs的401的问题 #7092

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions plugin_service/plugin_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
from django.core.files.uploadedfile import UploadedFile

from . import env
from .client_decorators import (
check_use_plugin_service,
data_parser,
json_response_decoder,
)
from .client_decorators import check_use_plugin_service, data_parser, json_response_decoder
from .conf import PLUGIN_CLIENT_LOGGER
from .exceptions import PluginServiceException, PluginServiceNotUse

Expand Down Expand Up @@ -234,6 +230,10 @@ def get_paas_logs(plugin_code, trace_id, scroll_id=None, environment=None):
url, data = PluginServiceApiClient._prepare_paas_api_request(
path_params=["system/bk_plugins", plugin_code, "logs"], environment=environment
)

if env.PAASV3_APIGW_API_TOKEN:
url = "{}?private_token={}".format(url, env.PAASV3_APIGW_API_TOKEN)

data.update({"trace_id": trace_id})
if scroll_id:
data.update({"scroll_id": scroll_id})
Expand Down Expand Up @@ -278,6 +278,7 @@ def _prepare_paas_api_request(path_params: list, environment=None, force_add_app
environment or env.APIGW_ENVIRONMENT,
*path_params,
)

params = (
{"private_token": env.PAASV3_APIGW_API_TOKEN}
if env.PAASV3_APIGW_API_TOKEN
Expand Down
Loading