mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-25 16:22:30 +00:00
test(security): reject URLs with embedded credentials
This commit is contained in:
1 parent
2fac78e8ed
commit
09494cb720
1 file changed
+9
@@ -55,6 +55,15 @@ def test_validate_url_rejects_empty_scheme():
|
||||
validate_url("//no-scheme.example.com")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("url", [
|
||||
"https://user:secret@example.com/path",
|
||||
"https://user@example.com/path",
|
||||
])
|
||||
def test_validate_url_rejects_embedded_credentials(url):
|
||||
with pytest.raises(ValueError, match="embedded credentials"):
|
||||
validate_url(url)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# safe_fetch - scheme and redirect guards (mocked network)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user