You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "sonatype-lift[bot] (via GitHub)" <gi...@apache.org> on 2023/02/17 21:18:36 UTC

[GitHub] [skywalking-python] sonatype-lift[bot] commented on a diff in pull request #288: Add prefork support for uwsgi and gunicorn

sonatype-lift[bot] commented on code in PR #288:
URL: https://github.com/apache/skywalking-python/pull/288#discussion_r1110377975


##########
tests/e2e/base/consumer/flask_consumer.py:
##########
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+Used by uWSGI which doesn't support FASTAPI (ASGI).
+"""
+import time
+import random
+from flask import Flask, request
+import requests
+
+app = Flask(__name__)
+
+
+@app.route('/artist-consumer', methods=['POST', 'GET'])
+def artist():
+    try:
+        time.sleep(random.random())

Review Comment:
   <picture><img alt="0% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/0/display.svg"></picture>
   
   <b>*[B311](https://bandit.readthedocs.io/en/1.7.4/blacklists/blacklist_calls.html#b311-random):</b>*  Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   
   ❗❗ <b>2 similar findings have been found in this PR</b>
   
   <details><summary>🔎 Expand here to view all instances of this finding</summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | tests/e2e/base/provider/fastapi_provider.py | [57](https://github.com/apache/skywalking-python/blob/6c499a60cf8fa7a7f9aa055536e61b884ea9d9d1/tests/e2e/base/provider/fastapi_provider.py#L57) |
   | tests/e2e/base/provider/flask_provider.py | [49](https://github.com/apache/skywalking-python/blob/6c499a60cf8fa7a7f9aa055536e61b884ea9d9d1/tests/e2e/base/provider/flask_provider.py#L49) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/skywalking-python/01GSGKRFSXB0N4FF62BSVW83B8?t=Bandit|B311" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
   
   
   
   ---
   
   <details><summary>ℹī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   <b>Help us improve LIFT! (<i>Sonatype LiftBot external survey</i>)</b>
   
   Was this a good recommendation for you? <sub><small>Answering this survey will not impact your Lift settings.</small></sub>
   
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=397622792&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=397622792&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=397622792&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=397622792&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=397622792&lift_comment_rating=5) ]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org