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

@@ -10,7 +10,7 @@
"""A blueprint module implementing the schema_diff frame."""
import simplejson as json
import pickle
import random
import secrets
import copy
from flask import Response, session, url_for, request
@@ -200,7 +200,7 @@ def initialize():
trans_id = None
try:
# Create a unique id for the transaction
trans_id = str(random.randint(1, 9999999))
trans_id = str(secrets.choice(range(1, 9999999)))
if 'schemaDiff' not in session:
schema_diff_data = dict()

View File

@@ -10,7 +10,7 @@
import uuid
import json
import os
import random
import secrets
from pgadmin.utils.route import BaseTestGenerator
from regression import parent_node_dict
@@ -146,7 +146,7 @@ class SchemaDiffTestCase(BaseTestGenerator):
response_data = self.compare()
diff_file = os.path.join(self.sql_folder, 'diff_{0}.sql'.format(
str(random.randint(1, 99999))))
str(secrets.choice(range(1, 99999)))))
file_obj = open(diff_file, 'a')
for diff in response_data['data']: