Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/nine_rtksync/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from .identidade import NOME_DO_GATEWAY, NOME_DO_PRODUTO
from .gateway import get_all_combos, get_all_connections
from .logs import setup_logging
from .web import start_web_server


def print_status_table(settings: Settings):
Expand Down
1 change: 0 additions & 1 deletion src/nine_rtksync/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Global settings and environment variable loading for this synchronizer."""

import os
import sys
from dataclasses import dataclass
from typing import List, Optional, Tuple

Expand Down
1 change: 0 additions & 1 deletion src/nine_rtksync/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def _execute_cycle(self, reason: str = "scheduled_interval") -> Dict[str, Any]:
start_ts = time.time()
start_iso = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")

ts_str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
get_logger().info(f"[CRON] Ciclo disparado ({reason}). Inspecionando conexoes de contas OAuth...")

try:
Expand Down
2 changes: 0 additions & 2 deletions src/nine_rtksync/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import signal
import threading
import sys
import time
from datetime import datetime, timezone
from typing import Any, Dict, List
Expand All @@ -15,7 +14,6 @@
from .gateway import get_all_connections, update_connection_data
from .discovery import HostDiscoveryEngine
from .logs import get_logger
from .models import ConnectionRecord
from .normalizer import normalize_connection_data
from .providers import ApiKeyProvider, BaseProvider, GenericOAuthProvider, GoogleProvider, LocalProvider
from .web import start_web_server
Expand Down
2 changes: 1 addition & 1 deletion src/nine_rtksync/normalizer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Self-healing and format normalization for credentials and rate-limit locks in the gateway store."""

import time
from datetime import datetime, timezone, timezone
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, Tuple


Expand Down
4 changes: 0 additions & 4 deletions src/nine_rtksync/providers/api_keys.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
"""Static API key connection handler."""

import json
import time
import urllib.request
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, Tuple

from ..credential_check import (
Expand Down
1 change: 0 additions & 1 deletion src/nine_rtksync/sessao.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import base64
import hashlib
import hmac
import os
import secrets
import time
from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion src/nine_rtksync/sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ def testar_conexao_oidc(issuer: str, client_id: str = "", client_secret: str = "
if not _transporte_seguro(val):
return False, f"Endpoint '{endpoint}' não utiliza HTTPS."

return True, f"Conexão OIDC validada com sucesso! Endpoints encontrados."
return True, "Conexão OIDC validada com sucesso! Endpoints encontrados."

testa_conexao_oidc = testar_conexao_oidc

Expand Down
2 changes: 1 addition & 1 deletion src/nine_rtksync/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from .identidade import NOME_DO_GATEWAY, NOME_DO_PRODUTO
from .logs import get_logger
from .prefs import get_preference, set_preference
from . import i18n, protecao, sessao, sso
from . import protecao, sessao, sso
from .render import render_dashboard, render_login_page, render_notice_page
from .gateway import CATALOGO_INACESSIVEL, carregar_painel, esquece_o_catalogo, sondar
from .render import render_landing_page
Expand Down
4 changes: 3 additions & 1 deletion tests/test_health_semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ class TestCarimboDeRenovacao(unittest.TestCase):
"""O ciclo carimba `lastRefreshAt` só quando houve renovação de verdade."""

def ciclo(self, renewed: bool):
import tempfile, os, sqlite3
import os
import sqlite3
import tempfile
from nine_rtksync.config import Settings
from nine_rtksync.daemon import SyncEngine

Expand Down
4 changes: 2 additions & 2 deletions tests/test_irmaos_identicos.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
# leitura para `gateway.py`, e isso continua em aberto.
TETOS_DE_DIVERGENCIA = {
"models.py": 7,
"render.py": 862,
"web.py": 689,
"render.py": 560,
"web.py": 578,
}

# O que cada produto troca de propósito, e que não conta como divergência.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_protecao.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
freio tem de já estar instalado quando ele apertar.
"""

import hashlib
import time
import unittest

from nine_rtksync import protecao
Expand Down
2 changes: 1 addition & 1 deletion tests/test_web_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_dashboard_rejects_invalid_auth(self):
bad_token = base64.b64encode(b"admin:wrongpass").decode("utf-8")
req = urllib.request.Request(url, headers={"Authorization": f"Basic {bad_token}"})
try:
urllib.request.urlopen(url, timeout=3.0)
urllib.request.urlopen(req, timeout=3.0)
self.fail("Expected HTTPError 401")
except urllib.error.HTTPError as e:
self.assertEqual(e.code, 401)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_web_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import urllib.error
import urllib.request

from nine_rtksync.config import Settings
from nine_rtksync import web as web_server


class NoRedirect(urllib.request.HTTPRedirectHandler):
"""Nao segue o 303: o teste precisa ver a resposta, nao o destino."""
Expand All @@ -18,9 +21,6 @@ def redirect_request(self, req, fp, code, msg, headers, newurl):
return None


from nine_rtksync.config import Settings
from nine_rtksync import web as web_server

PORT = 19294
BASE = f"http://127.0.0.1:{PORT}"

Expand Down
Loading