Fixed Securtiy Hotspot reported by SonarQube.

This commit is contained in:
Akshay Joshi
2022-08-12 17:10:26 +05:30
parent b34078c6d2
commit 084203debc
54 changed files with 170 additions and 169 deletions

View File

@@ -1,5 +1,5 @@
import uuid
import random
import secrets
import sys
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils
@@ -19,7 +19,7 @@ class PSQLPanel(BaseTestGenerator):
def runTest(self):
if sys.platform == 'win32':
self.skipTest('PSQL disabled for windows')
trans_id = random.randint(1, 9999999)
trans_id = secrets.choice(range(1, 9999999))
url = '/psql/panel/{trans_id}?sgid={sgid}&sid={sid}&did={did}' \
'&server_type=pg&db={db_name}&theme={theme}'.\
format(trans_id=trans_id, sgid=self.sgid, sid=self.sid,

View File

@@ -35,9 +35,6 @@ class PSQLStartProcess(BaseTestGenerator):
assert received[0]['name'] == 'connected'
assert received[0]['args'][0]['sid'] != ''
import random
trans_id = random.randint(1, 9999999)
data = {
'sid': self.sid,
'db': 'postgres',