11# -*- coding: utf-8 -*-
2- """
3- TencentBlueKing is pleased to support the open source community by making
4- 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
5- Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
6- Licensed under the MIT License (the "License"); you may not use this file except
7- in compliance with the License. You may obtain a copy of the License at
8-
9- http://opensource.org/licenses/MIT
10-
11- Unless required by applicable law or agreed to in writing, software distributed under
12- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13- either express or implied. See the License for the specific language governing permissions and
14- limitations under the License.
15-
16- We undertake not to change the open source license (MIT license) applicable
17- to the current version of the project delivered to anyone in the future.
18- """
2+ # TencentBlueKing is pleased to support the open source community by making
3+ # 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
4+ # Copyright (C) Tencent. All rights reserved.
5+ # Licensed under the MIT License (the "License"); you may not use this file except
6+ # in compliance with the License. You may obtain a copy of the License at
7+ #
8+ # http://opensource.org/licenses/MIT
9+ #
10+ # Unless required by applicable law or agreed to in writing, software distributed under
11+ # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12+ # either express or implied. See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ #
15+ # We undertake not to change the open source license (MIT license) applicable
16+ # to the current version of the project delivered to anyone in the future.
17+
1918import prometheus_client
2019from django .conf import settings
2120from django .http import HttpResponse , HttpResponseForbidden
@@ -32,8 +31,8 @@ def registry(self):
3231 return prometheus_client .REGISTRY
3332
3433 def get (self , request , * args , ** kwargs ):
35- username = request .GET .get (self .key_username , '' )
36- password = request .GET .get (self .key_password , '' )
34+ username = request .GET .get (self .key_username , "" )
35+ password = request .GET .get (self .key_password , "" )
3736 if not (username and password ) or password != settings .METRIC_CLIENT_TOKEN_DICT .get (username ):
3837 return HttpResponseForbidden (
3938 f"permission denied, no valid { self .key_username } /{ self .key_password } provided" ,
0 commit comments