mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-26 00:30:27 +00:00
test(security): reject URLs with embedded credentials
(cherry picked from commit 09494cb720)
This commit is contained in:
1 parent
822fbb04c2
commit
2b07311b0d
1 file changed
+9
@@ -75,6 +75,15 @@ def test_validate_url_rejects_invalid_port(url):
|
||||
validate_url(url)
|
||||
|
||||
|
||||
@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