fix: enforce utf8 resolution limits
This commit is contained in:
@@ -161,6 +161,14 @@ def test_resolution_input_rejects_oversized_and_non_string_fields_cleanly():
|
||||
assert error
|
||||
|
||||
|
||||
def test_resolution_input_rejects_multibyte_utf8_at_ascii_character_limits():
|
||||
base = {"scope": "PRODUCT", "scope_key": "P-001", "key": "service_cfop", "value": "5102", "reason": "reviewed"}
|
||||
for field, value in (("value", "é" * 512), ("reason", "é" * 2000)):
|
||||
normalized, error = validate_resolution_input({**base, field: value})
|
||||
assert normalized is None
|
||||
assert error and "bytes" in error
|
||||
|
||||
|
||||
def test_boundary_length_audit_keeps_required_fields_instead_of_truncating_context():
|
||||
session_factory = setup_db()
|
||||
blocker_id, admin_id, _ = _seed_blocker(session_factory)
|
||||
|
||||
Reference in New Issue
Block a user