ВМ1: реализован сбор логов
This commit is contained in:
@@ -19,6 +19,7 @@ os.environ.setdefault(
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from app.logging_security import REDACTED, sanitize_value
|
||||
from app.main import (
|
||||
BitrixClient,
|
||||
TokenCipher,
|
||||
@@ -30,6 +31,17 @@ from app.main import (
|
||||
safely_retryable,
|
||||
validate_portal,
|
||||
)
|
||||
from app.telemetry import add_trace_context, origin_links
|
||||
|
||||
|
||||
def test_bitrix_logs_redact_secrets_and_do_not_invent_trace_ids():
|
||||
value = sanitize_value(
|
||||
{"authorization": "Bearer secret", "url": "https://example.test/?token=secret"}
|
||||
)
|
||||
assert value["authorization"] == REDACTED
|
||||
assert "secret" not in value["url"]
|
||||
assert add_trace_context(None, "info", {"event": "safe"}) == {"event": "safe"}
|
||||
assert origin_links("invalid") == []
|
||||
|
||||
|
||||
def test_token_cipher_binds_aad():
|
||||
|
||||
Reference in New Issue
Block a user