Home / Function/ test_cloud_metadata_always_blocked() — langchain Function Reference

test_cloud_metadata_always_blocked() — langchain Function Reference

Architecture documentation for the test_cloud_metadata_always_blocked() function in test_ssrf_protection.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  926c132f_c4fb_f7f2_e01e_e6250505cabf["test_cloud_metadata_always_blocked()"]
  55eb5d18_546a_f8ab_e6ce_af072e9c336d["TestValidateSafeUrl"]
  926c132f_c4fb_f7f2_e01e_e6250505cabf -->|defined in| 55eb5d18_546a_f8ab_e6ce_af072e9c336d
  style 926c132f_c4fb_f7f2_e01e_e6250505cabf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 134–144

    def test_cloud_metadata_always_blocked(self) -> None:
        """Test that cloud metadata endpoints are always blocked."""
        with pytest.raises(ValueError, match="metadata"):
            validate_safe_url("http://169.254.169.254/latest/meta-data/")

        # Even with allow_private=True
        with pytest.raises(ValueError, match="metadata"):
            validate_safe_url(
                "http://169.254.169.254/latest/meta-data/",
                allow_private=True,
            )

Domain

Subdomains

Frequently Asked Questions

What does test_cloud_metadata_always_blocked() do?
test_cloud_metadata_always_blocked() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_ssrf_protection.py.
Where is test_cloud_metadata_always_blocked() defined?
test_cloud_metadata_always_blocked() is defined in libs/core/tests/unit_tests/test_ssrf_protection.py at line 134.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free