Skip to content

Commit

Permalink
Still also allow AIKIDO_BLOCKING
Browse files Browse the repository at this point in the history
  • Loading branch information
bitterpanda63 committed Jan 28, 2025
1 parent cd0ae35 commit 477ac81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aikido_zen/helpers/check_env_for_blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def check_env_for_blocking():
"""
# Set log level
aikido_blocking_env = os.getenv("AIKIDO_BLOCK")
if aikido_blocking_env is None:
aikido_blocking_env = os.getenv("AIKIDO_BLOCKING") # Fallback to AIKIDO_BLOCKING.
if aikido_blocking_env is not None:
return aikido_blocking_env.lower() in ["true", "1"]
return False
6 changes: 6 additions & 0 deletions aikido_zen/sinks/tests/urrlib3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def test_srrf_test_domain(monkeypatch):
with pytest.raises(AikidoSSRF):
http.request("GET", SSRF_TEST_DOMAIN)

def test_srrf_test_domain_with_aikido_blocking(monkeypatch):
http = urllib3.PoolManager()
set_context_and_lifecycle(SSRF_TEST_DOMAIN)
monkeypatch.setenv("AIKIDO_BLOCKING", "1")
with pytest.raises(AikidoSSRF):
http.request("GET", SSRF_TEST_DOMAIN)

def test_srrf_test_domain_twice(monkeypatch):
http = urllib3.PoolManager()
Expand Down

0 comments on commit 477ac81

Please sign in to comment.