mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-09 02:12:53 +02:00
fix: add nosec comments for intentional LAN bind defaults and controlled SQL fragments
This commit is contained in:
+1
-1
@@ -233,7 +233,7 @@ def load_config(config_path: Optional[str] = None) -> Dict[str, Any]:
|
||||
if "http" not in config:
|
||||
config["http"] = {
|
||||
"enabled": True,
|
||||
"host": "0.0.0.0",
|
||||
"host": "0.0.0.0", # nosec B104 - intentional LAN bind default
|
||||
"port": 8000,
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ class ConfigManager:
|
||||
|
||||
http_cfg = self.config.get("http", {}) if isinstance(self.config, dict) else {}
|
||||
enabled = self._parse_bool(http_cfg.get("enabled", True), default=True)
|
||||
host = str(http_cfg.get("host", "0.0.0.0") or "0.0.0.0")
|
||||
host = str(http_cfg.get("host", "0.0.0.0") or "0.0.0.0") # nosec B104 - intentional LAN bind default
|
||||
|
||||
try:
|
||||
port = int(http_cfg.get("port", 8000))
|
||||
|
||||
@@ -1117,7 +1117,7 @@ class SQLiteHandler:
|
||||
with self._connect() as conn:
|
||||
conn.row_factory = sqlite3.Row
|
||||
|
||||
aggregate_rows = conn.execute(
|
||||
aggregate_rows = conn.execute( # nosec B608 - internal SQL template with controlled fragments
|
||||
f"""
|
||||
WITH tx_packets AS (
|
||||
SELECT
|
||||
@@ -1164,7 +1164,7 @@ class SQLiteHandler:
|
||||
),
|
||||
).fetchall()
|
||||
|
||||
dist_rows = conn.execute(
|
||||
dist_rows = conn.execute( # nosec B608 - internal SQL template with controlled fragments
|
||||
f"""
|
||||
WITH tx_packets AS (
|
||||
SELECT
|
||||
@@ -1191,7 +1191,7 @@ class SQLiteHandler:
|
||||
),
|
||||
).fetchall()
|
||||
|
||||
type_rows = conn.execute(
|
||||
type_rows = conn.execute( # nosec B608 - internal SQL template with controlled fragments
|
||||
f"""
|
||||
WITH tx_packets AS (
|
||||
SELECT
|
||||
@@ -1726,7 +1726,7 @@ class SQLiteHandler:
|
||||
with self._connect() as conn:
|
||||
conn.row_factory = sqlite3.Row
|
||||
|
||||
aggregate_rows = conn.execute(
|
||||
aggregate_rows = conn.execute( # nosec B608 - internal SQL template with controlled fragments
|
||||
f"""
|
||||
SELECT
|
||||
CAST(timestamp / ? AS INTEGER) * ? AS bucket_ts,
|
||||
@@ -3121,7 +3121,7 @@ class SQLiteHandler:
|
||||
# Update only supplied columns on conflict so partial updates don't
|
||||
# reset counters/state such as push_failures.
|
||||
update_set = ", ".join(f"{col}=excluded.{col}" for col in update_fields.keys())
|
||||
conn.execute(
|
||||
conn.execute( # nosec B608 - internal SQL template with controlled fragments
|
||||
f"""
|
||||
INSERT INTO room_client_sync ({", ".join(columns)})
|
||||
VALUES ({", ".join(placeholders)})
|
||||
|
||||
Reference in New Issue
Block a user