feat: add SQL/SQLite, AppSec, Capstone incident-tracker, Gitea Actions CI and spaced repetition
Test and Lint / quality (push) Successful in 34s
Test and Lint / quality (push) Successful in 34s
This commit is contained in:
1 parent
0ac80d60d4
commit
9430a194c3
18 files changed
+422
-7
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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) == []
|
||||
Reference in new issue
Block a user