-
Bug
-
Resolution: Done
-
Normal
-
None
-
None
-
None
-
False
-
-
False
-
-
Problem
Playwright E2E tests for organization mirroring fail when creating mirror configurations that use harbor.example.com as the external registry URL. The backend's SSRF validation (util/security/ssrf.py) performs DNS resolution on the provided hostname via socket.getaddrinfo(). Since harbor.example.com is not a real DNS-resolvable hostname, the API returns a 400 error:
Cannot resolve hostname 'harbor.example.com'
Affected Tests* playwright/e2e/organization/org-mirroring.spec.ts - "deletes mirror configuration with confirmation" (line 342)
- playwright/e2e/organization/org-mirroring.spec.ts - "creates config with Harbor registry type" (line 599)
Root Cause
The Python API unit tests (endpoints/api/test/test_org_mirror.py) work because they mock DNS resolution via a pytest fixture (_mock_dns_for_ssrf_validation) that patches util.security.ssrf._getaddrinfo to return a fake public IP. The Playwright E2E tests hit the real running backend, so there is no equivalent mock -- the actual DNS lookup fails for the fake hostname.
Impact
These two tests fail consistently in any environment where harbor.example.com does not resolve in DNS, which is every standard environment.