from pathlib import Path from sql_sqlite import ServiceRegistry def test_sqlite_crud_and_sqli_resistance(tmp_path: Path) -> None: db = tmp_path / "registry.db" reg = ServiceRegistry(db) reg.init_schema() id1 = reg.register("billing-api", "team-core") id2 = reg.register("auth-api", "team-core") reg.register("metrics-proxy", "team-sre") assert id1 > 0 assert id2 > id1 assert reg.find_by_owner("team-core") == ["auth-api", "billing-api"] # Negative security assertion: SQL Injection payload must NOT return all rows sqli_payload = "' OR '1'='1" assert reg.find_by_owner(sqli_payload) == []